Open continuemycoding opened 6 years ago
hi, i don't understand.
1) what exactly do you want to patch? an APK or something else? 2) what do you want as output?
thanks
Sorry for my poor english.I want to patch a jar library to output a jar library.
I can do it using smali, but it is hard. I want to modify Android Jar files at source-level using Java. @Lanchon thanks
what is an Android Jar file? are you talking about an "Android library" with an ".aar" extension?
I have made a mistake with JAR (Java ARchive), I want to patch a jar file to output a jar file or patch a aar file to output a aar file.
I want to patch some android jar file no source code, modify some code logic, use it for my app development.
DexPatcher patches Dalvik/Android bytecode, not Java bytecode, so it only works with dex and apk files.
to patch jar or aar files you need to use solutions made for Java bytecode, of which are many.
Java bytecode can be converted to Dalvik/Android bytecode by dex2jar tools.so I hope you can upgrade DexPatcher support patch jar to output jar.
dxp does not patch java bytecode and never will.
if you trust dex2jar (sometimes it works fine... depends), then you can:
dx
command to transform source.jar to source.dex.javac
, adding dexpatcher-annotations-x.x.x.jar and source.jar to the compile classpath.dx
to transform you compiled class files to patch.dex.dexpatcher-tool
command line tool to patch source.dex with patch.dex and produce patched.dex.d2j-dex2jar
to transform patched.dex to patched.jar.example: the dexpatcher-tool test build system and shell script.
inside the aar file there is a classes.jar file. extract it and patch it as per the above steps. if you need to patch the aar resources, go ahead and edit them manually; resources in aar files are not compiled.
patch-lib in dexpatcher-gradle-samples is not only patch library, I need patch only jar library sometimes.