Bug 577631 - Android R8 class which use @Around Hook, App crash when runtime
Summary: Android R8 class which use @Around Hook, App crash when runtime
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.9.7   Edit
Hardware: Other Android
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-06 01:26 EST by Jay Jay CLA
Modified: 2021-12-06 21:06 EST (History)
0 users

See Also:


Attachments
source file (115.73 KB, application/zip)
2021-12-06 01:26 EST, Jay Jay CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jay Jay CLA 2021-12-06 01:26:23 EST
Created attachment 287626 [details]
source file

java.lang.VerifyError: Verifier rejected class com.example.aspectj.DeviceId: void com.example.aspectj.DeviceId.<init>() failed to verify: void com.example.aspectj.DeviceId.<init>(): [0x24] register v0 has type Precise Reference: java.lang.Class but expected Precise Reference: com.example.aspectj.DeviceId (declaration of 'com.example.aspectj.DeviceId' appears in /data/app/com.example.demo-R-5nAjwx4HN7hMtINZHtPA==/base.apk)



DeviceId.java -> android R8 complie -> R8 DeviceId.class -> Aspectj AroundHook.java -> Aspectj DeviceId.class


The Aspect DeviceId.class is Error !!!




please decompile Aspectj DeviceId.class
Comment 1 Jay Jay CLA 2021-12-06 01:31:19 EST
Decompile aspectj DeviceId.class


public DeviceId() {
        if (DeviceId.uuid == null) {
            final Class<DeviceId> ajc$this = DeviceId.class;
            synchronized (ajc$this) {
                if (DeviceId.uuid == null) {
                    try {
                        final byte[] bytes = "9774d56d682e549c".getBytes("utf-8");
                        final JoinPoint jp = Factory.makeJP(DeviceId.ajc$tjp_0, (Object)ajc$this, (Object)null, (Object)bytes);
                        DeviceId.uuid = (UUID)nameUUIDFromBytes_aroundBody1$advice((DeviceId)ajc$this, bytes, jp, AroundHook.aspectOf(), (ProceedingJoinPoint)jp);
                        System.out.println(DeviceId.uuid);
                    }
                    catch (UnsupportedEncodingException cause) {
                        throw new RuntimeException(cause);
                    }
                }
            }
        }
    }
Comment 2 Jay Jay CLA 2021-12-06 01:36:12 EST
ajc$this is Class, Not an Object !!!