MegatronKing / StringFog

一款自动对字节码中的字符串进行加密Android插件工具
Apache License 2.0
1.67k stars 334 forks source link

5.0.0遇到的一些问题 #109

Closed ucxl closed 1 year ago

ucxl commented 1 year ago

我看作者没有上架5.0.0的插件,于是我自己 gradle publishToMavenLocal到本地库,使用发现一些问题 重新编译会有个mWriter的提示,退出studio删除掉build的stringfog.txt就可以重新编译 清理工程也是提示stringfog.txt 被占用,无法清理

我把这个集成到自己的工程里 编译完成不生成StringFog解密类,好奇怪,demo的却可以

MegatronKing commented 1 year ago

是不是buildfeatures没有配置,AGP 8.0之后要加上这个配置,readme我刚刚更新了

ucxl commented 1 year ago

buildConfig = true 这个配置我是加了, 刚才去掉引用本地库//mavenLocal() 在线更新了5.0.0的库 以上问题还是存在,不生成StringFog这个解密类,但是里面的字符串是加密的,找不到解密类 重新编译会提示mWriter.newLine() 为null,要退出studio再进才可以编译 编译一次成功后,再clean工程提示app\build\outputs\mapping\debug\stringfog.txt无法被清

KamiNoYuki commented 1 year ago

我升级5.0也遇到这个问题了,在buildFeatures添加了buildConfig = true也没用 以下是错误日志 Caused by: java.lang.NullPointerException: Cannot invoke "java.io.BufferedWriter.newLine()" because "this.mWriter" is null at com.github.megatronking.stringfog.plugin.StringFogMappingPrinter.output(StringFogMappingPrinter.java:77) at com.github.megatronking.stringfog.plugin.StringFogClassVisitor.encryptAndWrite(StringFogClassVisitor.java:256) at com.github.megatronking.stringfog.plugin.StringFogClassVisitor$3.visitLdcInsn(StringFogClassVisitor.java:216) at org.objectweb.asm.ClassReader.readCode(ClassReader.java:2421) at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1514) at org.objectweb.asm.ClassReader.accept(ClassReader.java:744) at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) at com.android.build.gradle.internal.instrumentation.AsmInstrumentationManager.doInstrumentByteCode(AsmInstrumentationManager.kt:225) at com.android.build.gradle.internal.instrumentation.AsmInstrumentationManager.doInstrumentClass(AsmInstrumentationManager.kt:257) ... 36 more

Sohoad commented 1 year ago

image 同样报错,兄弟有解决吗?

buildConfig = true 这个配置我是加了, 刚才去掉引用本地库//mavenLocal() 在线更新了5.0.0的库 以上问题还是存在,不生成StringFog这个解密类,但是里面的字符串是加密的,找不到类解密 重新编译会提示mWriter.newLine() 为null,要退出studio再进才可以编译 编译一次成功后,再clean工程提示app\build\outputs\mapping\debug\stringfog.txt无法被清

MegatronKing commented 1 year ago

更新了5.1.0,这些问题应该都不存在了。