Smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation

Overview

About

smali/baksmali is an assembler/disassembler for the dex format used by dalvik, Android's Java VM implementation. The syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc.)

Downloads are at https://bitbucket.org/JesusFreke/smali/downloads/. If you are interested in submitting a patch, feel free to send me a pull request here.

See the wiki for more info/news/release notes/etc.

Support

  • github Issue tracker - For any bugs/issues/feature requests
  • #smali on freenode - Free free to drop by and ask a question. Don't expect an instant response, but if you hang around someone will respond.

Some useful links for getting started with smali

Comments
  • NPE when analyzing non-resolvable method.

    NPE when analyzing non-resolvable method.

    Original issue 29 created by JesusFreke on 2010-05-14T08:26:25.000Z:

    What seems to be the problem? NPE when analyzing non-resolvable method. Should be ValidationException.

    What is the exact smali/baksmali command that you ran? java -jar baksmali-1.2.2.jar -x CheckinProvider.odex -c core.odex:framework.odex:ext.odex:services.odex:android.policy.odex

    What version are you using? 1.2.2

    Priority-Medium Type-Defect 
    opened by JesusFreke 42
  • Invalid method index when using baksmali 2.0.3

    Invalid method index when using baksmali 2.0.3

    Original issue 198 created by JesusFreke on 2014-01-28T09:20:03.000Z:

    What seems to be the problem? baksmali unable to dissasemble multiple odex files, all giving the same error: 'java.lang.RuntimeException: Invalid method index: '

    What is the exact smali/baksmali command that you ran? java -jar baksmali203.jar -d framework -x BatteryWarning.odex java -jar baksmali203.jar -a 17 -d framework -x BatteryWarning.odex

    What version of smali/baksmali are you using? What rom are you working from? baksmali version 2.0.3 Stock rom Zopo ZP998

    Please provide any additional information below: error messages, symptoms, etc. Error occurred while disassembling class Lcom.mediatek.batterywarning.BatteryWarningReceiver; - skipping class java.lang.RuntimeException: Invalid method index: 29 at org.jf.dexlib2.analysis.InlineMethodResolver$InlineMethodResolver_version36.resolveExecuteInline(InlineMethodResolver.java:175) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeExecuteInline(MethodAnalyzer.java:1422) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:941) at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:202) at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:137) at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:387) at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:296) at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:198) at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:322) at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:113) at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:220) at org.jf.baksmali.baksmali.access$000(baksmali.java:55) at org.jf.baksmali.baksmali$1.call(baksmali.java:144) at org.jf.baksmali.baksmali$1.call(baksmali.java:142) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:679)

    Priority-Medium Type-Defect 
    opened by JesusFreke 32
  • Deodexing android L preview framework files issue

    Deodexing android L preview framework files issue

    Original issue 225 created by JesusFreke on 2014-10-24T14:48:24.000Z:

    I've extracted the dex files from oat and i'm trying to deodex them. I'm encountering this issue with packet switch that prevents it to recompile successfully:

    .line 217
    .packed-switch 0x2bd0222
        +455938160
        +40435714
        +924766
        +1441792
        +196611
        -1779040253
        +21954681
        +24510464
        +1308295
        +1376264
        +1245448
        +476844123
        +1376264
        +646120020
        +582549876
        +151781396
        +270141458
        +565335
        +812515344
        +9578366
        +137955340
        +270663727
        +286923224
        +41314361
        +1113272
        +67964967
        +433590306
        +410521890
        -150994570
        +303693841
        +41192747
        +1177355
        +542380300
        +302523066
        +41156608
        +1177355
        +24383756
        +1177366
        +41292044
        +1113272
        +269291559
        +329784
        +797708402
        +270991368
        +581574740
        +4104
        +1048584
        +731783278
        +185335817
        -1293021071
        +51118088
        +798036082
    
    Priority-Medium Type-Defect 
    opened by JesusFreke 28
  • Trouble deodexing M apps

    Trouble deodexing M apps

    Hello again. Real issue this time. Trying to deodex Marshmallow apps for the nexus 6 (shamu) using baksmali version 2.1.0. Running into errors when there are multiple dex files. I have attached one of the problem apps along with the boot.oat, as well as the output from the attempt. Please let me know if you need anything else. Thanks for your support :)

    https://s.basketbuild.com/dlgate/devs?dev=SuperR&dl=SuperR/Testing/shamu_M_test.zip

    superr@studio:~/android/Shamu_M/system/app/EditorsDocs$ java -jar ~/bin/baksmali.jar -x -c boot.oat -d ../../framework/arm -e /system/app/EditorsDocs/EditorsDocs.apk oat/arm/EditorsDocs.odex -o oat/arm/smali
    org.jf.dexlib2.analysis.AnalysisException: Could not resolve the method in class Lcom/google/apps/docs/docos/client/mobile/model/api/DiscussionOrigin; at index 15
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:1717)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:983)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:205)
        at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:140)
        at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:463)
        at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:371)
        at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:238)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:282)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112)
        at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:225)
        at org.jf.baksmali.baksmali.access$000(baksmali.java:55)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:149)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:147)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    opcode: invoke-virtual-quick
    code address: 24
    method: Lbpa;-><clinit>()V
    
    
    
    Error occurred while disassembling class Lcom.qo.android.quickword.QWDrawUtils; - skipping class
    org.jf.dexlib2.analysis.UnresolvedClassException: Could not resolve class Lcom/google/android/apps/docs/quickoffice/text/SupportedAssetFont;
        at org.jf.dexlib2.analysis.ClassPath.getClassDef(ClassPath.java:169)
        at org.jf.dexlib2.analysis.ClassProto$1.get(ClassProto.java:94)
        at org.jf.dexlib2.analysis.ClassProto$1.get(ClassProto.java:92)
        at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:125)
        at org.jf.dexlib2.analysis.ClassProto.getClassDef(ClassProto.java:88)
        at org.jf.dexlib2.analysis.ClassProto$4.get(ClassProto.java:580)
        at org.jf.dexlib2.analysis.ClassProto$4.get(ClassProto.java:570)
        at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:125)
        at org.jf.dexlib2.analysis.ClassProto.getInstanceFields(ClassProto.java:378)
        at org.jf.dexlib2.analysis.ClassProto.getFieldByOffset(ClassProto.java:345)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeIputIgetQuick(MethodAnalyzer.java:1553)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:981)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:205)
        at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:140)
        at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:463)
        at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:371)
        at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:238)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:282)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112)
        at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:225)
        at org.jf.baksmali.baksmali.access$000(baksmali.java:55)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:149)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:147)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    
    org.jf.dexlib2.analysis.AnalysisException: Could not resolve the method in class Lcom/qo/android/quickword/g; at index 12
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:1717)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:983)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:205)
        at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:140)
        at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:463)
        at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:371)
        at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:238)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:282)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112)
        at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:225)
        at org.jf.baksmali.baksmali.access$000(baksmali.java:55)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:149)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:147)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    opcode: invoke-virtual-quick
    code address: 262
    method: Lcom/qo/android/quickword/b;-><clinit>()V
    
    
    
    Error occurred while disassembling class Lcow; - skipping class
    org.jf.dexlib2.analysis.UnresolvedClassException: Could not resolve class Ldkn;
        at org.jf.dexlib2.analysis.ClassPath.getClassDef(ClassPath.java:169)
        at org.jf.dexlib2.analysis.ClassProto$1.get(ClassProto.java:94)
        at org.jf.dexlib2.analysis.ClassProto$1.get(ClassProto.java:92)
        at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:125)
        at org.jf.dexlib2.analysis.ClassProto.getClassDef(ClassProto.java:88)
        at org.jf.dexlib2.analysis.ClassProto$4.get(ClassProto.java:580)
        at org.jf.dexlib2.analysis.ClassProto$4.get(ClassProto.java:570)
        at com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:125)
        at org.jf.dexlib2.analysis.ClassProto.getInstanceFields(ClassProto.java:378)
        at org.jf.dexlib2.analysis.ClassProto.getFieldByOffset(ClassProto.java:345)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeIputIgetQuick(MethodAnalyzer.java:1553)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:981)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:205)
        at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:140)
        at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:463)
        at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:371)
        at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:238)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:282)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112)
        at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:225)
        at org.jf.baksmali.baksmali.access$000(baksmali.java:55)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:149)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:147)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    
    org.jf.dexlib2.analysis.AnalysisException: Could not resolve the method in class Lcom/google/android/gms/analytics/internal/BatchingStrategy; at index 14
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:1717)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:983)
        at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:205)
        at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:140)
        at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:463)
        at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:371)
        at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:238)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:282)
        at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112)
        at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:225)
        at org.jf.baksmali.baksmali.access$000(baksmali.java:55)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:149)
        at org.jf.baksmali.baksmali$1.call(baksmali.java:147)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    opcode: invoke-virtual-quick
    code address: 463
    method: Lied;-><clinit>()V
    
    superr@studio:~/android/Shamu_M/system/app/EditorsDocs$
    
    opened by superr 26
  • [Windows] Since 2.2b1 baksmali goes crazy with paths

    [Windows] Since 2.2b1 baksmali goes crazy with paths

    >java -jar baksmali-smali-2.2.1.jar x file.jar -o folder

    Error occurred while loading class path files. Aborting.
    org.jf.dexlib2.analysis.ClassPathResolver$ResolveException: org.jf.dexlib2.analysis.ClassPathResolver$NotFoundException: Could not find classpath entry /system/framework/core.jar
            at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:136)
            at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:106)
            at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:123)
            at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:89)
            at org.jf.baksmali.DisassembleCommand.getOptions(DisassembleCommand.java:199)
            at org.jf.baksmali.DeodexCommand.getOptions(DeodexCommand.java:71)
            at org.jf.baksmali.DisassembleCommand.run(DisassembleCommand.java:173)
            at org.jf.baksmali.Main.main(Main.java:102)
    Caused by: org.jf.dexlib2.analysis.ClassPathResolver$NotFoundException: Could not find classpath entry /system/framework/core.jar
            at org.jf.dexlib2.analysis.ClassPathResolver.loadLocalOrDeviceBootClassPathEntry(ClassPathResolver.java:207)
            at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:121)
            ... 7 more
    

    Using ProcMon I noticed it tries to create file C:\system\framework\core.jar (full disclosure: I definitively wasn't using the tool from the disk root folder) And file %workingdir%\;system;framework;core.jar, of course illegal

    opened by mirh 25
  • Issues with Google Guice with baksmali/smali v2.0.3

    Issues with Google Guice with baksmali/smali v2.0.3

    Original issue 220 created by JesusFreke on 2014-09-23T02:17:38.000Z:

    What seems to be the problem? After decompiling and recompiling an APK that uses Google Guice with baksmali-2.0.3 and smali-2.0.3, I am unable to run dex2jar on the APK. However, I don't have the same issues with baksmali/smali version 1.4.1

    What is the exact smali/baksmali command that you ran? java -jar baksmali-2.0.3.jar <apk> java -jar smali-2.0.3.jar out

    What version of smali/baksmali are you using? What rom are you working from? 2.0.3

    What is the airspeed velocity of an unladen swallow?

    Please provide any additional information below: error messages, symptoms, etc. dex2jar out.dex -> out-dex2jar.jar com.googlecode.dex2jar.DexException: while accept method:[Lcom/google/inject/InjectorImpl;.<init>(Lcom/google/inject/InjectorImpl;Lcom/google/inject/State;Lcom/google/inject/Initializer;)V] at com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReader.java:694) at com.googlecode.dex2jar.reader.DexFileReader.acceptClass(DexFileReader.java:436) at com.googlecode.dex2jar.reader.DexFileReader.accept(DexFileReader.java:323) at com.googlecode.dex2jar.v3.Dex2jar.doTranslate(Dex2jar.java:85) at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:261) at com.googlecode.dex2jar.v3.Dex2jar.to(Dex2jar.java:252) at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:110) at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:174) at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:34) Caused by: com.googlecode.dex2jar.DexException: while accept parameter annotation in method:[Lcom/google/inject/InjectorImpl;.<init>(Lcom/google/inject/InjectorImpl;Lcom/google/inject/State;Lcom/google/inject/Initializer;)V], parameter:[1] at com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReader.java:663) ... 8 more Caused by: com.googlecode.dex2jar.DexException: Not support yet. at com.googlecode.dex2jar.reader.Constant.ReadConstant(Constant.java:128) at com.googlecode.dex2jar.reader.DexAnnotationReader.accept(DexAnnotationReader.java:58) at com.googlecode.dex2jar.reader.DexFileReader.acceptMethod(DexFileReader.java:660) ... 8 more

    Priority-Medium Type-Defect 
    opened by JesusFreke 24
  • [Q] Multidex support in dexlib2

    [Q] Multidex support in dexlib2

    hi JF,

    say you have a potentially big fat DexFile in memory. you want to write it to disk and potentially need to write it as a multidex.

    a naive way to write it would be:

    • attempt to write a dex file.
    • if it fails because it is too big, split the DexFile and recursively attempt to write the parts.

    needless to say, this is very inefficient. is there any way to incrementally process a DexFile and stop short of exceeding dex file limits, then switch to a new dex? or is there any other more efficient solution than the naive version above?

    while on the topic, is there any support for multidex at all in dexlib2? the only mildly relevant commit i found is https://github.com/JesusFreke/smali/commit/0c7e7b7ffcc11946a64b3c870c7d4b8c86bf06ca

    any info is welcome. thanks so much!

    opened by Lanchon 23
  • Enhancement: Problem with Line Numbers (Decompile/Debug Instrument/Recompile Cycle)

    Enhancement: Problem with Line Numbers (Decompile/Debug Instrument/Recompile Cycle)

    Original issue 139 created by JesusFreke on 2012-08-29T01:33:17.000Z:

    This request comes from lessons learned in Black Box testing.

    When taking an APK though a Decompile/Debug Instrument/Recompile/Sign/Align cycle, we can perform an apk install and run the resulting binary. With NetBeans 6.8, we can even create a project and import the smali files.

    However, its difficult to set breakpoints and debug the re-engineered APK. Its difficult because there is a mis-match in line numbers between the smali source files and and annotated lines in the source files. An example is shown in the attached file.

    For example, in the attached image, source file lines run from 248 to 270 for the function. However, the annotated line numbers are 45 and 46. When trying to set a break point through the IDE, the IDE will try and set the breakpoint at source line and not the smali line. This usually causes the Dalvik VM to reject the breakpoint.

    Would it be possible to enhance baksmali/smali to synchronize line numbers so breakpoints can be managed through an IDE? That is, if there is an annotation ".line 248", have that annotation actually point to line 248 in the source code (currently, ".line 45" corresponds to line 253 in source code lines).

    Priority-Medium Type-Defect 
    opened by JesusFreke 23
  • Error occurred while disassembling class Landroid.support Invalid method index: 35

    Error occurred while disassembling class Landroid.support Invalid method index: 35

    Original issue 222 created by JesusFreke on 2014-10-06T18:30:43.000Z:

    What seems to be the problem? I'am trying to deodex Mms.apk from a Chinese rom for Jiayu G4s phone, because it has a bug related to incorrect Caller ID matching. When trying to deodex de apk everything is fine, but when trying to deodex de odex file, I receive an error.

    What is the exact smali/baksmali command that you ran? java -jar baksmali-2.0.3.jar -a 19 -d \framework -c \framework\core.jar:\framework\conscrypt.jar:\framework\okhttp.jar:\framework\core-junit.jar:\framework\bouncycastle.jar:\framework\ext.jar:\framework\framework.jar:\framework\framework2.jar:\framework\telephony-common.jar:\framework\voip-common.jar:\framework\mms-common.jar:\framework\android.policy.jar:\framework\services.jar:\framework\apache-xml.jar:\framework\webviewchromium.jar:\framework\mediatek-common.jar:\framework\mediatek-framework.jar:\framework\CustomProperties.jar:\framework\mediatek-telephony-common.jar:\framework\mediatek-tablet.jar -x nou\Mms.apk -o nou\MMS

    What version of smali/baksmali are you using? What rom are you working from? smali-2.0.3.jar and baksmali-2.0.3.jar G4S-20140927-1826499 (Android 4.4.2) The rom can be found here: http://pan.baidu.com/share/link?shareid=187936476&uk=1680007479

    What is the airspeed velocity of an unladen swallow?

    Please provide any additional information below: error messages, symptoms, etc. The error message is: Error occurred while disassembling class Landroid.support.v4.accessibilityservice.AccessibilityServiceInfoCompat; - skipping class java.lang.RuntimeException: Invalid method index: 35 at org.jf.dexlib2.analysis.InlineMethodResolver$InlineMethodResolver_version36.resolveExecuteInline(InlineMethodResolver.java:175) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeExecuteInline(MethodAnalyzer.java:1422) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:941) at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:202) at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:137) at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:387) at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:296) at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:198) at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:277) at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112) at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:220) at org.jf.baksmali.baksmali.access$000(baksmali.java:55) at org.jf.baksmali.baksmali$1.call(baksmali.java:144) at org.jf.baksmali.baksmali$1.call(baksmali.java:142) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)

    Error occurred while disassembling class Landroid.support.v4.view.accessibility.AccessibilityNodeInfoCompat; - skipping class java.lang.RuntimeException: Invalid method index: 35 at org.jf.dexlib2.analysis.InlineMethodResolver$InlineMethodResolver_version36.resolveExecuteInline(InlineMethodResolver.java:175) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeExecuteInline(MethodAnalyzer.java:1422) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:941) at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:202) at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:137) at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:387) at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:296) at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:198) at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:322) at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:113) at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:220) at org.jf.baksmali.baksmali.access$000(baksmali.java:55) at org.jf.baksmali.baksmali$1.call(baksmali.java:144) at org.jf.baksmali.baksmali$1.call(baksmali.java:142) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)

    Error occurred while disassembling class Lcom.android.mms.util.ThumbnailManager$ThumbnailTask; - skipping class java.lang.RuntimeException: Invalid method index: 32 at org.jf.dexlib2.analysis.InlineMethodResolver$InlineMethodResolver_version36.resolveExecuteInline(InlineMethodResolver.java:175) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeExecuteInline(MethodAnalyzer.java:1422) at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:941) at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:202) at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:137) at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:387) at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:296) at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:198) at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:277) at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:112) at org.jf.baksmali.baksmali.disassembleClass(baksmali.java:220) at org.jf.baksmali.baksmali.access$000(baksmali.java:55) at org.jf.baksmali.baksmali$1.call(baksmali.java:144) at org.jf.baksmali.baksmali$1.call(baksmali.java:142) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)

    I've tested also with simplfied command line: java -jar baksmali-2.0.3.jar -d \framework -x nou\Mms.apk -o nou\MMS But I still receive the same error.

    I've also tried to deodex framework.odex and the errors are similar.

    Priority-Medium Type-Defect 
    opened by JesusFreke 21
  • "Error occured while loading boot class path files"

    Original issue 16 created by JesusFreke on 2010-03-04T02:00:23.000Z:

    What steps will reproduce the problem? 1.java -jar baksmali-1.2.jar -x services.odex 2. 3.

    What is the expected output? What do you see instead? .odex files should deodex.

    What version of the product are you using? On what operating system? baksmali-1.2 on Ubuntu 9.10

    Please provide any additional information below. Error im getting when I deodex services.odex. This is what I get when I rename, or delete the framework jar files.

    java -jar baksmali-1.2.jar -x services.odex

    Error occured while loading boot class path files. Aborting. org.jf.dexlib.Code.Analysis.ValidationException: class Landroid/content/DialogInterface$OnCancelListener; cannot be resolved. at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.unresolvedValidationException(ClassPath.java:391) at org.jf.dexlib.Code.Analysis.ClassPath$UnresolvedClassDef.getSuperclass(ClassPath.java:395) at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInterfaces(ClassPath.java:676) at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:532) at org.jf.dexlib.Code.Analysis.ClassPath.loadDexFile(ClassPath.java:127) at org.jf.dexlib.Code.Analysis.ClassPath.loadBootClassPath(ClassPath.java:118) at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:64) at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPath(ClassPath.java:54) at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:68) at org.jf.baksmali.main.main(main.java:263)

    Type-Defect Priority-Critical 
    opened by JesusFreke 20
  • 1.3.0 not working with ICS 4.0.3

    1.3.0 not working with ICS 4.0.3

    Original issue 99 created by JesusFreke on 2012-01-01T07:04:45.000Z:

    What seems to be the problem? Can't deodex the new 4.0.3 SGS2 build.

    What is the exact smali/baksmali command that you ran? java -Xmx1024m -jar baksmali.jar -d %bootclasspath% -c core.jar:core-junit.jar:bouncycastle.jar:ext.jar:framework.jar:android.policy.jar:services.jar:apache-xml.jar:filterfw.jar -x am.odex

    What version of smali/baksmali are you using? What rom are you working from? 1.3.0

    What is the airspeed velocity of an unladen swallow? African or European?

    Please provide any additional information below: error messages, symptoms, etc.

    UNEXPECTED TOP-LEVEL EXCEPTION: org.jf.dexlib.Util.ExceptionWithContext: The magic value is not the expected value at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithCont ext.java:54) at org.jf.dexlib.Item.addExceptionContext(Item.java:176) at org.jf.dexlib.Item.readFrom(Item.java:78) at org.jf.dexlib.DexFile.<init>(DexFile.java:390) at org.jf.baksmali.main.main(main.java:265) Caused by: java.lang.RuntimeException: The magic value is not the expected value

        at org.jf.dexlib.HeaderItem.readItem(HeaderItem.java:64)
        at org.jf.dexlib.Item.readFrom(Item.java:76)
        ... 2 more
    

    header_item

    happens on every odex file I try to deodex.

    Priority-Medium Type-Defect 
    opened by JesusFreke 19
  • [BUG] Dex not properly decompiled/recompiled

    [BUG] Dex not properly decompiled/recompiled

    Information

    Baksmali Version - [v2.5.2] Operating System- Windows 10

    Steps to Reproduce

    java -jar apktool_2.7.0.jar d BoldBeast_Latest_Apktool.apk -r -s baksmali decompile recompile dex and replace original dex with recompiled java -jar apktool_2.7.0.jar b BoldBeast_Latest_Apktool Uber Signer (also resigned other apks in bundle and problem isn't from singing or bundles) SAI install bundle apks (all with same signature)


    Hello, there is a unique app for recording VOIP calls:

    https://play.google.com/store/apps/details?id=com.boldbeast.voiprecorder

    I tried to decompiled and recompile it using apktool (with no resource decode or dex decompile by apktool) then decompiled/recompiled dex, when I don't do any change to dex, the app works correctly but when I want to decompile and recompile it's dex without any changes, problem arise and that has no error in baksmali and app gets installed properly and opens propery but when I click grant root button, it crashes and there is nothing about crash in logcat so I had to debug it using smalidea and found where exactly the crash is, it's at loading a native library (which I checked and it doesn't exist in lib folder so maybe what they do is to create these libs dynamically or they make symlinks or ... becaue this is a root app and has magisk module and does things in root level that ordinary apps don't do and it has native libraries)


    here is exact path to where crash happens:

    "smali\com\boldbeast\voiprecorder\BBJni.smali" : const-string v2, "bbvoip" Line 743: invoke-static {v2}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V


    if I don't do any change to dex (no decompile) it works but if any decompile and recompile without any change at all, app fails at this point (same for apktool and baksmali recompiling of dex) (I checked and there is no signature or integrity check and problem is from what I mentioned)


    also I searched in all smali in \smali\com to find more native libs loading and found below ones:

    "smali\com\boldbeast\base\BBBaseFunc.smali" : const-string v1, "bbbasefunc" Line 110: invoke-static {v1}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V

    "smali\com\boldbeast\voiprecorder\BBRootService.smali" : const-string v0, "bbrecserver2" Line 53: invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V

    also after recompile it mistakenly says can't get root access (becaue it can't load libs)


    also checked module files and found there are native libs there too but they aren't ones loaded in above and I couldn't find libs loaded in above lines anywhere from app libs folder or modules libs folder in root and I don't know what developer does that decompile and recompile breaks it! (most likely it's some kind of root actions which ordinary apps don't do)

    below is path of magisk module and libs and other files are there: /data/adb/modules/CallRecordingFix


    apktool and baksmali fail similarly

    I hope you work on this because this is a clear bug in decompiling and recompiling dex for native libs.


    opened by cronel 0
  • baksmali cant find dex files

    baksmali cant find dex files

    trying to deodex a waydroid android 11 rom to enable sinature spoofing and microg

    comand run "java -jar baksmali.jar x framework/oat/x86_64/services.odex -d framework/x86_64 -d framework"

    error "Exception in thread "main" java.lang.RuntimeException: "framework/oat/x86_64/services.odex" has no dex files"

    jdk version "openjdk version "1.8.0_352" OpenJDK Runtime Environment (build 1.8.0_352-b08) OpenJDK 64-Bit Server VM (build 25.352-b08, mixed mode)"

    opened by Dialgatrainer02 1
  • java.lang.NullPointerException, Invalid switch payload offset, and others

    java.lang.NullPointerException, Invalid switch payload offset, and others

    Hello!

    I'm using recent 2.5.2-2771eae0 revision of smali libraries and having the following issues:

    baksmali x "system/app/FMRadio.odex" -d system/framework/ -o "FMRadio"
    
    
    Error occurred while disassembling class Lcom.huawei.android.FMRadio.ChannelListActivity$1; - skipping class
    java.lang.NullPointerException
    	at org.jf.dexlib2.analysis.MethodAnalyzer.addPredecessorSuccessor(MethodAnalyzer.java:559)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.addPredecessorSuccessor(MethodAnalyzer.java:551)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.buildInstructionList(MethodAnalyzer.java:541)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:126)
    	at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:452)
    	at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:358)
    	at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:224)
    	at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:325)
    	at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:115)
    	at org.jf.baksmali.Baksmali.disassembleClass(Baksmali.java:161)
    	at org.jf.baksmali.Baksmali.access$000(Baksmali.java:46)
    	at org.jf.baksmali.Baksmali$1.call(Baksmali.java:76)
    	at org.jf.baksmali.Baksmali$1.call(Baksmali.java:74)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    
    
    Error occurred while disassembling class Lcom.huawei.android.FMRadio.ChannelListActivity$5; - skipping class
    org.jf.dexlib2.analysis.AnalysisException: Invalid switch payload offset
    	at org.jf.dexlib2.analysis.MethodAnalyzer.buildInstructionList(MethodAnalyzer.java:523)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:126)
    	at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:452)
    	at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:358)
    	at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:224)
    	at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:325)
    	at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:115)
    	at org.jf.baksmali.Baksmali.disassembleClass(Baksmali.java:161)
    	at org.jf.baksmali.Baksmali.access$000(Baksmali.java:46)
    	at org.jf.baksmali.Baksmali$1.call(Baksmali.java:76)
    	at org.jf.baksmali.Baksmali$1.call(Baksmali.java:74)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    
    Error occurred while disassembling class Lcom.huawei.android.FMRadio.ItemHolder; - skipping class
    java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
    	at org.jf.dexlib2.analysis.AnalyzedInstruction.getPreInstructionRegisterType(AnalyzedInstruction.java:634)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.getAndCheckSourceRegister(MethodAnalyzer.java:1938)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeIputIgetQuick(MethodAnalyzer.java:1680)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1037)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:200)
    	at org.jf.dexlib2.analysis.MethodAnalyzer.<init>(MethodAnalyzer.java:130)
    	at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:452)
    	at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:358)
    	at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:224)
    	at org.jf.baksmali.Adaptors.ClassDefinition.writeDirectMethods(ClassDefinition.java:279)
    	at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:114)
    	at org.jf.baksmali.Baksmali.disassembleClass(Baksmali.java:161)
    	at org.jf.baksmali.Baksmali.access$000(Baksmali.java:46)
    	at org.jf.baksmali.Baksmali$1.call(Baksmali.java:76)
    	at org.jf.baksmali.Baksmali$1.call(Baksmali.java:74)
    	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    
    

    FMRadio.zip

    opened by axet 0
  • Fixing missing reference type handling for rewriting purposes

    Fixing missing reference type handling for rewriting purposes

    During some DEX rewriting using the latest features, exceptions get thrown because of missing handling of some reference types.

    Fixed that, and also went through the code to fix all other missing stuff. In some cases, maybe no real opcode would be coded such way that some code path would be triggered, but this way is more safe.

    Also, likely fixed a bug of interning METHOD_HANDLE type.

    opened by andvgal 2
  • Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: -1

    Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: -1

    HI JesuFreke,thank you for your reading

    this is all of the errors: W/System.err: org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Landroid/support/v4/app/INotificationSideChannel;->ja(Ljava/lang/String;)Ljava/lang/String; W/System.err: at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1058) W/System.err: at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:354) W/System.err: at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:309) W/System.err: at sharkfall.inc.test.test(test.java:66) W/System.err: Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x0 W/System.err: at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1331) W/System.err: at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1054) W/System.err: ... 15 more W/System.err: Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: -1 W/System.err: at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116) W/System.err: at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:183) W/System.err: at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1240) W/System.err: ... 16 more

    this is smali method: .method private static ja(Ljava/lang/String;)Ljava/lang/String; .registers 6

    new-instance v1, Ljava/lang/StringBuilder;
    
    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
    
    invoke-virtual {p0}, Ljava/lang/String;->toCharArray()[C
    
    move-result-object v2
    
    const/4 v0, 0x0
    
    :goto_a
    array-length v3, v2
    
    if-ge v0, v3, :cond_3e
    
    rem-int/lit8 v3, v0, 0x4
    
    packed-switch v3, :pswitch_data_44
    
    aget-char v3, v2, v0
    
    xor-int/lit8 v3, v3, -0x1
    
    int-to-char v3, v3
    
    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
    
    :goto_1a
    add-int/lit8 v0, v0, 0x1
    
    goto :goto_a
    
    :pswitch_1d
    aget-char v3, v2, v0
    
    const v4, 0x40b27
    
    xor-int/2addr v3, v4
    
    int-to-char v3, v3
    
    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
    
    goto :goto_1a
    
    :pswitch_28
    aget-char v3, v2, v0
    
    const v4, 0x5863c4a9
    
    xor-int/2addr v3, v4
    
    int-to-char v3, v3
    
    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
    
    goto :goto_1a
    
    :pswitch_33
    aget-char v3, v2, v0
    
    const v4, 0x525978fe
    
    xor-int/2addr v3, v4
    
    int-to-char v3, v3
    
    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;
    
    goto :goto_1a
    
    :cond_3e
    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    
    move-result-object v0
    
    return-object v0
    
    nop
    
    :pswitch_data_44
    .packed-switch 0x0
        :pswitch_1d
        :pswitch_28
        :pswitch_33
    .end packed-switch
    

    .end method

    opened by SharkFall 0
  • android10 Hidden API cause bootloop

    android10 Hidden API cause bootloop

    Hi @JesusFreke I tried https://github.com/JesusFreke/smali/pull/816 commit but this is not working!

    I just recompile classes.dex in framework.jar It gave error: 'Unable to find class android/app/admin/SecurityLog$SecurityEvent'

    The logcat here: logcat.txt

    04-20 00:01:57.140 20598 20598 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20598 (main), pid 20598 (main) 04-20 00:01:57.168 20649 20649 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 04-20 00:01:57.168 20649 20649 F DEBUG : LineageOS Version: '17.1-20220214-UNOFFICIAL-starlte' 04-20 00:01:57.168 20649 20649 F DEBUG : Build fingerprint: 'samsung/starltexx/starlte:10/QP1A.190711.020/G960FXXU7DTAA:user/release-keys' 04-20 00:01:57.168 20649 20649 F DEBUG : Revision: '26' 04-20 00:01:57.168 20649 20649 F DEBUG : ABI: 'arm64' 04-20 00:01:57.169 20649 20649 F DEBUG : Timestamp: 2022-04-20 00:01:57+0700 04-20 00:01:57.169 20649 20649 F DEBUG : pid: 20598, tid: 20598, name: main >>> zygote64 <<< 04-20 00:01:57.169 20649 20649 F DEBUG : uid: 0 04-20 00:01:57.169 20649 20649 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 04-20 00:01:57.169 20649 20649 F DEBUG : Abort message: 'Unable to find class android/app/admin/SecurityLog$SecurityEvent' 04-20 00:01:57.169 20649 20649 F DEBUG : x0 0000000000000000 x1 0000000000005076 x2 0000000000000006 x3 0000007fe6e8e8b0 04-20 00:01:57.169 20649 20649 F DEBUG : x4 0080000000000000 x5 0080000000000000 x6 0080000000000000 x7 0000000000008000 04-20 00:01:57.169 20649 20649 F DEBUG : x8 00000000000000f0 x9 000000768fc3b4a0 x10 0000000000000000 x11 0000000000000001 04-20 00:01:57.169 20649 20649 F DEBUG : x12 0000007fe6e8ea40 x13 0000000000000030 x14 ffffffffffffffff x15 000000000003926e 04-20 00:01:57.169 20649 20649 F DEBUG : x16 000000768fd088c0 x17 000000768fce6310 x18 000000769320e000 x19 00000000000000ac 04-20 00:01:57.169 20649 20649 F DEBUG : x20 0000000000005076 x21 00000000000000b2 x22 0000000000005076 x23 00000000ffffffff 04-20 00:01:57.169 20649 20649 F DEBUG : x24 0000007692015068 x25 000000769308c020 x26 0000007692034000 x27 431bde82d7b634db 04-20 00:01:57.169 20649 20649 F DEBUG : x28 0000000000000003 x29 0000007fe6e8e960 04-20 00:01:57.169 20649 20649 F DEBUG : sp 0000007fe6e8e890 lr 000000768fc99170 pc 000000768fc991a0 04-20 00:01:57.177 20649 20649 F DEBUG : 04-20 00:01:57.177 20649 20649 F DEBUG : backtrace: 04-20 00:01:57.177 20649 20649 F DEBUG : #00 pc 00000000000821a0 /apex/com.android.runtime/lib64/bionic/libc.so (abort+176) (BuildId: a5aa1dd8572ed64645c321b17b43e24d) 04-20 00:01:57.177 20649 20649 F DEBUG : https://github.com/JesusFreke/smali/pull/1 pc 0000000000008a74 /system/lib64/liblog.so (__android_log_assert+324) (BuildId: 8c965f7a3c14a1799bc31f4b9a6fe159) 04-20 00:01:57.178 20649 20649 F DEBUG : https://github.com/JesusFreke/smali/pull/2 pc 00000000000d2924 /system/lib64/libandroid_runtime.so (android::register_android_app_admin_SecurityLog(_JNIEnv*)+476) (BuildId: eac6993b3f0f3278ee5a7c283b740b10) 04-20 00:01:57.178 20649 20649 F DEBUG : https://github.com/JesusFreke/smali/pull/3 pc 00000000000c2658 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::startReg(_JNIEnv*)+112) (BuildId: eac6993b3f0f3278ee5a7c283b740b10) 04-20 00:01:57.178 20649 20649 F DEBUG : https://github.com/JesusFreke/smali/pull/4 pc 00000000000c22dc /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vectorandroid::String8 const&, bool)+364) (BuildId: eac6993b3f0f3278ee5a7c283b740b10) 04-20 00:01:57.178 20649 20649 F DEBUG : https://github.com/JesusFreke/smali/pull/5 pc 00000000000034e0 /system/bin/app_process64 (main+1168) (BuildId: f76426758d45e1a553be61a1caa503f7) 04-20 00:01:57.178 20649 20649 F DEBUG : https://github.com/JesusFreke/smali/pull/6 pc 000000000007d844 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: a5aa1dd8572ed64645c321b17b43e24d) 04-20 00:01:57.186 20599 20599 F : Unable to find class android/app/admin/SecurityLog$SecurityEvent 04-20 00:01:57.186 20599 20599 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20599 (main), pid 20599 (main) 04-20 00:01:57.286 20649 20649 E crash_dump64: unable to connect to activity manager: Connection refused 04-20 00:01:57.288 4223 4223 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_00 04-20 00:01:57.294 20659 20659 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 04-20 00:01:57.294 20659 20659 F DEBUG : LineageOS Version: '17.1-20220214-UNOFFICIAL-starlte' 04-20 00:01:57.294 20659 20659 F DEBUG : Build fingerprint: 'samsung/starltexx/starlte:10/QP1A.190711.020/G960FXXU7DTAA:user/release-keys' 04-20 00:01:57.294 20659 20659 F DEBUG : Revision: '26' 04-20 00:01:57.294 20659 20659 F DEBUG : ABI: 'arm' 04-20 00:01:57.294 20659 20659 F DEBUG : Timestamp: 2022-04-20 00:01:57+0700 04-20 00:01:57.294 20659 20659 F DEBUG : pid: 20599, tid: 20599, name: main >>> zygote <<< 04-20 00:01:57.294 20659 20659 F DEBUG : uid: 0 04-20 00:01:57.294 20659 20659 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 04-20 00:01:57.294 20659 20659 F DEBUG : Abort message: 'Unable to find class android/app/admin/SecurityLog$SecurityEvent' 04-20 00:01:57.294 20659 20659 F DEBUG : r0 00000000 r1 00005077 r2 00000006 r3 ffa49ac8 04-20 00:01:57.294 20659 20659 F DEBUG : r4 ffa49adc r5 ffa49ac0 r6 00005077 r7 0000016b 04-20 00:01:57.294 20659 20659 F DEBUG : r8 ffa49ad8 r9 ffa49ac8 r10 ffa49af8 r11 ffa49ae8 04-20 00:01:57.294 20659 20659 F DEBUG : ip 00005077 sp ffa49a98 lr e76212b3 pc e76212c6

    The framework.jar file: framework.zip

    Thank you so much!

    opened by xconer 1
Owner
Ben Gruver
Ben Gruver
Dex to Java decompiler

JADX jadx - Dex to Java decompiler Command line and GUI tools for producing Java source code from Android Dex and Apk files Main features: decompile D

null 32.8k Jan 2, 2023
Appdbg - make it possible to run android dex file in original Java Virtual Machine

Appdbg - make it possible to run android dex file in original Java Virtual Machine

null 137 Dec 20, 2022
Dex manipulation library

dexterity Description dexterity is a C library intended for manipulation and analysis of DEX files. It has python bindings for all basic DEX structure

Rodrigo Chiossi 93 Nov 25, 2022
A program to flip every private, protected and package-private access flag to public in an Android dex file!

DexExposed A program to flip every private, protected and package-private access flag to public in an Android dex file! Building Simply run gradle mak

John Doe 2 Aug 29, 2021
An advanced DEX editor for Android.

Dexter A WIP DEX editor (hence the name Dexter) for Android that uses Smali. Available decompilers JADX Fernflower CFR JD-Core Procyon TO-DO Implement

Mike Anderson 72 Dec 23, 2022
A RSA Cipher implementation for Kotlin/Java

A RSA Cipher implementation for Kotlin/Java.

Lyzev 3 Aug 22, 2022
CLI tool for decompiling Android apps to Java. It does resources! It does Java! Its real easy!

Easy-as-pie Android Decompiler Why One stop shop I got pretty tired of decompiling Android apps with a bunch of steps that I had to remember all the t

Alex Davis 619 Dec 27, 2022
simple implementation KTLint with lib JLLeitschuh/ktlint-gradle

Simple DETEKT implementation others KTLint KTLint-gradle DeteKT Spotless gradle-code-quality-tools-plugin Tutorials medium Config detekt config.yml Gr

John Alves 0 Jun 10, 2022
AndroidHybridCrypto is simple customizable Android implementation of hybrid cryptography (AES+RSA+Hash) recommended by OWASP.

AndroidHybridCrypto HybridCrypto is simple customizable Android implementation of hybrid cryptography (AES+RSA+Hash) recommended by OWASP. Usage Step

UTNGY Pisal 2 Sep 6, 2022
Signal Protocol library for Java/Android

Overview A ratcheting forward secrecy protocol that works in synchronous and asynchronous messaging environments. PreKeys This protocol uses a concept

Signal 1.8k Dec 24, 2022
Grab’n Run, a simple and effective Java Library for Android projects to secure dynamic code loading.

Grab’n Run, a simple and effective Java Library for Android projects to secure dynamic code loading.

Luca Falsina 418 Dec 29, 2022
TweetNaCl in Java - a port of TweetNaCl-js

TweetNacl in Java: port of tweetnacl-js API/Usage Suggest always use TweetNaclFast implementation Public key authenticated encryption get key pair: Bo

AppNet.Link 40 Nov 10, 2022
Analyze any Android/Java based app or game

ClassyShark Introduction ClassyShark is a standalone binary inspection tool for Android developers. It can reliably browse any Android executable and

Google 7.2k Jan 3, 2023
A Java ePub reader and parser framework for Android.

FolioReader-Android is an EPUB reader written in Java and Kotlin. Features Custom Fonts Custom Text Size Themes / Day mode / Night mode Text Highlight

FolioReader 2.1k Jan 3, 2023
A program analysis tool to find cryptographic misuse in Java and Android.

A program analysis tool to find cryptographic misuse in Java and Android.

null 92 Dec 15, 2022
CRYLOGGER: Detecting Crypto Misuses for Android and Java Apps Dynamically

CRYLOGGER: Detecting Crypto Misuses for Android and Java Apps Dynamically

Luca Piccolboni 139 Dec 12, 2022
Java bytecode obfuscator created by x4e.

Binscure Java bytecode obfuscator created by x4e. Usage First, create a config file, (example config here). When you have a config file, run binscure

null 35 Nov 22, 2022
Soot - A Java optimization framework

Using Soot? Let us know about it! We are regularly applying for funding to help us maintain Soot. You can help us immensely by letting us know about p

Soot Program Analysis Framework 2.5k Jan 2, 2023