This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: systemui - control center - hide delimiter, display default valu…
…e when choose show device name
- Loading branch information
Showing
5 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/plugin/ShowDeviceName.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.sevtinge.hyperceiler.module.hook.systemui.plugin; | ||
|
||
import static com.sevtinge.hyperceiler.module.base.tool.HookTool.hookMethod; | ||
import static com.sevtinge.hyperceiler.utils.PropUtils.getProp; | ||
|
||
import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; | ||
import com.sevtinge.hyperceiler.module.base.dexkit.IDexKit; | ||
import com.sevtinge.hyperceiler.module.base.tool.HookTool; | ||
|
||
import org.luckypray.dexkit.DexKitBridge; | ||
import org.luckypray.dexkit.query.FindMethod; | ||
import org.luckypray.dexkit.query.matchers.MethodMatcher; | ||
import org.luckypray.dexkit.result.MethodData; | ||
|
||
import java.lang.reflect.AnnotatedElement; | ||
import java.lang.reflect.Method; | ||
|
||
import de.robv.android.xposed.XC_MethodHook; | ||
|
||
public class ShowDeviceName { | ||
|
||
static String deviceName = getProp("persist.sys.device_name"); | ||
|
||
public static void initShowDeviceName(ClassLoader classLoader) { | ||
Method method = (Method) DexKit.getDexKitBridge("OnCarrierTextChanged", new IDexKit() { | ||
@Override | ||
public AnnotatedElement dexkit(DexKitBridge bridge) throws ReflectiveOperationException { | ||
MethodData methodData = bridge.findMethod(FindMethod.create() | ||
.matcher(MethodMatcher.create() | ||
.name("onCarrierTextChanged") | ||
)).singleOrNull(); | ||
return methodData.getMethodInstance(classLoader); | ||
} | ||
}); | ||
hookMethod(method, new HookTool.MethodHook() { | ||
@Override | ||
protected void before(XC_MethodHook.MethodHookParam param) throws Throwable { | ||
param.args[0] = deviceName; | ||
} | ||
}); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters