Skip to content

Commit

Permalink
优化 系统更新-启用伪装版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Nov 14, 2023
1 parent f678f7f commit b05728a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ public class Updater extends BaseModule {
public void handleLoadPackage() {
// dexKit load
initHook(LoadHostDir.INSTANCE);
if (mPrefsMap.getStringAsInt("updater_version_mode", 1) != 1) {
initHook(VersionCodeNew.INSTANCE);
} else {
initHook(new VersionCodeModify(), !TextUtils.isEmpty(mPrefsMap.getString("various_updater_miui_version", "")));
if (mPrefsMap.getBoolean("updater_enable_miui_version")) {
if (mPrefsMap.getStringAsInt("updater_version_mode", 1) != 1) {
initHook(VersionCodeNew.INSTANCE);
} else {
initHook(new VersionCodeModify(), !TextUtils.isEmpty(mPrefsMap.getString("various_updater_miui_version", "")));
}
initHook(AndroidVersionCode.INSTANCE, !TextUtils.isEmpty(mPrefsMap.getString("various_updater_android_version", "")));
initHook(DeviceModify.INSTANCE, !TextUtils.isEmpty(mPrefsMap.getString("updater_device", "")));
}
initHook(AndroidVersionCode.INSTANCE, !TextUtils.isEmpty(mPrefsMap.getString("various_updater_android_version", "")));
initHook(new VabUpdate(), mPrefsMap.getBoolean("updater_fuck_vab"));
initHook(DeviceModify.INSTANCE, !TextUtils.isEmpty(mPrefsMap.getString("updater_device", "")));
// dexKit finish
initHook(CloseHostDir.INSTANCE);
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@
<string name="theme_manager_enable_fold_theme">启用 Fold 主题</string>
<!--系统更新-->
<string name="updater">系统更新</string>
<string name="updater_enable_miui_version">启用伪装版本</string>
<string name="updater_fuck_vab">移除 OTA 验证</string>
<string name="updater_fuck_vab_desc">仅支持 VAB 设备,其他非 VAB 设备请不要开启!\n- 无需内测权限即可刷入完整内测卡刷包\n- 跨不同版本类型刷入后建议清除数据\n- 不支持任何非官方 ROM 使用\n- 此功能有一定危险性,请在了解 Fastboot 操作后再评估是否开启</string>
<string name="updater_version_mode">伪装类型</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,7 @@
<string name="misound">Mi Sound</string>
<string name="misound_increase_sampling_rate">Increase sampling rate</string>
<string name="system_framework_allow_all_dark_mode">Allow all apps to use dark mode</string>
<string name="updater_enable_miui_version">Enable Fake version for Updater</string>
<!--Tip-->
<string name="tip_0">Tip: Here\'s a tip!</string>
<string name="tip_1">Tip: You can support us by donating in \"About - Support\".</string>
Expand Down
12 changes: 11 additions & 1 deletion app/src/main/res/xml/updater.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,40 @@
android:key="prefs_key_updater_fuck_vab"
android:defaultValue="false" />

<SwitchPreference
android:title="@string/updater_enable_miui_version"
android:key="prefs_key_updater_enable_miui_version"
android:defaultValue="false" />

<DropDownPreference
android:key="prefs_key_updater_version_mode"
android:title="@string/updater_version_mode"
android:defaultValue="1"
app:entries="@array/updater_version_mode"
app:entryValues="@array/updater_version_mode_value" />
app:entryValues="@array/updater_version_mode_value"
android:dependency="prefs_key_updater_enable_miui_version" />

<EditTextPreference
android:defaultValue="V816"
android:title="@string/updater_big_version"
android:summary="@string/updater_big_version_desc"
android:dependency="prefs_key_updater_enable_miui_version"
android:key="prefs_key_various_updater_big_version" />

<EditTextPreference
android:dependency="prefs_key_updater_enable_miui_version"
android:title="@string/updater_miui_version"
android:summary="@string/updater_miui_version_desc"
android:key="prefs_key_various_updater_miui_version" />

<EditTextPreference
android:dependency="prefs_key_updater_enable_miui_version"
android:title="@string/updater_android_version"
android:summary="@string/updater_miui_version_desc"
android:key="prefs_key_various_updater_android_version" />

<EditTextPreference
android:dependency="prefs_key_updater_enable_miui_version"
android:title="@string/updater_device"
android:summary="@string/updater_device_desc"
android:key="prefs_key_updater_device"
Expand Down

0 comments on commit b05728a

Please sign in to comment.