CodingGay / BlackObfuscator-ASPlugin

This project is an Android Studio plugin version of BlackObfuscator, it supports obfuscating code automatically. More information about this project are in BlackObfuscator.
Apache License 2.0
422 stars 121 forks source link

插件打包没有混淆 #6

Closed huwenkai26 closed 2 years ago

huwenkai26 commented 2 years ago

Configure project :app =====BlackObfuscator===== BlackObfuscatorExtension{enabled=true, depth=2, obfClass=[io.github.mesadhan.drive_rest_sample, com.fasterxml.jackson.core], blackClass=[top.niunaijun.black]}

add Task mergeDexRelease

Task :app:preBuild UP-TO-DATE Task :app:preDebugBuild UP-TO-DATE Task :app:compileDebugAidl NO-SOURCE Task :app:compileDebugRenderscript NO-SOURCE Task :app:checkDebugManifest Task :app:generateDebugBuildConfig Task :app:mainApkListPersistenceDebug Task :app:generateDebugResValues Task :app:generateDebugResources Task :app:javaPreCompileDebug Task :app:createDebugCompatibleScreenManifests Task :app:processDebugManifest Task :app:mergeDebugShaders Task :app:compileDebugShaders Task :app:generateDebugAssets Task :app:mergeDebugAssets Task :app:processDebugJavaRes NO-SOURCE Task :app:checkDebugDuplicateClasses Task :app:desugarDebugFileDependencies Task :app:validateSigningDebug Task :app:signingConfigWriterDebug Task :app:mergeDebugJniLibFolders Task :app:mergeDebugResources Task :app:processDebugResources Task :app:compileDebugJavaWithJavac Task :app:compileDebugSources Task :app:transformClassesWithDexBuilderForDebug Task :app:mergeDebugJavaResource Task :app:mergeExtDexDebug Task :app:mergeDebugNativeLibs Task :app:stripDebugDebugSymbols Task :app:mergeDexDebug Task :app:packageDebug Task :app:assembleDebug

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 21s 25 actionable tasks: 25 executed 14:46:34: Task execution finished 'assembleDebug'.

ksxkq commented 2 years ago

我也遇到了,但是很奇怪,我的项目是两个分支,一个 需要上架 GooglePay,一个不需要。在需要上架 GooglePlay 那个分支打包出来就没有混淆: `10:09:17: Executing task 'resguardGoogleplayPreRlease'...

Executing tasks: [resguardGoogleplayPreRlease] in project /Users/Test/Documents/Space/Test

Task :buildSrc:compileJava NO-SOURCE Task :buildSrc:compileGroovy NO-SOURCE Task :buildSrc:processResources NO-SOURCE Task :buildSrc:classes UP-TO-DATE Task :buildSrc:jar UP-TO-DATE Task :buildSrc:assemble UP-TO-DATE Task :buildSrc:compileTestJava NO-SOURCE Task :buildSrc:compileTestGroovy NO-SOURCE Task :buildSrc:processTestResources NO-SOURCE Task :buildSrc:testClasses UP-TO-DATE Task :buildSrc:test NO-SOURCE Task :buildSrc:check UP-TO-DATE Task :buildSrc:build UP-TO-DATE

Configure project :app

AppLovin Quality Service Plug-in for Gradle and Android Studio Version 4.1.3 Copyright (c) 2021 AppLovin Ltd. All rights reserved.

=====BlackObfuscator===== BlackObfuscatorExtension{enabled=true, depth=1, obfClass=[com.test.test]}

add Task mergeLibDexDebug add Task mergeProjectDexDebug add Task minifyReleaseWithR8`

nnjun commented 2 years ago

目前有个问题需要注意,没有适配as自带的混淆,所以经过as混淆之后类名已经被改了。这个时候我再去混淆就找不到类了。目前的方法是keep需要混淆的类不要让as修改了类名包名

huwenkai26 commented 2 years ago

目前有个问题需要注意,没有适配as自带的混淆,所以经过as混淆之后类名已经被改了。这个时候我再去混淆就找不到类了。目前的方法是keep需要混淆的类不要让as修改了类名包名

我这个用的debug模式打包不会混淆

ksxkq commented 2 years ago

目前有个问题需要注意,没有适配as自带的混淆,所以经过as混淆之后类名已经被改了。这个时候我再去混淆就找不到类了。目前的方法是keep需要混淆的类不要让as修改了类名包名

从日志上看,是先执行的 BlackObfuscator,再执行 minifyReleaseWithR8,所以应该不是这个原因

Krosxx commented 2 years ago

混淆问题,是否可以使用注解来标记,想法来源:MichaelRocks/paranoid

nnjun commented 2 years ago

minifyReleaseWithR8

是先执行minifyReleaseWithR8后再执行BlackObfuscator

ksxkq commented 2 years ago

minifyReleaseWithR8

是先执行minifyReleaseWithR8后再执行BlackObfuscator

这样吗,我还以为日志的输出顺序就是执行顺序

nnjun commented 2 years ago

目前有个问题需要注意,没有适配as自带的混淆,所以经过as混淆之后类名已经被改了。这个时候我再去混淆就找不到类了。目前的方法是keep需要混淆的类不要让as修改了类名包名

我这个用的debug模式打包不会混淆

你这个debug模式确实存在问题,已修复。请尝试使用3.3版本

nnjun commented 2 years ago

混淆问题,是否可以使用注解来标记,想法来源:MichaelRocks/paranoid

注解建议已经有人提过了,正在考虑中~

ksxkq commented 2 years ago

@nnjun 大佬有赞助渠道吗,微信二维码或者支付宝二维码,来一个?

nnjun commented 2 years ago

@nnjun 大佬有赞助渠道吗,微信二维码或者支付宝二维码,来一个?

或许我可以放到首页去🦉

nnjun commented 2 years ago

目前3.5版本已支持与Android Studio的混淆共存,兼容R8 和 Proguard的Mapping