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

处理AAR 警告:Type java.util.HashMap was not found 这个是否是正常的 #81

Open
gflkdns opened this issue Jul 28, 2023 · 5 comments

Comments

@gflkdns
Copy link

gflkdns commented Jul 28, 2023

基本所有android的类库都会报警告:

Warning in /Users/XXX/AndroidStudioProjects/XXX/build/outputs/aar/build/.dx_temp/classes.jar:އީާޖިެށޮ/ބވޏޟާވޤޞޖ$ބވޏޟާވޤޞޖ.class:
Type `java.util.HashMap` was not found, it is required for default or static interface methods desugaring of `އީާޖިެށޮ.ބވޏޟާވޤޞޖ$ބވޏޟާވޤޞޖ`

使用命令:

export ANDROID_SDK_HOME=/Users/XXX/Library/Android/sdk
export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk/22.1.7171670
export CMAKE_PATH=$ANDROID_SDK_HOME/cmake/3.22.1/
java -jar vm-protect-2023-07-08-0942.jar aar $aar_path convertRules.txt mapping.txt
@maoabc
Copy link
Owner

maoabc commented Jul 28, 2023

这是d8的报错,d8命令时没有指定android.jar, 不过一般情况没什么问题。如果有错,就得加上--lib xx.jar指定一些lib。d8调用在classesJarToDexJar方法里(

private File classesJarToDexJar() throws IOException {
),有注释怎么加参数

@maoabc
Copy link
Owner

maoabc commented Jul 28, 2023

如果使用了java8的语法糖,一般还需要再指定android.jar

@gflkdns
Copy link
Author

gflkdns commented Jul 28, 2023

好的 感谢解惑

@gflkdns gflkdns closed this as completed Jul 28, 2023
@gflkdns
Copy link
Author

gflkdns commented Jul 28, 2023

AAR 加固遇到这种kotlin语法就会崩溃 [ object : ],正在研究问题原因,怀疑导dex2jar或者是R8导致的

  val callback = object : PermissionUtils.SimpleCallback {
                    override fun onGranted() {
                        
                    }

                    override fun onDenied() {

                    }

                }

@gflkdns gflkdns reopened this Jul 28, 2023
@maoabc
Copy link
Owner

maoabc commented Jul 28, 2023

这个看着只是新建一个回调对象,应该不是这句代码产生的。后面回调接口实现会生成匿名内部类,如果它有default方法可能会有问题。

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