mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 11:51:22 +08:00
新增去除打开应用弹窗
This commit is contained in:
@@ -1019,6 +1019,15 @@ class SettingsActivity : MIUIActivity() {
|
|||||||
SwitchV("skip_waiting_time")
|
SwitchV("skip_waiting_time")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
add(
|
||||||
|
TextSummaryWithSwitchV(
|
||||||
|
TextSummaryV(
|
||||||
|
textId = R.string.remove_open_app_confirmation_popup,
|
||||||
|
tipsId = R.string.remove_open_app_confirmation_popup_summary
|
||||||
|
),
|
||||||
|
SwitchV("remove_open_app_confirmation_popup")
|
||||||
|
)
|
||||||
|
)
|
||||||
add(
|
add(
|
||||||
TextSummaryWithSwitchV(
|
TextSummaryWithSwitchV(
|
||||||
TextSummaryV(
|
TextSummaryV(
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package com.lt2333.simplicitytools.hook.app
|
package com.lt2333.simplicitytools.hook.app
|
||||||
|
|
||||||
import com.lt2333.simplicitytools.hook.app.securitycenter.LockOneHundred
|
import com.lt2333.simplicitytools.hook.app.securitycenter.*
|
||||||
import com.lt2333.simplicitytools.hook.app.securitycenter.RemoveMacroBlacklist
|
|
||||||
import com.lt2333.simplicitytools.hook.app.securitycenter.ShowBatteryTemperature
|
|
||||||
import com.lt2333.simplicitytools.hook.app.securitycenter.SkipWaitingTime
|
|
||||||
import de.robv.android.xposed.IXposedHookLoadPackage
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
import de.robv.android.xposed.XposedBridge
|
import de.robv.android.xposed.XposedBridge
|
||||||
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
||||||
@@ -11,7 +8,7 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam
|
|||||||
class SecurityCenter : IXposedHookLoadPackage {
|
class SecurityCenter : IXposedHookLoadPackage {
|
||||||
|
|
||||||
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
override fun handleLoadPackage(lpparam: LoadPackageParam) {
|
||||||
XposedBridge.log("Simplicitytools: 成功 Hook "+javaClass.simpleName)
|
XposedBridge.log("Simplicitytools: 成功 Hook " + javaClass.simpleName)
|
||||||
//跳过 5/10秒等待时间
|
//跳过 5/10秒等待时间
|
||||||
SkipWaitingTime().handleLoadPackage(lpparam)
|
SkipWaitingTime().handleLoadPackage(lpparam)
|
||||||
//锁定 100分
|
//锁定 100分
|
||||||
@@ -20,5 +17,7 @@ class SecurityCenter : IXposedHookLoadPackage {
|
|||||||
RemoveMacroBlacklist().handleLoadPackage(lpparam)
|
RemoveMacroBlacklist().handleLoadPackage(lpparam)
|
||||||
//显示电池温度
|
//显示电池温度
|
||||||
ShowBatteryTemperature().handleLoadPackage(lpparam)
|
ShowBatteryTemperature().handleLoadPackage(lpparam)
|
||||||
|
//去除打开应用弹窗
|
||||||
|
RemoveOpenAppConfirmationPopup().handleLoadPackage(lpparam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.lt2333.simplicitytools.hook.app.securitycenter
|
||||||
|
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.lt2333.simplicitytools.util.XSPUtils
|
||||||
|
import com.lt2333.simplicitytools.util.findClass
|
||||||
|
import com.lt2333.simplicitytools.util.hookAfterMethod
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||||
|
|
||||||
|
class RemoveOpenAppConfirmationPopup : IXposedHookLoadPackage {
|
||||||
|
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||||
|
val textViewClass = "android.widget.TextView".findClass(lpparam.classLoader)
|
||||||
|
textViewClass.hookAfterMethod(
|
||||||
|
"setText",
|
||||||
|
CharSequence::class.java
|
||||||
|
) {
|
||||||
|
if (XSPUtils.getBoolean("remove_open_app_confirmation_popup", false)) {
|
||||||
|
val textView = it.thisObject as TextView
|
||||||
|
if (it.args.isNotEmpty() && it.args[0]?.toString().equals(
|
||||||
|
textView.context.resources.getString(
|
||||||
|
textView.context.resources.getIdentifier(
|
||||||
|
"button_text_accept",
|
||||||
|
"string",
|
||||||
|
textView.context.packageName
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
textView.performClick()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -158,4 +158,6 @@
|
|||||||
<string name="participate_in_translation_summary">Help us translate the app into your language</string>
|
<string name="participate_in_translation_summary">Help us translate the app into your language</string>
|
||||||
<string name="lock_screen_charging_current">Display current information during charging</string>
|
<string name="lock_screen_charging_current">Display current information during charging</string>
|
||||||
<string name="current_current">Current</string>
|
<string name="current_current">Current</string>
|
||||||
|
<string name="remove_open_app_confirmation_popup">remove open app popup</string>
|
||||||
|
<string name="remove_open_app_confirmation_popup_summary">remove \"Allow XXX to open XXX\" Chain start popup</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user