pxb1988 / dex2jar

Tools to work with android .dex and java .class files
Apache License 2.0
12.36k stars 2.12k forks source link

java.lang.ClassCastException: class com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr cannot be cast to class com.googlecode.dex2jar.ir.expr.InvokeExpr (com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr and com.googlecode.dex2jar.ir.expr.InvokeExpr are in unnamed module of loader 'app') #586

Closed reactormonk closed 1 year ago

reactormonk commented 1 year ago
#This file is generated by dex2jar
Please report this file to https://github.com/pxb1988/dex2jar/issues if possible.

There are 2 methods fail to translate.
2023-07-09 09:33:26 UTC
version: [dex-reader-2.1, dex-reader-api-2.1, dex-ir-2.1, d2j-smali-2.1, d2j-base-cmd-2.1, dex-tools-2.1, dex-translator-2.1]
cmdline: [classes2.dex, classes3.dex, classes3-error.zip, classes4.dex, classes.dex]
env:
java.specification.version: 20
java.class.path: .:/opt/dex2jar/lib/antlr-3.5.2.jar:/opt/dex2jar/lib/antlr4-4.5.jar:/opt/dex2jar/lib/antlr4-runtime-4.5.jar:/opt/dex2jar/lib/antlr-runtime-3.5.2.jar:/opt/dex2jar/lib/asm-debug-all-5.0.3.jar:/opt/dex2jar/lib/d2j-base-cmd-2.1.jar:/opt/dex2jar/lib/d2j-jasmin-2.1.jar:/opt/dex2jar/lib/d2j-smali-2.1.jar:/opt/dex2jar/lib/dex-ir-2.1.jar:/opt/dex2jar/lib/dex-reader-2.1.jar:/opt/dex2jar/lib/dex-reader-api-2.1.jar:/opt/dex2jar/lib/dex-tools-2.1.jar:/opt/dex2jar/lib/dex-translator-2.1.jar:/opt/dex2jar/lib/dex-writer-2.1.jar:/opt/dex2jar/lib/dx-27.0.3.jar:/opt/dex2jar/lib/org.abego.treelayout.core-1.0.1.jar:/opt/dex2jar/lib/ST4-4.0.8.jar
java.vm.vendor: Oracle Corporation
java.vendor.url: https://openjdk.org/
java.vm.specification.version: 20
java.specification.vendor: Oracle Corporation
java.version.date: 2023-04-18
java.home: /usr/lib/jvm/java-20-openjdk
java.vm.compressedOopsMode: 32-bit
java.vm.specification.vendor: Oracle Corporation
java.specification.name: Java Platform API Specification
java.runtime.version: 20.0.1+9
java.runtime.name: OpenJDK Runtime Environment
java.vm.name: OpenJDK 64-Bit Server VM
java.vendor.url.bug: https://bugreport.java.com/bugreport/
java.io.tmpdir: /tmp
java.version: 20.0.1
java.vm.specification.name: Java Virtual Machine Specification
java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
java.vm.info: mixed mode, sharing
java.vendor: N/A
java.vm.version: 20.0.1+9
java.class.version: 64.0

================= 0 ===================
Landroid/widget/RemoteViews$ViewContentNavigation;.apply(Landroid/view/View;Landroid/view/ViewGroup;Landroid/widget/RemoteViews$OnClickHandler;)V
java.lang.ClassCastException: class com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr cannot be cast to class com.googlecode.dex2jar.ir.expr.InvokeExpr (com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr and com.googlecode.dex2jar.ir.expr.InvokeExpr are in unnamed module of loader 'app')
        at com.googlecode.dex2jar.ir.ts.NewTransformer.findInvokeExpr(NewTransformer.java:361)
        at com.googlecode.dex2jar.ir.ts.NewTransformer.replaceAST(NewTransformer.java:98)
        at com.googlecode.dex2jar.ir.ts.NewTransformer.transform(NewTransformer.java:68)
        at com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:150)
        at com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:452)
        at com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:40)
        at com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:132)
        at com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:596)
        at com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:444)
        at com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:357)
        at com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:460)
        at com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:175)
        at com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:275)
        at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:112)
        at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:290)
        at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:33)

