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

你好,能否指定某个Activity不被混淆 #67

Open
ljqiang opened this issue Apr 28, 2024 · 2 comments
Open

你好,能否指定某个Activity不被混淆 #67

ljqiang opened this issue Apr 28, 2024 · 2 comments

Comments

@ljqiang
Copy link

ljqiang commented Apr 28, 2024

你好,像下面这种情况,我们定义的一个Activity,在manifest中定义的

<activity
        android:name="com.xxx.xxx.activity.MainActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"
        android:exported="true"
        android:taskAffinity="com.xxx.xxx"
        android:launchMode="singleTask">
</activity>

其中com.xxx.xxx是应用包名,以上信息配置到manifest里后,有办法不混淆这个Activity吗?

使用如下的方法也还是不行,还是会被混淆
android:name="${applicationId}.activity.MainActivity"

请问有什么好办法吗,非常感谢

@liujingxing
Copy link
Owner

想要弄明白这个问题,先要搞懂xmlClassGuard任务都会混淆哪些类android:name="${applicationId}.activity.MainActivity"这样配置的Activity在检索时,是检索不到的,也就不会混淆,但如果{applicationId}.activity包下,其他类检索到了,那这个类就会一起混淆。

所以,如果不想被混淆,单独存放在一个包下即可

@ljqiang
Copy link
Author

ljqiang commented Apr 28, 2024

好的,明白了,非常感谢

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