Skip to content

Commit

Permalink
优化 系统更新-伪装版本 (在HyperOS设备上的我的设备页显示修改后的版本名)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Nov 14, 2023
1 parent b05728a commit 8cae6bc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnablePadArea;
import com.sevtinge.hyperceiler.module.hook.systemsettings.EnableSpeedMode;
import com.sevtinge.hyperceiler.module.hook.systemsettings.InternationalBuild;
import com.sevtinge.hyperceiler.module.hook.systemsettings.ModifySystemVersion;
import com.sevtinge.hyperceiler.module.hook.systemsettings.NewNFCPage;
import com.sevtinge.hyperceiler.module.hook.systemsettings.NoveltyHaptic;
import com.sevtinge.hyperceiler.module.hook.systemsettings.QuickManageOverlayPermission;
Expand Down Expand Up @@ -44,6 +45,8 @@ public void handleLoadPackage() {
initHook(new EnablePadArea(),mPrefsMap.getBoolean("system_settings_enable_pad_area"));
initHook(new EnableFoldArea(),mPrefsMap.getBoolean("system_settings_enable_fold_area"));

initHook(new ModifySystemVersion(), mPrefsMap.getBoolean("updater_enable_miui_version") && mPrefsMap.getStringAsInt("updater_version_mode", 1) != 1);

if (!isAndroidVersion(30)) {
initHook(UnlockTaplusForSettings.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.sevtinge.hyperceiler.module.hook.systemsettings;

import com.sevtinge.hyperceiler.module.base.BaseHook;

public class ModifySystemVersion extends BaseHook {
@Override
public void init() {
findAndHookMethod("com.android.settings.device.MiuiAboutPhoneUtils", "getOsVersionCode", new MethodHook(){
@Override
protected void before(MethodHookParam param) throws Throwable {
param.setResult(mPrefsMap.getString("various_updater_miui_version", "1.0.0.0"));
}
});
}
}

0 comments on commit 8cae6bc

Please sign in to comment.