.method public apply(Landroid/view/View;Landroid/view/ViewGroup;Landroid/widget/RemoteViews$OnClickHandler;)V
  .catchall { :L0 .. :L3 } :L4
  .registers 6
    iget p2, p0, Landroid/widget/RemoteViews$ViewContentNavigation;->viewId:I
    invoke-virtual { p1, p2 }, Landroid/view/View;->findViewById(I)Landroid/view/View;
    move-result-object p1
    if-nez p1, :L0
    return-void
  :L0
    iget-object p2, p0, Landroid/widget/RemoteViews$ViewContentNavigation;->this$0:Landroid/widget/RemoteViews;
    iget-boolean p3, p0, Landroid/widget/RemoteViews$ViewContentNavigation;->mNext:Z
    if-eqz p3, :L1
    const-string/jumbo p3, "showNext"
    goto :L2
  :L1
    const-string/jumbo p3, "showPrevious"
  :L2
    const/4 v0, 0
    const/4 v1, 0
    invoke-static { p2, p1, p3, v0, v1 }, Landroid/widget/RemoteViews;->access$700(Landroid/widget/RemoteViews;Landroid/view/View;Ljava/lang/String;Ljava/lang/Class;Z)Ljava/lang/invoke/MethodHandle;
    move-result-object p2
    invoke-polymorphic { p2, p1 }, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (Landroid/view/View;)V
  :L3
    nop
    return-void
  :L4
    move-exception p1
    new-instance p2, Landroid/widget/RemoteViews$ActionException;
    invoke-direct { p2, p1 }, Landroid/widget/RemoteViews$ActionException;-><init>(Ljava/lang/Throwable;)V
    throw p2
.end method

================= 1 ===================
Landroid/widget/RemoteViews$ReflectionAction;.apply(Landroid/view/View;Landroid/view/ViewGroup;Landroid/widget/RemoteViews$OnClickHandler;)V
java.lang.ClassCastException: class com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr cannot be cast to class com.googlecode.dex2jar.ir.expr.InvokeExpr (com.googlecode.dex2jar.ir.expr.InvokePolymorphicExpr and com.googlecode.dex2jar.ir.expr.InvokeExpr are in unnamed module of loader 'app')
        at com.googlecode.dex2jar.ir.ts.NewTransformer.findInvokeExpr(NewTransformer.java:361)
        at com.googlecode.dex2jar.ir.ts.NewTransformer.replaceAST(NewTransformer.java:98)
        at com.googlecode.dex2jar.ir.ts.NewTransformer.transform(NewTransformer.java:68)
        at com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:150)
        at com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:452)
        at com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:40)
        at com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:132)
        at com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:596)
        at com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:444)
        at com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:357)
        at com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:460)
        at com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:175)
        at com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:275)
        at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:112)
        at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:290)
        at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:33)

.method public apply(Landroid/view/View;Landroid/view/ViewGroup;Landroid/widget/RemoteViews$OnClickHandler;)V
  .catchall { :L1 .. :L2 } :L3
  .registers 6
    iget p2, p0, Landroid/widget/RemoteViews$ReflectionAction;->viewId:I
    invoke-virtual { p1, p2 }, Landroid/view/View;->findViewById(I)Landroid/view/View;
    move-result-object p1
    if-nez p1, :L0
    return-void
  :L0
    invoke-direct { p0 }, Landroid/widget/RemoteViews$ReflectionAction;->getParameterType()Ljava/lang/Class;
    move-result-object p2
    if-eqz p2, :L4
  :L1
    iget-object p3, p0, Landroid/widget/RemoteViews$ReflectionAction;->this$0:Landroid/widget/RemoteViews;
    iget-object v0, p0, Landroid/widget/RemoteViews$ReflectionAction;->methodName:Ljava/lang/String;
    const/4 v1, 0
    invoke-static { p3, p1, v0, p2, v1 }, Landroid/widget/RemoteViews;->access$700(Landroid/widget/RemoteViews;Landroid/view/View;Ljava/lang/String;Ljava/lang/Class;Z)Ljava/lang/invoke/MethodHandle;
    move-result-object p2
    iget-object p3, p0, Landroid/widget/RemoteViews$ReflectionAction;->value:Ljava/lang/Object;
    invoke-polymorphic { p2, p1, p3 }, Ljava/lang/invoke/MethodHandle;->invoke([Ljava/lang/Object;)Ljava/lang/Object;, (Landroid/view/View;Ljava/lang/Object;)V
  :L2
    nop
    return-void
  :L3
    move-exception p1
    new-instance p2, Landroid/widget/RemoteViews$ActionException;
    invoke-direct { p2, p1 }, Landroid/widget/RemoteViews$ActionException;-><init>(Ljava/lang/Throwable;)V
    throw p2
  :L4
    new-instance p1, Landroid/widget/RemoteViews$ActionException;
    new-instance p2, Ljava/lang/StringBuilder;
    invoke-direct { p2 }, Ljava/lang/StringBuilder;-><init>()V
    const-string p3, "bad type: "
    invoke-virtual { p2, p3 }, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    iget p3, p0, Landroid/widget/RemoteViews$ReflectionAction;->type:I
    invoke-virtual { p2, p3 }, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
    invoke-virtual { p2 }, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    move-result-object p2
    invoke-direct { p1, p2 }, Landroid/widget/RemoteViews$ActionException;-><init>(Ljava/lang/String;)V
    throw p1
.end method
reactormonk commented 1 year ago

Works with the git version.