Skip to content

Commit

Permalink
加了个不知道干什么用的开发者选项
Browse files Browse the repository at this point in the history
或者对moral而言有点用
  • Loading branch information
Sevtinge committed Nov 5, 2023
1 parent b916ade commit f6cd35d
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/sevtinge/hyperceiler/XposedInit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class XposedInit : BaseXposedInit(), IXposedHookInitPackageResources {
}

init(lpparam)
//CrashRecord.init(EzXHelper.appContext)
SystemFrameworkForCorePatch().handleLoadPackage(lpparam)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@

public abstract class BaseXposedInit implements IXposedHookLoadPackage, IXposedHookZygoteInit {

public static boolean isSafeModeOn = false;

public static ResourcesHook mResHook;
public static String mModulePath = null;
public static PrefsMap<String, Object> mPrefsMap = new PrefsMap<>();
Expand Down Expand Up @@ -159,6 +161,7 @@ public void setXSharedPrefs() {
}

public void init(LoadPackageParam lpparam) {
if (isSafeModeOn) return;
String packageName = lpparam.packageName;
switch (packageName) {
case "android" -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.sevtinge.hyperceiler.utils.DexKit.closeDexKit
import com.sevtinge.hyperceiler.utils.DexKit.dexKitBridge
import com.sevtinge.hyperceiler.utils.DexKit.initDexKit
import com.sevtinge.hyperceiler.utils.log.XposedLogUtils.logE
import com.sevtinge.hyperceiler.utils.log.XposedLogUtils.logI
import com.sevtinge.hyperceiler.utils.setObjectField
import de.robv.android.xposed.callbacks.XC_LoadPackage
import miui.drm.DrmManager
Expand All @@ -23,6 +24,7 @@ class ThemeCrackNew {
val TAG = "ThemeCrackNew"
fun init(lpparam: XC_LoadPackage.LoadPackageParam) {
if (!mPrefsMap.getBoolean("various_enable_super_function") && !mPrefsMap.getBoolean("various_theme_crack") && !(getBuildType().equals("debug"))) return
logI(TAG, "com.android.thememanager", "Hooked.")
initDexKit(lpparam)
try {
loadClass("com.android.thememanager.detail.theme.model.OnlineResourceDetail").methodFinder().filterByName("toResource").toList().createHooks {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sevtinge.hyperceiler.ui.fragment;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

public class DevelopmentFragment extends SettingsPreferenceFragment {
@Override
public int getContentResId() {
return R.xml.prefs_development;
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sevtinge.hyperceiler.ui.fragment;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

public class DevelopmentUIFragment extends SettingsPreferenceFragment {
@Override
public int getContentResId() {
return R.xml.prefs_development_ui;
}
}


3 changes: 3 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,9 @@

<string name="location_add">添加</string>
<string name="location_delete">删除</string>

<string name="development">开发者选项</string>
<string name="development_ui">界面元素测试</string>
<!--Tip-->
<string name="tip_0">Tip: 叮咚~ 来了一条消息! 哦,是 Tip 啊,那没事了(</string>
<string name="tip_1">Tip: 您可以在 \"关于-支持\" 中捐赠以支持和维护我们的开发。</string>
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -605,4 +605,15 @@
<item>1</item>
<item>2</item>
</string-array>

<string-array name="development_test">
<item>Test1</item>
<item>Test2</item>
</string-array>

<string-array name="development_test_value">
<item>0</item>
<item>1</item>
</string-array>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,8 @@
<string name="hyperceiler_restart_quick">Quickly restart apps</string>
<string name="location_add">Add</string>
<string name="location_delete">Delete</string>
<string name="development">Developer Options</string>
<string name="development_ui">UI</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
9 changes: 9 additions & 0 deletions app/src/main/res/xml/prefs_development.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

<Preference
android:key="prefs_key_development_ui"
android:title="@string/development_ui"
android:fragment="com.sevtinge.hyperceiler.ui.fragment.DevelopmentUIFragment" />

</PreferenceScreen>
57 changes: 57 additions & 0 deletions app/src/main/res/xml/prefs_development_ui.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<ColorPickerPreference
android:defaultValue="-1"
android:persistent="false"
android:key="prefs_key_development_ui_test_color_picker"
android:title="ColorPickerPreferencer" />

<DropDownPreference
android:title="DropDownPreference"
android:defaultValue="0"
app:entries="@array/development_test"
app:entryValues="@array/development_test_value" />

<Preference
android:title="Preference" />

<PreferenceCategory
android:title="PreferenceCategory" />

<com.sevtinge.hyperceiler.prefs.PreferenceHeader
android:icon="@drawable/ic_hyperceiler_settings_v140"
android:title="PreferenceHeader" />

<SeekBarPreference
android:title="SeekBarPreference"
android:defaultValue="50"
app:maxValue="100"
app:showSeekBarValue="true"
android:format="%d" />

<SeekBarPreferenceEx
android:title="SeekBarPreferenceEx"
android:defaultValue="50"
app:format="%s"
app:defaultValueText="@string/array_default"
app:maxValue="100"
app:minValue="0" />

<SwitchPreference
android:title="SwitchPreference"
android:defaultValue="false" />

<moralnorm.preference.RadioSetPreferenceCategory>

<moralnorm.preference.RadioButtonPreference
android:persistent="false"
android:title="RadioButtonPreference"
android:layout="@layout/preference_radiobutton_two_state" />

</moralnorm.preference.RadioSetPreferenceCategory>



</PreferenceScreen>
5 changes: 5 additions & 0 deletions app/src/main/res/xml/prefs_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
android:summary="@string/settings_safe_mode_desc"
android:title="@string/settings_safe_mode" />

<Preference
android:key="prefs_key_development"
android:title="@string/development"
android:fragment="com.sevtinge.hyperceiler.ui.fragment.DevelopmentFragment" />

</PreferenceCategory>

<!--<PreferenceCategory>
Expand Down

0 comments on commit f6cd35d

Please sign in to comment.