Skip to content

Commit

Permalink
Move to official Google smali fork (#3051)
Browse files Browse the repository at this point in the history
* refactor: swap to google smali 3.0.3

* docs: update docs for smali change
  • Loading branch information
iBotPeaches authored Apr 28, 2023
1 parent 775f1db commit a079fe7
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

* 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
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Apktool Contributors
Copyright 2014 Ryszard Wiśniewski <[email protected]>

This product includes software developed by:

* Connor Tumbleson ([email protected])
* Ryszard Wiśniewski ([email protected])
* Google (https://github.com/google/smali)
* 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 ([email protected])
* Android Open Source Project (http://source.android.com/)
* 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/)
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import brut.util.*;
import org.apache.commons.io.FileUtils;
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 javax.xml.parsers.ParserConfigurationException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static void loadProps() {

InputStream templateStream = null;
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) {
LOGGER.warning("Can't load baksmali properties.");
}
Expand All @@ -63,7 +63,7 @@ private static void loadProps() {

templateStream = null;
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) {
LOGGER.warning("Can't load smali properties.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import org.antlr.runtime.Token;
import org.antlr.runtime.tree.CommonTree;
import org.antlr.runtime.tree.CommonTreeNodeStream;
import org.jf.dexlib2.writer.builder.DexBuilder;
import org.jf.smali.smaliFlexLexer;
import org.jf.smali.smaliParser;
import org.jf.smali.smaliTreeWalker;
import com.android.tools.smali.dexlib2.writer.builder.DexBuilder;
import com.android.tools.smali.smali.smaliFlexLexer;
import com.android.tools.smali.smali.smaliParser;
import com.android.tools.smali.smali.smaliTreeWalker;

import java.io.*;
import java.nio.charset.StandardCharsets;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
import brut.directory.DirectoryException;
import brut.directory.ExtFile;
import org.antlr.runtime.RecognitionException;
import org.jf.dexlib2.Opcodes;
import org.jf.dexlib2.writer.builder.DexBuilder;
import org.jf.dexlib2.writer.io.FileDataStore;

import com.android.tools.smali.dexlib2.Opcodes;
import com.android.tools.smali.dexlib2.writer.builder.DexBuilder;
import com.android.tools.smali.dexlib2.writer.io.FileDataStore;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
package brut.androlib.src;

import brut.androlib.AndrolibException;
import org.jf.baksmali.Baksmali;
import org.jf.baksmali.BaksmaliOptions;
import org.jf.dexlib2.DexFileFactory;
import org.jf.dexlib2.Opcodes;
import org.jf.dexlib2.dexbacked.DexBackedDexFile;
import org.jf.dexlib2.dexbacked.DexBackedOdexFile;
import org.jf.dexlib2.analysis.InlineMethodResolver;
import org.jf.dexlib2.iface.DexFile;
import org.jf.dexlib2.iface.MultiDexContainer;
import com.android.tools.smali.baksmali.Baksmali;
import com.android.tools.smali.baksmali.BaksmaliOptions;
import com.android.tools.smali.dexlib2.DexFileFactory;
import com.android.tools.smali.dexlib2.Opcodes;
import com.android.tools.smali.dexlib2.dexbacked.DexBackedDexFile;
import com.android.tools.smali.dexlib2.dexbacked.DexBackedOdexFile;
import com.android.tools.smali.dexlib2.analysis.InlineMethodResolver;
import com.android.tools.smali.dexlib2.iface.DexFile;
import com.android.tools.smali.dexlib2.iface.MultiDexContainer;

import java.io.File;
import java.io.IOException;
Expand Down
15 changes: 4 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.nio.charset.StandardCharsets
buildscript {
ext {
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_io : 'commons-io:commons-io:2.11.0',
commons_lang : 'org.apache.commons:commons-lang3:3.12.0',
Expand All @@ -27,14 +27,15 @@ buildscript {
junit : 'junit:junit:4.13.2',
proguard_gradle: 'com.guardsquare:proguard-gradle:7.3.2',
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',
xmlunit : 'xmlunit:xmlunit:1.6',
]
}

repositories {
gradlePluginPortal()
google()
}
dependencies {
classpath "gradle.plugin.com.github.johnrengelman:shadow:8.0.0"
Expand Down Expand Up @@ -82,15 +83,7 @@ allprojects {

repositories {
mavenCentral()

// 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')
}
}
google()
}
}

Expand Down

0 comments on commit a079fe7

Please sign in to comment.