Repository navigation
EXECUTE_DEX
Cregrant edited this page Jun 10, 2023
·
1 revision
❓ Problems are possible. Most patches are written by enthusiasts, and the change of Android -> Windows platform or a different decompilation method (a different version of Apktool) can make them non-working
This rule runs code written in Java and compiled into a `.dex' file
- NAME: the name of the rule (optional)
- SCRIPT: the path to your
.dexscript - SMALI_NEEDED:
trueif your script needs.smalifiles orfalseif not. If necessary, an attempt will be made to create them. - MAIN_CLASS: the path to your entry class in the script
- ENTRANCE: the name of the method to be called.
- PARAM: this string will be passed to the method as the fourth parameter
Create the file Main.java with the main method.
The main method of your class must take 4 lines as arguments:
- A path to the
.apkfile from which your project was decompiled - A path to the `.zip' file of your patch
- A path to your project folder
- A text in the
PARAMfield of your rule
Compilation:
javac -source 1.7 -target 1.7 Main.java
dx --dex --output=script.dex Main.class
Where do I find dx? I found it as a .jar file in the JADX project, so my build command starts with java -jar dx-1.16.jar instead of dx
Run script.dex from your patch:
[EXECUTE_DEX]
SCRIPT:
script.dex
SMALI_NEEDED:
true
MAIN_CLASS:
Main
ENTRANCE:
main
PARAM:
this string will be passed as a method argument
[/EXECUTE_DEX]

