qq549631030 / androidjunkcode Goto Github PK
View Code? Open in Web Editor NEWAndroid马甲包生成垃圾代码插件
Android马甲包生成垃圾代码插件
这个报错要怎么解决
咋回事捏
xml的内容和图片单纯的复制多个,内容是完全一样的。
设置了多个productFlavors, variantConfig配置flavor+buildType不行。
运行仓库代码,build编译没生成文件呢,有啥特俗配置吗
plugins {
id 'com.android.library'
id 'android-junk-code'
}
有没有大佬碰到这个问题解决这个问题
the issue is compatible with Java 11 and the consumer needed a component compatible with Java 8. Can you Fix compatibility with Java 8, thanks
大佬,我做的马甲包原包69M,想放大1.5倍,到105M,就改配置参数。改大后,首次打包会变的很慢,大约50分钟。gradle.properties的配置我也加了,还有没有别的方法加快打包速度。
`A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve com.github.qq549631030:android-junk-code:1.0.9.
Required by:
project :
> No matching variant of com.github.qq549631030:android-junk-code:1.0.9 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally but:
- Variant 'apiElements' capability com.github.qq549631030:android-junk-code:1.0.9 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
- Variant 'runtimeElements' capability com.github.qq549631030:android-junk-code:1.0.9 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8`
如题
AndroidManifest 存在 一些三方库的key 占位, 编译时报错, junk manifest 里找不到占位的value ,咨询一下大佬, 这种情况要怎么办呢
github 太慢了
a(主包)衍生出b、c马甲包,b、c这两个包由于配置相同的垃圾代码包名,是否会被检测出来为马甲包呢
用了插件后再加固后还是会和另外一个用同样加固工具的包相识度过高
怎么解决Gradle最低版本限制
大佬 加你联系方式了 想请教您一些问题
如题
我把build.gradle全部换成build.gradle.kts,好像生成垃圾代码就不生效了!能帮忙看看吗?
同时打了两个包,一个包正常运行,另外一个包运行报错信息如下:
java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
看网上的说法是gradle版本过低,但是项目中的版本是gradle-5.4.1-all.zip
将com.android.tools.build:gradle:4.0.2升级到com.android.tools.build:gradle:4.1.0
编译时报错:
app\build\generated\source\junk\xxxx\a0\A0Activity.java:17: 错误: 找不到符号setContentView(R.layout.xxxx);
所有的都是按照说明配置的,但是没有生成垃圾代码啊
A problem was found with the configuration of task ':app:generateDebugJunkCode' (type 'AndroidJunkCodeTask').
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
In plugin 'android-junk-code' type 'cn.hx.plugin.junkcode.task.AndroidJunkCodeTask' property 'manifestPackageName' doesn't have a configured value.
Reason: This property isn't marked as optional and no value has been configured.
Possible solutions:
Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#value_not_set for more details about this problem.
at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.build(WorkValidationException.java:109)
at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.get(WorkValidationException.java:91)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:57)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:76)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:50)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNoEmptySources(SkipEmptyWorkStep.java:249)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:54)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:43)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:31)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:287)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:144)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:133)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:333)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:320)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:313)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:299)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:143)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:227)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:218)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:140)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
我按照写的方法,集成到项目后,运行项目没有添加文件进去呢。即使我下载你的项目到本地,运行项目后也是一样,build里面没有任何新增文件呢
我想修改插件的模板 并使用,但是我不知道使用本地插件依赖,可以告诉我该如何操作吗?
build error
android gradle plugin 3.2.0
androidJunkCode {
variantConfig {
release {//变体名称,如果没有设置productFlavors就是buildType名称,如果有设置productFlavors就是flavor+buildType,例如(freeRelease、proRelease)
packageBase = "cn.hx.plugin.ui" //生成java类根包名
packageCount = 30 //生成包数量
activityCountPerPackage = 3 //每个包下生成Activity类数量
excludeActivityJavaFile = false //是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
otherCountPerPackage = 50 //每个包下生成其它类的数量
methodCountPerClass = 20 //每个类下生成方法数量
resPrefix = "junk_" //生成的layout、drawable、string等资源名前缀
drawableCount = 300 //生成drawable资源数量
stringCount = 300 //生成string数量
}
}
}
我在Flutter中接入这个库想在Android中生成代码,但是没有生成成功,这个库还可以使用吗?
Error:
android:exported needs to be explicitly specified for element <receiver#com.hyphenate.chat.EMMonitorReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported
when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
通过360加固,这种方式不行么?
我司有五个马甲包 稍微参数慢慢加大 第三个就扛不住了 GC overhead limit exceeded 配置如下: packageBase = "sw.da.op" //生成java类根包名
packageCount = 35 //生成包数量
activityCountPerPackage = 130 //每个包下生成Activity类数量
excludeActivityJavaFile = false
//是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题
otherCountPerPackage = 100 //每个包下生成其它类的数量
methodCountPerClass = 70 //每个类下生成方法数量
resPrefix = "yljy_" //生成的layout、drawable、string等资源名前缀
drawableCount = 150 //生成drawable资源数量
stringCount = 410 //生成string数量 该如何解决这个问题,或者这么调参数,谢谢
项目中存在多个productFlavors和buildTypes,对于manifestPlaceholders,要求不同的flavor使用不同appKey,同一个flavor的不同bulidType也要使用不同的appKey
在实现上述配置后,加入junk库编译不通过,错误原因是:Manifest merger failed
我的配置如下(加上了print打印):
android {
productFlavors {
flavorA {
println 'zjyzjy 1.productFlavors'
}
flavorB {
}
//此处配置flavorADebug, flavorARelease, flavorBDebug, flavorBRelease分别使用不同的appKey
productFlavors.all { flavor ->
applicationVariants.all { variant ->
def mergedFlavor = variant.mergedFlavor
switch (variant.flavorName) {
case "flavorA":
switch (variant.buildType.name) {
case "debug":
mergedFlavor.manifestPlaceholders += [appKey: "1111"]
break
case "release":
mergedFlavor.manifestPlaceholders.replace("appKey", "2222")
println 'zjyzjy 4.productFlavors.all'
break
}
break
//case "flavorA" 省略
}
}
}
}
buildTypes {
debug {
}
release {
println 'zjyzjy 2.buildTypes: '
}
}
}
androidJunkCode {
//...省略代码
variantConfig {
println 'zjyzjy 3.androidJunkCode: '
kaituanRelease config
}
}
print打印如下
zjyzjy 1.productFlavors
zjyzjy 2.buildTypes:
zjyzjy 3.androidJunkCode: //这时可能触发了manifest合并导致编译失败
zjyzjy 4.productFlavors.all: //这里才开始根据flavor和buildType添加appkey
zjyzjy 4.productFlavors.all:
报错如下
Task :app:processFlavorAReleaseMainManifest FAILED
E:\xxx\xxx\xxx\app\src\main\AndroidManifest.xml:464:13-43 Error:
Attribute meta-data#appKey@value at AndroidManifest.xml:464:13-43 requires a placeholder substitution but no value for is provided.
E:\xxx\xxx\xxx\app\build\generated\source\junk\FlavorARelease\AndroidManifest.xml Error:
Validation failed, exiting
gradle版本6.1.1,按照readme配置后,build apk,在build目录没有看到垃圾代码。
生成的类除了类名和方法名,内容基本都一致呀,这样不是更增加了相似度
大佬最近有碰到嘛
packageCount = 200
activityCountPerPackage = 10
excludeActivityJavaFile = false
otherCountPerPackage = 100
methodCountPerClass = 100
drawableCount = 500
stringCount = 500
这是我的配置,生成的垃圾代码很多了
但oppo那边还是显示因您的APP与“xxxx”存在套用马甲的嫌疑(经检测APK相似度0.97155,最高为1),现对您的应用C级上架,请对应用充分自主改动创新,完全跳出模板后再上传;感谢您的支持与配合。如有疑问,可咨询OPPO开放平台客服。
大师你好,请问一下,如何用这个库实现批量替换类名、资源名以及资源图片名称;最简单的就是在原有名称上加前缀或后缀;项目文件太多,如果一个一个refactor-rename的话,太慢了而且工作量很大。谢谢!
#cn.hx.plugin.ui为前面配置的packageBase
-keep class cn.hx.plugin.ui.** {*;}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.