-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Altered the system to use System Properties to hold the stored data on which packages to deoptimise. This is because during boot time some optimisations can be performed (Such as after wiping dalvik) and the system does not have permission to mount the internal storage.
- Loading branch information
1 parent
4ff1251
commit f9d3a96
Showing
9 changed files
with
345 additions
and
171 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
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
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
59 changes: 59 additions & 0 deletions
59
app/src/main/java/com/ljmu/andre/artdeoptimiser/Utils/HookUtils.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,59 @@ | ||
package com.ljmu.andre.artdeoptimiser.Utils; | ||
|
||
import android.util.Log; | ||
|
||
import de.robv.android.xposed.XC_MethodHook; | ||
import de.robv.android.xposed.XC_MethodHook.MethodHookParam; | ||
import de.robv.android.xposed.XposedBridge; | ||
|
||
import static com.ljmu.andre.artdeoptimiser.MainActivity.TAG; | ||
|
||
/** | ||
* This class was created by Andre R M (SID: 701439) | ||
* It and its contents are free to use by all | ||
*/ | ||
|
||
public class HookUtils { | ||
public interface HookBefore { | ||
void before(MethodHookParam param) throws Throwable; | ||
} | ||
|
||
public interface HookAfter { | ||
void after(MethodHookParam param) throws Throwable; | ||
} | ||
|
||
public static class MethodHook extends XC_MethodHook { | ||
private HookBefore hookBefore; | ||
private HookAfter hookAfter; | ||
|
||
public MethodHook(HookBefore hookBefore) { | ||
this.hookBefore = hookBefore; | ||
} | ||
|
||
public MethodHook(HookAfter hookAfter) { | ||
this.hookAfter = hookAfter; | ||
} | ||
|
||
@Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | ||
if (hookBefore != null) { | ||
try { | ||
hookBefore.before(param); | ||
} catch (Throwable t) { | ||
Log.e(TAG, t.getMessage(), t); | ||
XposedBridge.log(t); | ||
} | ||
} | ||
} | ||
|
||
@Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
if (hookAfter != null) { | ||
try { | ||
hookAfter.after(param); | ||
} catch (Throwable t) { | ||
Log.e(TAG, t.getMessage(), t); | ||
XposedBridge.log(t); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.