更新一系列开关以及说明

This commit is contained in:
乌堆小透明
2022-03-09 23:51:28 +08:00
parent 9107c359e0
commit ead14544f9
9 changed files with 38 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@@ -35,6 +35,10 @@ class MainHook : IXposedHookLoadPackage {
"com.miui.mediaeditor" -> {
MediaEditor().handleLoadPackage(lpparam)
}
//相册编辑
"com.android.updater" -> {
Updater().handleLoadPackage(lpparam)
}
}
}
}

View File

@@ -8,22 +8,22 @@ import de.robv.android.xposed.callbacks.XC_LoadPackage
class Updater : IXposedHookLoadPackage {
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
var letter = 'a'
for (i in 0..25) {
val classIfExists = XposedHelpers.findClassIfExists(
"com.android.updater.common.utils.$letter", lpparam.classLoader
) ?: continue
if (classIfExists.declaredFields.size >= 9 && classIfExists.declaredMethods.size > 60) {
XposedHelpers.findAndHookMethod(classIfExists, "T", object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (XSPUtils.getBoolean("remove_ota_validate", false)) {
if (XSPUtils.getBoolean("remove_ota_validate", false)) {
var letter = 'a'
for (i in 0..25) {
val classIfExists = XposedHelpers.findClassIfExists(
"com.android.updater.common.utils.$letter", lpparam.classLoader
) ?: continue
if (classIfExists.declaredFields.size >= 9 && classIfExists.declaredMethods.size > 60) {
XposedHelpers.findAndHookMethod(classIfExists, "T", object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
param.result = false
}
}
})
return
})
return
}
letter++
}
letter++
}
}
}

View File

@@ -18,7 +18,7 @@ class HideNetworkSpeedSplitter : IXposedHookLoadPackage {
override fun afterHookedMethod(param: MethodHookParam) {
if (XSPUtils.getBoolean("hide_network_speed_splitter", false)) {
val textView = param.thisObject as TextView
textView.text = ""
textView.text = " "
}
}
})

View File

@@ -140,4 +140,8 @@
<string name="right_margin">右边距 (0: 自动)</string>
<string name="layout_compatibility_mode_summary">使左右挖孔屏幕能正常显示</string>
<string name="remove_macro_blacklist">去除游戏自动连招黑名单</string>
<string name="hide_network_speed_splitter">隐藏网速分隔符</string>
<string name="updater">系统更新</string>
<string name="remove_ota_validate">*移除OTA验证 [实验性]</string>
<string name="remove_ota_validate_summary">- 仅支持VAB系列使用其余系列请不要开启。\n- 无需内测试资格即可刷入完整内测包。\n- 拥有内测权限的用户将无法接收内测更新\n可用于屏蔽系统更新。\n- 跨版本类型升级后,建议清空数据。\n- 不支持非官方ROM使用。</string>
</resources>

View File

@@ -139,4 +139,9 @@
<string name="left_margin">左邊距 (0: 自動)</string>
<string name="right_margin">右邊距 (0: 自動)</string>
<string name="layout_compatibility_mode_summary">使左右挖孔螢幕能正常顯示</string>
<string name="remove_macro_blacklist">去除遊戲自動連招黑名單</string>
<string name="hide_network_speed_splitter">隱藏網速分隔符</string>
<string name="updater">系統更新</string>
<string name="remove_ota_validate">*移除OTA驗證 [實驗性]</string>
<string name="remove_ota_validate_summary">- 僅支持VAB系列使用其餘系列請不要開啟。\n- 無需內測試資格即可刷入完整內測包。\n- 擁有內測權限的用戶將無法接收內測更新\n可用於屏蔽系統更新。\n- 跨版本類型升級後,建議清空數據。\n- 不支持非官方ROM使用。</string>
</resources>

View File

@@ -139,4 +139,9 @@
<string name="left_margin">左邊距 (0: 自動)</string>
<string name="right_margin">右邊距 (0: 自動)</string>
<string name="layout_compatibility_mode_summary">使左右挖孔螢幕能正常顯示</string>
<string name="remove_macro_blacklist">去除遊戲自動連招黑名單</string>
<string name="hide_network_speed_splitter">隱藏網速分隔符</string>
<string name="updater">系統更新</string>
<string name="remove_ota_validate">*移除OTA驗證 [實驗性]</string>
<string name="remove_ota_validate_summary">- 僅支持VAB系列使用其餘系列請不要開啟。\n- 無需內測試資格即可刷入完整內測包。\n- 擁有內測權限的用戶將無法接收內測更新\n可用於屏蔽系統更新。\n- 跨版本類型升級後,建議清空數據。\n- 不支持非官方ROM使用。</string>
</resources>

View File

@@ -7,5 +7,6 @@
<item>com.miui.powerkeeper</item>
<item>com.miui.home</item>
<item>com.miui.mediaeditor</item>
<item>com.android.updater</item>
</string-array>
</resources>

View File

@@ -140,4 +140,8 @@
<string name="right_margin">Right margin (0: Auto)</string>
<string name="layout_compatibility_mode_summary">Make the left and right hole screen can be displayed normally</string>
<string name="remove_macro_blacklist">Remove game macro blacklist</string>
<string name="hide_network_speed_splitter">Hide network speed splitter</string>
<string name="updater">Updater</string>
<string name="remove_ota_validate">*Remove OTA validate [LAB]</string>
<string name="remove_ota_validate_summary">- Only support VAB series use, please do not open other series.\n- No need for internal testing qualification to flash into the full internal testing package.\n- Those who have internal testing permission will not be able to receive internal testing updates, and can be used to block system updates.\n- After cross-version type upgrade, it is recommended to clear data.\n- Unofficial ROM usage is not supported.</string>
</resources>