Closed jacoryjin closed 6 years ago
It seems Soot
has not supported multidex now. #565
Have you tried the -process-multiple-dex
option?
Soot should be able to handle APKs with multiple dex files with that option. It should still have problems with writing out, though.
@XingweiLin ,@mbenz89,Thank you for the answers!
Options.v().set_process_multiple_dex(true);
doesn't work in my code;
I'm found another way:
1、translate .apk to .jar with enjarify;
2、soot-infoflow-android->SetupApplication.java->initializeSoot(), changed:
Options.v().set_process_dir(Collections.singletonList(apkFileLocation)); Options.v().set_src_prec(Options.src_prec_apk_class_jimple);
To
Options.v().set_process_dir(Collections.singletonList("E:/app-release.jar")); Options.v().set_src_prec(Options.src_prec_java);
It likes work in my work
Have you tried setting Options.v().set_process_multiple_dex(true);
inside of soot-infoflow-android->SetupApplication.java->initializeSoot()?
The Soot options are overwritten there, thus it doesn't change anything if the options are altered before any calls to SetupApplication
.
Btw. you do not need to change the source code of SetupApplication
. Instead, you can override the SootConfigForAndroid
class and pass it to SetupApplication
:
SetupApplication setupApplication = new SetupApplication(jarPath,apkPath);
SootConfigForAndroid sootConf = new SootConfigForAndroid() {
@Override
public void setSootOptions(Options options) {
// we need to specify soot options here since FlowDroid resets them
super.setSootOptions(options);
options.set_process_multiple_dex(true);
}
};
setupApplication.setSootConfig(sootConf);
It took me quite a while to find this solution :(
It's always a good idea to look at Soot's options to see what is possible and what might not be.
Unfortunately, we do not have the manpower to maintain Soot's documentation very well. We would thus be happy if you could contribute and maybe add a wiki page on how to use Soot with android.
I'm using FlowDroid(thus using Soot indirectly) and IC3 these days, encountered many problems. Very willing to help after getting them work together properly.
@mbenz89 It's even easier than that, because FlowDroid has an explicit option for multi-dex support:
setupApplication.getConfig().setMergeDexFiles(true);
Does soot suport multidex? An apk has class.dex, class1.dex, raise warn with not found activity