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

子模块implementation的模块无法混淆 #61

Open
VocientLuo opened this issue Jan 4, 2024 · 4 comments
Open

子模块implementation的模块无法混淆 #61

VocientLuo opened this issue Jan 4, 2024 · 4 comments

Comments

@VocientLuo
Copy link

image
127行应该是直接写入names变量。否则会有这个问题。

@liujingxing
Copy link
Owner

liujingxing commented Jan 4, 2024

没有问题,主module无法间接引用子module implementation依赖的库,只有api才可间接依赖

@VocientLuo
Copy link
Author

VocientLuo commented Jan 5, 2024

没有问题,主module无法间接引用子module implementation依赖的库,只有api才可间接依赖

但是文件名和路径混淆会修改到间接implementation模块中的文件。
image
可能是49行里的文件名和路径修改中,项目检索方式跟上面的不太一致。
image
findLocalProject是根据路径找到项目做路径混淆,会把路径和文件名混淆。
但文件内容的class实际没做修改。

@liujingxing
Copy link
Owner

后续有时间会修复,感谢提出

@VocientLuo
Copy link
Author

VocientLuo commented Jan 19, 2024

根据实践,这两个地方可能还要继续优化:
1、查找项目时compileOnly也要加上。模块化开发时会有这种情况出现。模块a可能compileOnly某个本地模块
image
如果不加上这个,可能导致模块a中的xml文件没有被修改到混淆后的class引用而报错。

2、替换java中的R引用时,我加了这个:
image
这样主要是为了排除掉模块a下的某个文件已经import了其他模块中的R文件,如果再import当前R文件,就会存在两个R文件导致报错。
模块化的R文件多而复杂,怎么准确的匹配到需要替换的R文件是个比较头疼的问题,也许这个设置也不能完美解决问题,但至少满足我这边的项目。可能需要从开发规范上避免这种情况出现。

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