Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LambadaNameSafeClassAdapter cannot works well #557

Open
Marukohe opened this issue Oct 12, 2022 · 1 comment
Open

LambadaNameSafeClassAdapter cannot works well #557

Marukohe opened this issue Oct 12, 2022 · 1 comment

Comments

@Marukohe
Copy link
Contributor

I use dex2jar to translate some android apps, but lambda expressions cannot be translated correctly.
Here is an example. The class name was changed by LambadaNameSafeClassAdapter, but the content (like fileds, functions
) in the class was not changed. Its has a filed public static final io.github.hidroh.materialistic.-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk INSTANCE;. When I load this class, the class of this field will also be loaded, which is io.github.hidroh.materialistic.-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk. But this class name is changed and it doesn't exists now.

Classfile /private/tmp/dex-tools-2.1/work/io/github/hidroh/materialistic/_$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk.class
  Last modified 2022年10月12日; size 607 bytes
  MD5 checksum c4054a9fe7e9d3e991afed712059aa8d
public final class io.github.hidroh.materialistic._$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk implements rx.functions.Func1
  minor version: 0
  major version: 50
  flags: (0x1031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER, ACC_SYNTHETIC
  this_class: #2                          // io/github/hidroh/materialistic/_$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk
  super_class: #4                         // java/lang/Object
  interfaces: 1, fields: 1, methods: 3, attributes: 0
Constant pool:
   #1 = Utf8               io/github/hidroh/materialistic/_$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk
   #2 = Class              #1             // io/github/hidroh/materialistic/_$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk
   #3 = Utf8               java/lang/Object
   #4 = Class              #3             // java/lang/Object
   #5 = Utf8               rx/functions/Func1
   #6 = Class              #5             // rx/functions/Func1
   #7 = Utf8               INSTANCE
   #8 = Utf8               Lio/github/hidroh/materialistic/-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk;
   #9 = Utf8               <clinit>
  #10 = Utf8               ()V
  #11 = Utf8               <init>
  #12 = NameAndType        #11:#10        // "<init>":()V
  #13 = Methodref          #2.#12         // io/github/hidroh/materialistic/_$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk."<init>":()V
  #14 = NameAndType        #7:#8          // INSTANCE:Lio/github/hidroh/materialistic/-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk;
  #15 = Fieldref           #2.#14         // io/github/hidroh/materialistic/_$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk.INSTANCE:Lio/github/hidroh/materialistic/-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk;
  #16 = Utf8               Code
  #17 = Methodref          #4.#12         // java/lang/Object."<init>":()V
  #18 = Utf8               call
  #19 = Utf8               (Ljava/lang/Object;)Ljava/lang/Object;
  #20 = Utf8               java/lang/Throwable
  #21 = Class              #20            // java/lang/Throwable
  #22 = Utf8               io/github/hidroh/materialistic/AdBlocker
  #23 = Class              #22            // io/github/hidroh/materialistic/AdBlocker
  #24 = Utf8               lambda$init$154
  #25 = Utf8               (Ljava/lang/Throwable;)Ljava/lang/Void;
  #26 = NameAndType        #24:#25        // lambda$init$154:(Ljava/lang/Throwable;)Ljava/lang/Void;
  #27 = Methodref          #23.#26        // io/github/hidroh/materialistic/AdBlocker.lambda$init$154:(Ljava/lang/Throwable;)Ljava/lang/Void;
{
  public static final io.github.hidroh.materialistic.-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk INSTANCE;
    descriptor: Lio/github/hidroh/materialistic/-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk;
    flags: (0x1019) ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC

  static {};
    descriptor: ()V
    flags: (0x1008) ACC_STATIC, ACC_SYNTHETIC
    Code:
      stack=2, locals=0, args_size=0
         0: new           #2                  // class io/github/hidroh/materialistic/_$$Lambda$AdBlocker$AW2_vy7CI0SI2JWwEl8UTsVtDUk
         3: dup
         4: invokespecial #13                 // Method "<init>":()V
         7: putstatic     #15                 // Field INSTANCE:Lio/github/hidroh/materialistic/-$$Lambda$AdBlocker$AW2-vy7CI0SI2JWwEl8UTsVtDUk;
        10: return

  public final java.lang.Object call(java.lang.Object);
    descriptor: (Ljava/lang/Object;)Ljava/lang/Object;
    flags: (0x0011) ACC_PUBLIC, ACC_FINAL
    Code:
      stack=1, locals=2, args_size=2
         0: aload_1
         1: checkcast     #21                 // class java/lang/Throwable
         4: invokestatic  #27                 // Method io/github/hidroh/materialistic/AdBlocker.lambda$init$154:(Ljava/lang/Throwable;)Ljava/lang/Void;
         7: areturn
}
@ThexXTURBOXx
Copy link
Collaborator

Please follow #556 and close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants