mirror of
https://github.com/fankes/TSBattery.git
synced 2025-09-04 17:55:30 +08:00
Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
48eb942167 | |||
fe11d0e67b | |||
5fffb0b154 | |||
316db6f887 | |||
17b3d8ac9a | |||
6d58f0330b | |||
1c42bc4def | |||
a3772e3673 | |||
af20fad070 | |||
e510e5d043 | |||
2ebc0bc2dc | |||
3e23c67ad2 | |||
6ff9a08366 | |||
8a90303228 | |||
5b411227d9 | |||
88db36a848 |
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -14,7 +14,6 @@
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
@@ -2,7 +2,8 @@
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
[](https://t.me/XiaofangInternet)
|
||||
<br/><br/>
|
||||
<br/>
|
||||
A new way to save your battery avoid cancer apps hacker it.<br/>
|
||||
@@ -11,7 +12,7 @@ TSBattery 是一个旨在使 QQ、TIM、微信 变得更省电的开源 Xposed
|
||||
# 开始使用
|
||||
|
||||
点击下载最新版本
|
||||
<a href='https://github.com/fankes/TSBattery/releases'></a>
|
||||
<a href='https://github.com/fankes/TSBattery/releases'></a>
|
||||
<br/><br/>
|
||||
⚠️ 适配说明<br/>
|
||||
|
||||
|
@@ -46,8 +46,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
compileOnly 'de.robv.android.xposed:api:82'
|
||||
implementation 'com.highcapable.yukihookapi:api:1.0.2'
|
||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.2'
|
||||
implementation 'com.highcapable.yukihookapi:api:1.0.5.2'
|
||||
ksp 'com.highcapable.yukihookapi:ksp-xposed:1.0.5.2'
|
||||
implementation 'com.geyifeng.immersionbar:immersionbar:3.2.0'
|
||||
implementation 'com.geyifeng.immersionbar:immersionbar-ktx:3.2.0'
|
||||
implementation 'androidx.core:core-ktx:1.7.0'
|
||||
|
@@ -38,15 +38,10 @@ class TSApplication : Application() {
|
||||
* @return [TSApplication]
|
||||
*/
|
||||
val appContext get() = context ?: error("App is death")
|
||||
|
||||
/** 自身 APP 是否已启动 */
|
||||
var isMineStarted = false
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
/** 设置状态 */
|
||||
isMineStarted = true
|
||||
/** 设置静态实例 */
|
||||
context = this
|
||||
/** 跟随系统夜间模式 */
|
||||
|
@@ -25,6 +25,7 @@ object HookConst {
|
||||
|
||||
const val ENABLE_HIDE_ICON = "_hide_icon"
|
||||
const val ENABLE_RUN_INFO = "_tip_run_info"
|
||||
const val ENABLE_NOTIFY_TIP = "_tip_in_notify"
|
||||
const val ENABLE_QQTIM_WHITE_MODE = "_qqtim_white_mode"
|
||||
const val ENABLE_QQTIM_CORESERVICE_BAN = "_qqtim_core_service_ban"
|
||||
const val ENABLE_QQTIM_CORESERVICE_CHILD_BAN = "_qqtim_core_service_child_ban"
|
||||
|
@@ -19,6 +19,8 @@
|
||||
*
|
||||
* This file is Created by fankes on 2022/2/15.
|
||||
*/
|
||||
@file:Suppress("IMPLICIT_CAST_TO_ANY")
|
||||
|
||||
package com.fankes.tsbattery.hook
|
||||
|
||||
import android.app.Activity
|
||||
@@ -27,6 +29,7 @@ import android.content.Intent
|
||||
import android.os.Build
|
||||
import com.fankes.tsbattery.hook.HookConst.DISABLE_WECHAT_HOOK
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_MODULE_VERSION
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_NOTIFY_TIP
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_QQTIM_CORESERVICE_BAN
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_QQTIM_CORESERVICE_CHILD_BAN
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_QQTIM_WHITE_MODE
|
||||
@@ -34,12 +37,12 @@ import com.fankes.tsbattery.hook.HookConst.ENABLE_RUN_INFO
|
||||
import com.fankes.tsbattery.hook.HookConst.QQ_PACKAGE_NAME
|
||||
import com.fankes.tsbattery.hook.HookConst.TIM_PACKAGE_NAME
|
||||
import com.fankes.tsbattery.hook.HookConst.WECHAT_PACKAGE_NAME
|
||||
import com.fankes.tsbattery.utils.showDialog
|
||||
import com.fankes.tsbattery.utils.versionCode
|
||||
import com.fankes.tsbattery.utils.versionName
|
||||
import com.highcapable.yukihookapi.YukiHookAPI.configs
|
||||
import com.fankes.tsbattery.utils.factory.showDialog
|
||||
import com.fankes.tsbattery.utils.factory.versionCode
|
||||
import com.fankes.tsbattery.utils.factory.versionName
|
||||
import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed
|
||||
import com.highcapable.yukihookapi.hook.bean.VariousClass
|
||||
import com.highcapable.yukihookapi.hook.factory.configs
|
||||
import com.highcapable.yukihookapi.hook.factory.encase
|
||||
import com.highcapable.yukihookapi.hook.factory.field
|
||||
import com.highcapable.yukihookapi.hook.log.loggerD
|
||||
@@ -54,9 +57,23 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
|
||||
companion object {
|
||||
|
||||
/** BaseChatPie 类名 */
|
||||
private val BaseChatPieClass =
|
||||
VariousClass("$QQ_PACKAGE_NAME.activity.aio.core.BaseChatPie", "$QQ_PACKAGE_NAME.activity.BaseChatPie")
|
||||
/** QQ、TIM 存在的类 */
|
||||
private const val SplashActivityClass = "$QQ_PACKAGE_NAME.activity.SplashActivity"
|
||||
|
||||
/** QQ、TIM 存在的类 */
|
||||
private const val CoreServiceClass = "$QQ_PACKAGE_NAME.app.CoreService"
|
||||
|
||||
/** QQ、TIM 存在的类 */
|
||||
private const val CoreService_KernelServiceClass = "$QQ_PACKAGE_NAME.app.CoreService\$KernelService"
|
||||
|
||||
/** 微信存在的类 */
|
||||
private const val LauncherUIClass = "$WECHAT_PACKAGE_NAME.ui.LauncherUI"
|
||||
|
||||
/** 根据多个版本存的不同的类 */
|
||||
private val BaseChatPieClass = VariousClass(
|
||||
"$QQ_PACKAGE_NAME.activity.aio.core.BaseChatPie",
|
||||
"$QQ_PACKAGE_NAME.activity.BaseChatPie"
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,6 +122,10 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
interceptBaseChatPie(methodName = "bk")
|
||||
interceptBaseChatPie(methodName = "bl")
|
||||
}
|
||||
"8.8.83" -> {
|
||||
interceptBaseChatPie(methodName = "bl")
|
||||
interceptBaseChatPie(methodName = "bm")
|
||||
}
|
||||
else -> loggerD(msg = "$version not supported!")
|
||||
}
|
||||
}
|
||||
@@ -145,12 +166,13 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
param(CharSequenceType)
|
||||
}
|
||||
beforeHook {
|
||||
when (args[0] as CharSequence) {
|
||||
"QQ正在后台运行" ->
|
||||
args().set("QQ正在后台运行 - TSBattery 守护中")
|
||||
"TIM正在后台运行" ->
|
||||
args().set("TIM正在后台运行 - TSBattery 守护中")
|
||||
}
|
||||
if (prefs.getBoolean(ENABLE_NOTIFY_TIP, default = true))
|
||||
when (firstArgs as CharSequence) {
|
||||
"QQ正在后台运行" ->
|
||||
args().set("QQ正在后台运行 - TSBattery 守护中")
|
||||
"TIM正在后台运行" ->
|
||||
args().set("TIM正在后台运行 - TSBattery 守护中")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -163,7 +185,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
when {
|
||||
!prefs.getBoolean(ENABLE_RUN_INFO) -> {}
|
||||
isQQTIM ->
|
||||
findClass(name = "$QQ_PACKAGE_NAME.activity.SplashActivity").hook {
|
||||
SplashActivityClass.hook {
|
||||
/**
|
||||
* Hook 启动界面的第一个 [Activity]
|
||||
* QQ 和 TIM 都是一样的类
|
||||
@@ -197,7 +219,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
}
|
||||
}
|
||||
else ->
|
||||
findClass(name = "$WECHAT_PACKAGE_NAME.ui.LauncherUI").hook {
|
||||
LauncherUIClass.hook {
|
||||
/**
|
||||
* Hook 启动界面的第一个 [Activity]
|
||||
* 在里面加入提示运行信息的对话框测试模块是否激活
|
||||
@@ -236,7 +258,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
*/
|
||||
private fun PackageParam.hookCoreService(isQQ: Boolean) {
|
||||
if (prefs.getBoolean(ENABLE_QQTIM_CORESERVICE_BAN))
|
||||
findClass(name = "$QQ_PACKAGE_NAME.app.CoreService").hook {
|
||||
CoreServiceClass.hook {
|
||||
if (isQQ) {
|
||||
injectMember {
|
||||
method { name = "startTempService" }
|
||||
@@ -269,7 +291,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
}
|
||||
}
|
||||
if (prefs.getBoolean(ENABLE_QQTIM_CORESERVICE_CHILD_BAN))
|
||||
findClass(name = "$QQ_PACKAGE_NAME.app.CoreService\$KernelService").hook {
|
||||
CoreService_KernelServiceClass.hook {
|
||||
injectMember {
|
||||
method { name = "onCreate" }
|
||||
afterHook {
|
||||
@@ -290,11 +312,13 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onInit() = configs {
|
||||
debugTag = "TSBattery"
|
||||
isDebug = false
|
||||
isEnableModulePrefsCache = false
|
||||
}
|
||||
|
||||
override fun onHook() = encase {
|
||||
configs {
|
||||
debugTag = "TSBattery"
|
||||
isDebug = false
|
||||
}
|
||||
loadApp(QQ_PACKAGE_NAME) {
|
||||
hookSystemWakeLock()
|
||||
hookNotification()
|
||||
@@ -302,7 +326,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
hookModuleRunningInfo(isQQTIM = true)
|
||||
if (prefs.getBoolean(ENABLE_QQTIM_WHITE_MODE)) return@loadApp
|
||||
/** 通过在 SplashActivity 里取到应用的版本号 */
|
||||
findClass(name = "$QQ_PACKAGE_NAME.activity.SplashActivity").hook {
|
||||
SplashActivityClass.hook {
|
||||
injectMember {
|
||||
method {
|
||||
name = "doOnCreate"
|
||||
@@ -409,7 +433,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
method { name = "run" }
|
||||
intercept()
|
||||
}.ignoredAllFailure()
|
||||
}
|
||||
}.ignoredHookClassNotFoundFailure()
|
||||
/**
|
||||
* 这个是毒瘤核心类
|
||||
* WakeLockMonitor
|
||||
@@ -474,7 +498,7 @@ class HookEntry : YukiHookXposedInitProxy {
|
||||
}
|
||||
intercept()
|
||||
}
|
||||
}
|
||||
}.ignoredHookClassNotFoundFailure()
|
||||
}
|
||||
loadApp(TIM_PACKAGE_NAME) {
|
||||
hookSystemWakeLock()
|
||||
|
@@ -41,6 +41,7 @@ import com.fankes.tsbattery.R
|
||||
import com.fankes.tsbattery.hook.HookConst.DISABLE_WECHAT_HOOK
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_HIDE_ICON
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_MODULE_VERSION
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_NOTIFY_TIP
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_QQTIM_CORESERVICE_BAN
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_QQTIM_CORESERVICE_CHILD_BAN
|
||||
import com.fankes.tsbattery.hook.HookConst.ENABLE_QQTIM_WHITE_MODE
|
||||
@@ -48,10 +49,10 @@ import com.fankes.tsbattery.hook.HookConst.ENABLE_RUN_INFO
|
||||
import com.fankes.tsbattery.hook.HookConst.QQ_PACKAGE_NAME
|
||||
import com.fankes.tsbattery.hook.HookConst.TIM_PACKAGE_NAME
|
||||
import com.fankes.tsbattery.hook.HookConst.WECHAT_PACKAGE_NAME
|
||||
import com.fankes.tsbattery.utils.isInstall
|
||||
import com.fankes.tsbattery.utils.isNotSystemInDarkMode
|
||||
import com.fankes.tsbattery.utils.openSelfSetting
|
||||
import com.fankes.tsbattery.utils.showDialog
|
||||
import com.fankes.tsbattery.utils.factory.isInstall
|
||||
import com.fankes.tsbattery.utils.factory.isNotSystemInDarkMode
|
||||
import com.fankes.tsbattery.utils.factory.openSelfSetting
|
||||
import com.fankes.tsbattery.utils.factory.showDialog
|
||||
import com.gyf.immersionbar.ktx.immersionBar
|
||||
import com.highcapable.yukihookapi.hook.factory.isTaiChiModuleActive
|
||||
import com.highcapable.yukihookapi.hook.factory.modulePrefs
|
||||
@@ -63,7 +64,7 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
private const val moduleVersion = BuildConfig.VERSION_NAME
|
||||
private const val qqSupportVersion =
|
||||
"8.2.11(Play)、8.8.17、8.8.23、8.8.35、8.8.38、8.8.50、8.8.55、8.8.68、8.8.80 (8.2.11、8.5.5~8.8.80)"
|
||||
"8.2.11(Play)、8.8.17、8.8.23、8.8.35、8.8.38、8.8.50、8.8.55、8.8.68、8.8.80、8.8.83 (8.2.11、8.5.5~8.8.83)"
|
||||
private const val timSupportVersion = "2+、3+ (并未完全测试每个版本)"
|
||||
private const val wechatSupportVersion = "全版本仅支持基础省电,更多功能依然画饼"
|
||||
}
|
||||
@@ -123,7 +124,7 @@ class MainActivity : AppCompatActivity() {
|
||||
findViewById<View>(R.id.main_text_tim_noinstall).isGone = TIM_PACKAGE_NAME.isInstall
|
||||
findViewById<View>(R.id.main_text_wechat_noinstall).isGone = WECHAT_PACKAGE_NAME.isInstall
|
||||
/** 设置文本 */
|
||||
findViewById<TextView>(R.id.main_text_version).text = "当前版本:$moduleVersion"
|
||||
findViewById<TextView>(R.id.main_text_version).text = "模块版本:$moduleVersion"
|
||||
findViewById<TextView>(R.id.main_text_support_qq).apply {
|
||||
text = qqSupportVersion
|
||||
setOnClickListener {
|
||||
@@ -161,6 +162,7 @@ class MainActivity : AppCompatActivity() {
|
||||
val wechatDisableHookSwitch = findViewById<SwitchCompat>(R.id.disable_wechat_sv_switch)
|
||||
val hideIconInLauncherSwitch = findViewById<SwitchCompat>(R.id.hide_icon_in_launcher_switch)
|
||||
val notifyModuleInfoSwitch = findViewById<SwitchCompat>(R.id.notify_module_info_switch)
|
||||
val notifyNotifyTipSwitch = findViewById<SwitchCompat>(R.id.notify_module_notify_tip_switch)
|
||||
/** 获取 Sp 存储的信息 */
|
||||
qqTimProtectModeSwitch.isChecked = modulePrefs.getBoolean(ENABLE_QQTIM_WHITE_MODE)
|
||||
qqTimCoreServiceSwitch.isChecked = modulePrefs.getBoolean(ENABLE_QQTIM_CORESERVICE_BAN)
|
||||
@@ -168,6 +170,7 @@ class MainActivity : AppCompatActivity() {
|
||||
wechatDisableHookSwitch.isChecked = modulePrefs.getBoolean(DISABLE_WECHAT_HOOK)
|
||||
hideIconInLauncherSwitch.isChecked = modulePrefs.getBoolean(ENABLE_HIDE_ICON)
|
||||
notifyModuleInfoSwitch.isChecked = modulePrefs.getBoolean(ENABLE_RUN_INFO)
|
||||
notifyNotifyTipSwitch.isChecked = modulePrefs.getBoolean(ENABLE_NOTIFY_TIP, default = true)
|
||||
qqTimProtectModeSwitch.setOnCheckedChangeListener { btn, b ->
|
||||
if (!btn.isPressed) return@setOnCheckedChangeListener
|
||||
modulePrefs.putBoolean(ENABLE_QQTIM_WHITE_MODE, b)
|
||||
@@ -197,6 +200,10 @@ class MainActivity : AppCompatActivity() {
|
||||
if (!btn.isPressed) return@setOnCheckedChangeListener
|
||||
modulePrefs.putBoolean(ENABLE_RUN_INFO, b)
|
||||
}
|
||||
notifyNotifyTipSwitch.setOnCheckedChangeListener { btn, b ->
|
||||
if (!btn.isPressed) return@setOnCheckedChangeListener
|
||||
modulePrefs.putBoolean(ENABLE_NOTIFY_TIP, b)
|
||||
}
|
||||
/** 快捷操作 QQ */
|
||||
findViewById<View>(R.id.quick_qq_button).setOnClickListener { openSelfSetting(QQ_PACKAGE_NAME) }
|
||||
/** 快捷操作 TIM */
|
||||
@@ -217,8 +224,8 @@ class MainActivity : AppCompatActivity() {
|
||||
Toast.makeText(this, "你可能没有安装酷安", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
/** 项目地址点击事件 */
|
||||
findViewById<View>(R.id.link_with_project_address).setOnClickListener {
|
||||
/** 项目地址按钮点击事件 */
|
||||
findViewById<View>(R.id.title_github_icon).setOnClickListener {
|
||||
runCatching {
|
||||
startActivity(Intent().apply {
|
||||
action = "android.intent.action.VIEW"
|
||||
|
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
@file:Suppress("unused")
|
||||
|
||||
package com.fankes.tsbattery.utils
|
||||
package com.fankes.tsbattery.utils.factory
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
@@ -102,7 +102,7 @@ class DialogBuilder(private val context: Context, private val isUseBlackTheme: B
|
||||
).apply {
|
||||
shape = GradientDrawable.RECTANGLE
|
||||
gradientType = GradientDrawable.LINEAR_GRADIENT
|
||||
cornerRadius = 15.dp(this@DialogBuilder.context)
|
||||
cornerRadius = 15.dpFloat(this@DialogBuilder.context)
|
||||
})
|
||||
}?.show()
|
||||
}
|
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.fankes.tsbattery.utils
|
||||
package com.fankes.tsbattery.utils.factory
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
@@ -80,33 +80,32 @@ val Context.versionName get() = packageInfo.versionName ?: ""
|
||||
val Context.versionCode get() = packageInfo.versionCode
|
||||
|
||||
/**
|
||||
* dp 转换为 px
|
||||
* dp 转换为 pxInt
|
||||
* @param context 使用的实例
|
||||
* @return [Int]
|
||||
*/
|
||||
val Number.dp get() = (toFloat() * appContext.resources.displayMetrics.density).toInt()
|
||||
fun Number.dp(context: Context) = dpFloat(context).toInt()
|
||||
|
||||
/**
|
||||
* dp 转换为 px
|
||||
* dp 转换为 pxFloat
|
||||
* @param context 使用的实例
|
||||
* @return [Float]
|
||||
*/
|
||||
fun Number.dp(context: Context) = toFloat() * context.resources.displayMetrics.density
|
||||
fun Number.dpFloat(context: Context) = toFloat() * context.resources.displayMetrics.density
|
||||
|
||||
/**
|
||||
* 跳转 APP 自身设置界面
|
||||
* @param packageName 包名
|
||||
*/
|
||||
fun Context.openSelfSetting(packageName: String) {
|
||||
try {
|
||||
if (packageName.isInstall)
|
||||
startActivity(Intent().apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
|
||||
data = Uri.fromParts("package", packageName, null)
|
||||
})
|
||||
else Toast.makeText(this, "你没有安装此应用", Toast.LENGTH_SHORT).show()
|
||||
} catch (_: Exception) {
|
||||
Toast.makeText(this, "启动 $packageName 应用信息失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
fun Context.openSelfSetting(packageName: String) = runCatching {
|
||||
if (packageName.isInstall)
|
||||
startActivity(Intent().apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS
|
||||
data = Uri.fromParts("package", packageName, null)
|
||||
})
|
||||
else Toast.makeText(this, "你没有安装此应用", Toast.LENGTH_SHORT).show()
|
||||
}.onFailure {
|
||||
Toast.makeText(this, "启动 $packageName 应用信息失败", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
@@ -28,8 +28,8 @@ import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.SwitchCompat
|
||||
import com.fankes.tsbattery.utils.dp
|
||||
import com.fankes.tsbattery.utils.drawable.drawabletoolbox.DrawableBuilder
|
||||
import com.fankes.tsbattery.utils.factory.dp
|
||||
|
||||
class MaterialSwitch(context: Context, attrs: AttributeSet?) : SwitchCompat(context, attrs) {
|
||||
|
||||
@@ -47,16 +47,16 @@ class MaterialSwitch(context: Context, attrs: AttributeSet?) : SwitchCompat(cont
|
||||
.rectangle()
|
||||
.rounded()
|
||||
.solidColor(0xFF656565.toInt())
|
||||
.height(20.dp)
|
||||
.cornerRadius(15.dp)
|
||||
.height(20.dp(context))
|
||||
.cornerRadius(15.dp(context))
|
||||
.build()
|
||||
thumbDrawable = DrawableBuilder()
|
||||
.rectangle()
|
||||
.rounded()
|
||||
.solidColor(Color.WHITE)
|
||||
.size(20.dp, 20.dp)
|
||||
.cornerRadius(20.dp)
|
||||
.strokeWidth(2.dp)
|
||||
.size(20.dp(context), 20.dp(context))
|
||||
.cornerRadius(20.dp(context))
|
||||
.strokeWidth(8.dp(context))
|
||||
.strokeColor(Color.TRANSPARENT)
|
||||
.build()
|
||||
trackTintList = toColors(
|
||||
|
@@ -13,19 +13,31 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="0dp"
|
||||
android:gravity="center|start"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingTop="13dp"
|
||||
android:paddingRight="15dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true"
|
||||
android:text="TSBattery"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:id="@+id/title_github_icon"
|
||||
style="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:layout_width="27dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:alpha="0.85"
|
||||
android:src="@mipmap/ic_github"
|
||||
android:tint="@color/colorTextGray" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -73,7 +85,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:alpha="0.8"
|
||||
android:text="当前版本:%1"
|
||||
android:text="模块版本:%1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
|
||||
@@ -333,7 +345,8 @@
|
||||
<com.fankes.tsbattery.view.MaterialSwitch
|
||||
android:id="@+id/shut_core_sv_qqtim_switch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="关闭 CoreService"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="15sp" />
|
||||
@@ -351,7 +364,8 @@
|
||||
<com.fankes.tsbattery.view.MaterialSwitch
|
||||
android:id="@+id/shut_core_sv_kn_qqtim_switch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="关闭 CoreService$KernelService"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="15sp" />
|
||||
@@ -513,9 +527,28 @@
|
||||
android:paddingRight="15dp">
|
||||
|
||||
<com.fankes.tsbattery.view.MaterialSwitch
|
||||
android:id="@+id/notify_module_info_switch"
|
||||
android:id="@+id/notify_module_notify_tip_switch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="通知栏显示守护状态"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:alpha="0.6"
|
||||
android:lineSpacingExtra="6dp"
|
||||
android:text="此功能仅支持 QQ、TIM,在开启“系统通知栏显示 QQ、TIM 图标”后系统通知后方将在最后显示“TSBattery 守护中”字样以判断模块已经生效,若不喜欢,你可以随时关闭这个功能。"
|
||||
android:textColor="@color/colorTextDark"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<com.fankes.tsbattery.view.MaterialSwitch
|
||||
android:id="@+id/notify_module_info_switch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="提示模块运行信息"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="15sp" />
|
||||
@@ -679,53 +712,6 @@
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/link_with_project_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="@drawable/bg_permotion_round"
|
||||
android:elevation="0dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center|start">
|
||||
|
||||
<androidx.constraintlayout.utils.widget.ImageFilterView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:alpha="0.85"
|
||||
android:src="@mipmap/ic_about"
|
||||
android:tint="@color/colorTextGray" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.85"
|
||||
android:singleLine="true"
|
||||
android:text="项目地址"
|
||||
android:textColor="@color/colorTextGray"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.8"
|
||||
android:lineSpacingExtra="6dp"
|
||||
android:text="本软件是免费开源项目,遵循 AGPL3.0 协议,你可以点击这里前往 Github 查看源码以及获取模块更新。"
|
||||
android:textColor="@color/colorTextDark"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
BIN
app/src/main/res/mipmap-xxhdpi/ic_github.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_github.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
@@ -5,8 +5,8 @@ plugins {
|
||||
}
|
||||
|
||||
ext {
|
||||
appVersionName = "3.2"
|
||||
appVersionCode = 11
|
||||
appVersionName = "3.3"
|
||||
appVersionCode = 12
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
|
Reference in New Issue
Block a user