Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New option: Ignore dex overflows #2048

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/main/generated/options/soot/options/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,10 @@ else if (false
|| option.equals("no-writeout-body-releasing")
)
no_writeout_body_releasing = true;
else if (false
|| option.equals("ignore-dex-overflow")
)
ignore_dex_overflow = true;
else {
G.v().out.println("Invalid option -" + option);
return false;
Expand Down Expand Up @@ -1842,6 +1846,10 @@ public List<String> dynamic_package() {
private boolean no_writeout_body_releasing = false;
public void set_no_writeout_body_releasing(boolean setting) { no_writeout_body_releasing = setting; }

public boolean ignore_dex_overflow() { return ignore_dex_overflow; }
private boolean ignore_dex_overflow = false;
public void set_ignore_dex_overflow(boolean setting) { ignore_dex_overflow = setting; }

public String getUsage() {
return ""
+ "\nGeneral Options:\n"
Expand Down Expand Up @@ -1996,7 +2004,8 @@ public String getUsage() {
+ "\nMiscellaneous Options:\n"
+ padOpt("-time", "Report time required for transformations")
+ padOpt("-subtract-gc", "Subtract gc from time")
+ padOpt("-no-writeout-body-releasing", "Disables the release of method bodies after writeout. This flag is used internally.");
+ padOpt("-no-writeout-body-releasing", "Disables the release of method bodies after writeout. This flag is used internally.")
+ padOpt("-ignore-dex-overflow", "Ignore DEX overflows");
}


Expand Down
5 changes: 4 additions & 1 deletion src/main/java/soot/toDex/MultiDexBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.jf.dexlib2.iface.ClassDef;
import org.jf.dexlib2.writer.io.FileDataStore;
import org.jf.dexlib2.writer.pool.DexPool;
import soot.options.Options;

/**
* @author Manuel Benz created on 26.09.17
Expand Down Expand Up @@ -93,7 +94,9 @@ protected boolean hasOverflowed() {
// (https://developer.android.com/studio/build/multidex.html,
// http://www.fasteque.com/deep-dive-into-android-multidex/)
if (!opcodes.isArt()) {
throw new RuntimeException("Dex file overflow. Splitting not support for pre Lollipop Android (Api 22).");
if (!Options.v().ignore_dex_overflow()) {
throw new RuntimeException("Dex file overflow. Splitting not support for pre Lollipop Android (Api 22).");
}
}

return true;
Expand Down