-
Notifications
You must be signed in to change notification settings - Fork 867
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) add the 'android deoptimize' command
this is a useful command if you are having trouble with hooks firing as a result of optimizations.
- Loading branch information
Showing
4 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { wrapJavaPerform } from "./lib/libjava" | ||
|
||
export namespace general { | ||
|
||
export const deoptimize = (): Promise<void> => { | ||
return wrapJavaPerform(() => { | ||
Java.deoptimizeEverything(); | ||
}); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from objection.state.connection import state_connection | ||
|
||
|
||
def deoptimise(args: list) -> None: | ||
""" | ||
Forces the VM to execute everything with its interpreter. | ||
Necessary to prevent optimizations from bypassing method hooks in some cases. | ||
Ref: https://frida.re/docs/javascript-api/ | ||
:param args: | ||
:return: | ||
""" | ||
|
||
api = state_connection.get_api() | ||
api.android_deoptimize() |
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