JesusFreke / smali

smali/baksmali
6.35k stars 1.07k forks source link

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

Open axet opened 2 years ago

axet commented 2 years ago

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

bphd commented 1 month ago

Same here