Move to official Google smali fork (#3051)

* refactor: swap to google smali 3.0.3

* docs: update docs for smali change
This commit is contained in:
Connor Tumbleson 2023-04-28 19:30:06 -04:00 committed by GitHub
parent 775f1dbff3
commit a079fe74fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 30 additions and 38 deletions

View File

@ -12,7 +12,7 @@ A couple of quick tips to ease the submission process.
* [IntelliJ IDEA](http://www.jetbrains.com/idea/) is our IDE of choice. It has built in debugger support along with Gradle integration. * [IntelliJ IDEA](http://www.jetbrains.com/idea/) is our IDE of choice. It has built in debugger support along with Gradle integration.
* For changes to smali/baksmali please see their [page](https://github.com/JesusFreke/smali) for more information. * For changes to smali/baksmali please see their [page](https://github.com/google/smali) for more information.
## Code Styles ## Code Styles

View File

@ -1,12 +1,12 @@
# Apktool Contributors # Apktool Contributors
Copyright 2014 Ryszard Wiśniewski <brut.alll@gmail.com>
This product includes software developed by: This product includes software developed by:
* Ryszard Wiśniewski (brut.alll@gmail.com)
* JesusFreke (https://github.com/JesusFreke/smali)
* Dmitry Skiba (http://code.google.com/p/android4me/)
* Tahseen Ur Rehman (http://code.google.com/p/radixtree/)
* Connor Tumbleson (connor.tumbleson@gmail.com) * Connor Tumbleson (connor.tumbleson@gmail.com)
* Android Open Source Project (http://source.android.com/) * Ryszard Wiśniewski (brut.alll@gmail.com)
* Google (https://github.com/google/smali)
* JesusFreke (https://github.com/JesusFreke/smali)
* Dmitry Skiba (https://code.google.com/p/android4me/)
* Tahseen Ur Rehman (https://code.google.com/p/radixtree/)
* Android Open Source Project (https://source.android.com/)
* The Apache Software Foundation (https://www.apache.org/) * The Apache Software Foundation (https://www.apache.org/)

View File

@ -35,7 +35,7 @@ import brut.directory.*;
import brut.util.*; import brut.util.*;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.jf.dexlib2.iface.DexFile; import com.android.tools.smali.dexlib2.iface.DexFile;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;

View File

@ -45,7 +45,7 @@ public class ApktoolProperties {
InputStream templateStream = null; InputStream templateStream = null;
try { try {
templateStream = org.jf.baksmali.Main.class.getClassLoader().getResourceAsStream("baksmali.properties"); templateStream = com.android.tools.smali.baksmali.Main.class.getClassLoader().getResourceAsStream("baksmali.properties");
} catch(NoClassDefFoundError ex) { } catch(NoClassDefFoundError ex) {
LOGGER.warning("Can't load baksmali properties."); LOGGER.warning("Can't load baksmali properties.");
} }
@ -63,7 +63,7 @@ public class ApktoolProperties {
templateStream = null; templateStream = null;
try { try {
templateStream = org.jf.smali.Main.class.getClassLoader().getResourceAsStream("smali.properties"); templateStream = com.android.tools.smali.smali.Main.class.getClassLoader().getResourceAsStream("smali.properties");
} catch(NoClassDefFoundError ex) { } catch(NoClassDefFoundError ex) {
LOGGER.warning("Can't load smali properties."); LOGGER.warning("Can't load smali properties.");
} }

View File

@ -21,10 +21,10 @@ import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.Token; import org.antlr.runtime.Token;
import org.antlr.runtime.tree.CommonTree; import org.antlr.runtime.tree.CommonTree;
import org.antlr.runtime.tree.CommonTreeNodeStream; import org.antlr.runtime.tree.CommonTreeNodeStream;
import org.jf.dexlib2.writer.builder.DexBuilder; import com.android.tools.smali.dexlib2.writer.builder.DexBuilder;
import org.jf.smali.smaliFlexLexer; import com.android.tools.smali.smali.smaliFlexLexer;
import org.jf.smali.smaliParser; import com.android.tools.smali.smali.smaliParser;
import org.jf.smali.smaliTreeWalker; import com.android.tools.smali.smali.smaliTreeWalker;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;

View File

@ -21,10 +21,9 @@ import brut.androlib.mod.SmaliMod;
import brut.directory.DirectoryException; import brut.directory.DirectoryException;
import brut.directory.ExtFile; import brut.directory.ExtFile;
import org.antlr.runtime.RecognitionException; import org.antlr.runtime.RecognitionException;
import org.jf.dexlib2.Opcodes; import com.android.tools.smali.dexlib2.Opcodes;
import org.jf.dexlib2.writer.builder.DexBuilder; import com.android.tools.smali.dexlib2.writer.builder.DexBuilder;
import org.jf.dexlib2.writer.io.FileDataStore; import com.android.tools.smali.dexlib2.writer.io.FileDataStore;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;

View File

@ -17,15 +17,15 @@
package brut.androlib.src; package brut.androlib.src;
import brut.androlib.AndrolibException; import brut.androlib.AndrolibException;
import org.jf.baksmali.Baksmali; import com.android.tools.smali.baksmali.Baksmali;
import org.jf.baksmali.BaksmaliOptions; import com.android.tools.smali.baksmali.BaksmaliOptions;
import org.jf.dexlib2.DexFileFactory; import com.android.tools.smali.dexlib2.DexFileFactory;
import org.jf.dexlib2.Opcodes; import com.android.tools.smali.dexlib2.Opcodes;
import org.jf.dexlib2.dexbacked.DexBackedDexFile; import com.android.tools.smali.dexlib2.dexbacked.DexBackedDexFile;
import org.jf.dexlib2.dexbacked.DexBackedOdexFile; import com.android.tools.smali.dexlib2.dexbacked.DexBackedOdexFile;
import org.jf.dexlib2.analysis.InlineMethodResolver; import com.android.tools.smali.dexlib2.analysis.InlineMethodResolver;
import org.jf.dexlib2.iface.DexFile; import com.android.tools.smali.dexlib2.iface.DexFile;
import org.jf.dexlib2.iface.MultiDexContainer; import com.android.tools.smali.dexlib2.iface.MultiDexContainer;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;

View File

@ -18,7 +18,7 @@ import java.nio.charset.StandardCharsets
buildscript { buildscript {
ext { ext {
depends = [ depends = [
baksmali : 'com.github.iBotPeaches.smali:baksmali:403e90375e', baksmali : 'com.android.tools.smali:smali-baksmali:3.0.3',
commons_cli : 'commons-cli:commons-cli:1.5.0', commons_cli : 'commons-cli:commons-cli:1.5.0',
commons_io : 'commons-io:commons-io:2.11.0', commons_io : 'commons-io:commons-io:2.11.0',
commons_lang : 'org.apache.commons:commons-lang3:3.12.0', commons_lang : 'org.apache.commons:commons-lang3:3.12.0',
@ -27,7 +27,7 @@ buildscript {
junit : 'junit:junit:4.13.2', junit : 'junit:junit:4.13.2',
proguard_gradle: 'com.guardsquare:proguard-gradle:7.3.2', proguard_gradle: 'com.guardsquare:proguard-gradle:7.3.2',
snakeyaml : 'org.yaml:snakeyaml:1.32:android', snakeyaml : 'org.yaml:snakeyaml:1.32:android',
smali : 'com.github.iBotPeaches.smali:smali:403e90375e', smali : 'com.android.tools.smali:smali:3.0.3',
xmlpull : 'xpp3:xpp3:1.1.4c', xmlpull : 'xpp3:xpp3:1.1.4c',
xmlunit : 'xmlunit:xmlunit:1.6', xmlunit : 'xmlunit:xmlunit:1.6',
] ]
@ -35,6 +35,7 @@ buildscript {
repositories { repositories {
gradlePluginPortal() gradlePluginPortal()
google()
} }
dependencies { dependencies {
classpath "gradle.plugin.com.github.johnrengelman:shadow:8.0.0" classpath "gradle.plugin.com.github.johnrengelman:shadow:8.0.0"
@ -82,15 +83,7 @@ allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
google()
// Obtain baksmali/smali from source builds - https://github.com/iBotPeaches/smali
// Remove when official smali releases come out again.
maven {
url 'https://jitpack.io'
content {
includeGroup('com.github.iBotPeaches.smali')
}
}
} }
} }