Merge pull request #2153 from iBotPeaches/issue-2071

Update to smali/baksmali v2.3.0
This commit is contained in:
Connor Tumbleson 2019-08-17 11:33:55 -04:00 committed by GitHub
commit 683fef32ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 11 deletions

View File

@ -24,6 +24,7 @@ import org.jf.dexlib2.Opcodes;
import org.jf.dexlib2.dexbacked.DexBackedDexFile; import org.jf.dexlib2.dexbacked.DexBackedDexFile;
import org.jf.dexlib2.dexbacked.DexBackedOdexFile; import org.jf.dexlib2.dexbacked.DexBackedOdexFile;
import org.jf.dexlib2.analysis.InlineMethodResolver; import org.jf.dexlib2.analysis.InlineMethodResolver;
import org.jf.dexlib2.iface.MultiDexContainer;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -68,10 +69,27 @@ public class SmaliDecoder {
jobs = 6; jobs = 6;
} }
// create the dex // create the container
DexBackedDexFile dexFile = DexFileFactory.loadDexEntry(mApkFile, mDexFile, true, Opcodes.forApi(mApi)); MultiDexContainer<? extends DexBackedDexFile> container = DexFileFactory.loadDexContainer(mApkFile, Opcodes.forApi(mApi));
MultiDexContainer.DexEntry<? extends DexBackedDexFile> dexEntry;
DexBackedDexFile dexFile;
if (dexFile.isOdexFile()) { // If we have 1 item, ignore the passed file. Pull the DexFile we need.
if (container.getDexEntryNames().size() == 1) {
dexEntry = container.getEntry(container.getDexEntryNames().get(0));
} else {
dexEntry = container.getEntry(mDexFile);
}
// Double check the passed param exists
if (dexEntry == null) {
dexEntry = container.getEntry(container.getDexEntryNames().get(0));
}
assert dexEntry != null;
dexFile = dexEntry.getDexFile();
if (dexFile.supportsOptimizedOpcodes()) {
throw new AndrolibException("Warning: You are disassembling an odex file without deodexing it."); throw new AndrolibException("Warning: You are disassembling an odex file without deodexing it.");
} }

View File

@ -109,7 +109,7 @@ subprojects {
ext { ext {
depends = [ depends = [
baksmali: 'org.smali:baksmali:2.2.7', baksmali: 'org.smali:baksmali:2.3',
commons_cli: 'commons-cli:commons-cli:1.4', commons_cli: 'commons-cli:commons-cli:1.4',
commons_io: 'commons-io:commons-io:2.4', commons_io: 'commons-io:commons-io:2.4',
commons_lang: 'org.apache.commons:commons-lang3:3.1', commons_lang: 'org.apache.commons:commons-lang3:3.1',
@ -117,7 +117,7 @@ subprojects {
junit: 'junit:junit:4.12', junit: 'junit:junit:4.12',
proguard_gradle: 'net.sf.proguard:proguard-gradle:6.1.1', proguard_gradle: 'net.sf.proguard:proguard-gradle:6.1.1',
snakeyaml: 'org.yaml:snakeyaml:1.18:android', snakeyaml: 'org.yaml:snakeyaml:1.18:android',
smali: 'org.smali:smali:2.2.7', smali: 'org.smali:smali:2.3',
xmlpull: 'xpp3:xpp3:1.1.4c', xmlpull: 'xpp3:xpp3:1.1.4c',
xmlunit: 'xmlunit:xmlunit:1.6', xmlunit: 'xmlunit:xmlunit:1.6',
] ]

View File

@ -3,8 +3,8 @@
if [ "$TRAVIS_OS_NAME" = "windows" ]; then if [ "$TRAVIS_OS_NAME" = "windows" ]; then
export GRADLE_OPTS=-Dorg.gradle.daemon=false export GRADLE_OPTS=-Dorg.gradle.daemon=false
choco install jdk8 choco install jdk8
export PATH=$PATH:"/c/Program Files/Java/jdk1.8.0_211/bin" export PATH=$PATH:"/c/Program Files/Java/jdk1.8.0_221/bin"
export JAVA_HOME="/c/Program Files/Java/jdk1.8.0_211" export JAVA_HOME="/c/Program Files/Java/jdk1.8.0_221"
./gradlew.bat clean ./gradlew.bat clean
else else
./gradlew clean ./gradlew clean

View File

@ -2,8 +2,8 @@
if [ "$TRAVIS_OS_NAME" = "windows" ]; then if [ "$TRAVIS_OS_NAME" = "windows" ]; then
export GRADLE_OPTS=-Dorg.gradle.daemon=false export GRADLE_OPTS=-Dorg.gradle.daemon=false
export PATH=$PATH:"/c/Program Files/Java/jdk1.8.0_211/bin" export PATH=$PATH:"/c/Program Files/Java/jdk1.8.0_221/bin"
export JAVA_HOME="/c/Program Files/Java/jdk1.8.0_211" export JAVA_HOME="/c/Program Files/Java/jdk1.8.0_221"
./gradlew.bat build shadowJar proguard ./gradlew.bat build shadowJar proguard
else else
./gradlew build shadowJar proguard ./gradlew build shadowJar proguard