Skip to content

Commit

Permalink
Some code optimizations that follow AS suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Oosl committed Aug 17, 2021
1 parent 6087d29 commit 31871f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/oosl/colorostool/XposedInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Th
XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Class<?> clazz = null;
Class<?> clazz;
ClassLoader cl = ((Context) param.args[0]).getClassLoader();
try {
clazz = cl.loadClass("com.coloros.safecenter.startupapp.b");
Expand All @@ -30,10 +30,10 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
}
Method[] methods = clazz.getDeclaredMethods();
Method wantMethod = null;
for (int i = 0; i < methods.length; i++) {
if (methods[i].toString().equals("public int com.coloros.safecenter.startupapp.b.v()")){
wantMethod = methods[i];
Log.d("ColorOSTool","Hook startupapp.b.v() success!");
for (Method method : methods) {
if (method.toString().equals("public int com.coloros.safecenter.startupapp.b.v()")) {
wantMethod = method;
Log.d("ColorOSTool", "Hook startupapp.b.v() success!");
}
}
XposedBridge.hookMethod(wantMethod, new XC_MethodHook() {
Expand Down

0 comments on commit 31871f3

Please sign in to comment.