tencent / vasdolly Goto Github PK
View Code? Open in Web Editor NEWAndroid V1 and V2 Signature Channel Package Plugin
License: Other
Android V1 and V2 Signature Channel Package Plugin
License: Other
Manifest merger failed : Attribute application@allowBackup value=(true) from AndroidManifest.xml:6:9-35
is also present at [com.leon.channel:helper:1.0.2] AndroidManifest.xml:12:9-36 value=(false).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:5:5-19:19 to override.
以前用的Umeng多渠道,一般打包一个包并且签名,在乐固里配置签名,配置多渠道, 比较简单(只需打包 签名 加固一个包)
那么用这个的话打包出很多渠道再挨个去加固吗
根据#2 的提示,我创建了个demo,测试梆梆加固后的apk,用ApkChannelPackage生成渠道包
目前提示如下的结果
Executing task ':app:reBuildChannel' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
baseDebugApk : null , it is not a valid file , so can not rebuild debug channel apk
baseReleaseApk : /Users/xiongxingxing/androidGithubProject/TinkerDemo/app/baseApk/tinkerdemo-base-signed.apk , it is not a valid file , so can not rebuild release channel apk
:app:reBuildChannel (Thread[Task worker,5,main]) completed. Took 0.001 secs.
app下的build.gradle 中的
rebuildChannel {
baseReleaseApk = new File(project.projectDir, "baseApk/tinkerdemo-base-signed.apk")
}
channel.txt文件也配置了,并且有值
比较疑惑,不知道问题出在哪了? 请指教
When releaseOutputDir is already exist in filesystem.
I get the following exception
* What went wrong:
Execution failed for task ':passenger:reBuildChannel'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
If releaseOutputDir doesn't exist, everything works fine.
你好 ,读取channel时出现 java.lang.Exception: zip v1 magic not found 是什么原因造成的?
你好,我想对插件做点修改,在本地测试,一直没有变化,需要修改哪个几地方?
case如下:
经过以上3步之后,会发现,有一个普通包,有多个定制包,有多个加固包,然后我要使用VasDolly构建多渠道,但是VasDolly貌似只能设置一个基础包,不能满足我的需求,请问有什么好的办法解决这个问题吗?
rebuildChannel { //多渠道打包task
// baseDebugApk = 已有Debug APK
baseReleaseApk = new File(project.buildDir, "base-release.apk")
println baseReleaseApk
//默认为new File(project.buildDir, "rebuildChannel/release")
releaseOutputDir = new File(project.buildDir, "release")//Release渠道包输出目录
}
如果 baseApk 没有放在正确的目录,也就是找不到的情况下,gradle仍然提示任务完成
2017/9/6
14:53 Executing tasks: [reBuildChannel]
14:53 Gradle build finished in 1s 981ms
当时我就很奇怪为什么一直找不到完成后的输出,后来看了才发现是把baseApk放到了上一级目录,改回去就好了
由于需要验证渠道包是否成功,但是发现,直接运行的情况下,是没有渠道信息的,需要运行命令打出渠道包,然后在安装一次,才能验证渠道信息。
这样就很麻烦,有没有直接可以验证APK里面渠道信息的?
我看项目的配置,channel文件是每行一个渠道,我现在是有一个渠道名,有一个渠道Code,如何让这个配置在channel文件中?
使我在打包的时候,通过flavorName
拿到我配置的渠道名,String channel = ChannelReaderUtil.getChannel(getApplicationContext());
能拿到我其他的渠道信息
比如channel.txt种有xiaomi,qihu,baidu三个渠道,productFlavors 也有这三个渠道,这种情况下如果执行Gradle命令channelxiaomiDebug只打包xiaomi渠道的,还是会生成xiaomi,qihu,baidu三个渠道包,并且这个三个渠道包在xiaomi的文件夹下。
channel{ //指定渠道文件 channelFile = file("../channel.txt") //多渠道包的输出目录,默认为new File(project.buildDir,"channel") baseOutputDir = new File(project.buildDir,"channel") //多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType} apkNameFormat ='${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}' } rebuildChannel { //指定渠道文件 channelFile = new File("../channel.txt") baseReleaseApk = new File(project.buildDir, "outputs/apk/app-release.apk") //默认为new File(project.buildDir, "rebuildChannel/release") releaseOutputDir = new File(project.buildDir, "rebuildChannel/release") }
上面是我的配置,但是执行rebuildChannel之后只有一个渠道包(rebuildChannel\release目录下只有一个app-release.apk文件)生成,是怎么回事呢?ps:执行channel命令打渠道包是正常的
Is it possible we config the channel.txt in channel's closure:
channel {
channel_file 'channel.txt'
baseOutputDir = new File(project.buildDir,"xxx")
apkNameFormat ='${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}'
}
如题,我现在有渠道信息写在AndroidManifest.xml中,引用的是GRADLE_CHANNEL_VALUE
我该如何通过channel配置将chanel中对应的渠道信息写入${GRADLE_CHANNEL_VALUE}
From what i tested, this is not implemented yet.
使用AndResGuard进行资源混淆后将资源混淆后生成的apk包再打多渠道包会报
not have precise channel package mode 错误。
批量打包后,可以用adb安装,但无法用应用宝安装,提示apk安装包损坏请重新下载安装包
主module中dependencies使用implementation而不使用api会有什么影响吗,毕竟是直接依赖没有间接关系。
用bspatch 做增量更新是否会受影响呢,生成差分包是使用的不带渠道信息的原始包。在合成的时候是否会有问题呢?
日志如下:
find V2 signature block Id : 1896449818
baseApk : C:\Users...\app-release.apk , ChannelPackageMode : V2 Mode
------ File app-release.apk generate v2 channel apk , begin ------
baseApk : C:\Users...\app-release.apk , ApkSectionInfo = mContentEntry : first = java.nio.HeapByteBuffer[pos=0 lim=2572932 cap=2572932] , second = 0 , mSchemeV2Block : first = java.nio.HeapByteBuffer[pos=0 lim=1569 cap=1569] , second = 2572932 , mCentralDir : first = java.nio.HeapByteBuffer[pos=0 lim=43224 cap=43224] , second = 2574501 , mEocd : first = java.nio.HeapByteBuffer[pos=0 lim=22 cap=22] , second = 2617725
generateV2ChannelApk , channel = store_xiaomi , apkChannelName = store_xiaomi-app-release.apk
destApk = C:\Users...\out\store_xiaomi-app-release.apk , channel = store_xiaomi
addIdValueByteBufferMap , idValueMap = {-2012129793=java.nio.HeapByteBuffer[pos=0 lim=12 cap=12]}
find V2 signature block Id : 1896449818
addIdValueByteBufferMap , existentIdValueMap = {1896449818=java.nio.HeapByteBuffer[pos=0 lim=1525 cap=1525]}
addIdValueByteBufferMap , finalIdValueMap = {1896449818=java.nio.HeapByteBuffer[pos=0 lim=1525 cap=1525], -2012129793=java.nio.HeapByteBuffer[pos=0 lim=12 cap=12]}
addIdValueByteBufferMap , oldApkSigningBlock size = 1569 , newApkSigningBlock size = 1593
addIdValueByteBufferMap , after add channel , new apk is C:\Users...\out\store_xiaomi-app-release.apk , length = 2617771
try to read channel info from apk : C:\Users...\out\store_xiaomi-app-release.apk
find V2 signature block Id : 1896449818
getByteBufferValueById , destApk C:\Users...\out\store_xiaomi-app-release.apk IdValueMap = {1896449818=java.nio.HeapByteBuffer[pos=0 lim=1525 cap=1525], -2012129793=java.nio.HeapByteBuffer[pos=0 lim=12 cap=12]}
getByteValueById , id = -2012129793 , value = java.nio.HeapByteBuffer[pos=0 lim=12 cap=12]
generateV2ChannelApk , .\out\store_xiaomi-app-release.apk add channel success
verified : false
generateV2ChannelApk error , please check it and fix it ▒▒and that you should generate all V2 Channel Apk again!
java.lang.RuntimeException: generateV2ChannelApk , after add channel , .\out\store_xiaomi-app-release.apk v1 verify failure
at com.leon.channel.command.Util.generateV2ChannelApk(Util.java:241)
at com.leon.channel.command.Util.writeChannel(Util.java:92)
at com.leon.channel.command.Main.main(Main.java:110)
------ File app-release.apk generate v2 channel apk , end ------
------ total 1 channel apk , cost : 136 ------
rt
1.1.7版本
打包完成后,生成的文件或文件夹没有释放,导致资源无法移动或复制
如题所述
谢谢楼主的付出,以及问题的解答! 感谢🙏
如题
SigningConfig is null , please check it
apply plugin: 'com.android.application'
apply plugin: 'channel'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.marsjiang.myapplicationtest"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
storeFile file("")
storePassword ""
keyAlias ""
keyPassword ""
v1SigningEnabled true
v2SigningEnabled false
}
debug {
storeFile file("")
storePassword ""
keyAlias ""
keyPassword ""
v1SigningEnabled true
v2SigningEnabled false
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
channel{
//指定渠道文件
channelFile = file("../channel.txt")
//多渠道包的输出目录,默认为new File(project.buildDir,"channel")
baseOutputDir = new File(project.buildDir,"channel")
//多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}
apkNameFormat ='${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}'
//快速模式:生成渠道包时不进行校验(速度可以提升10倍以上)
isFastMode = true
}
rebuildChannel {
baseDebugApk = new File(project.projectDir, "baseApk/v1-base-debug.apk")
baseReleaseApk = new File(project.projectDir, "baseApk/v2-base-debug.apk")
//isFastMode = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
api 'com.leon.channel:helper:1.1.7'
}
执行channel目录下的reBuildChannel(3个中任意一个)后,无法删除相关的apk文件了。
提示:java.io.IOException: Cannot delete 'D:\workspace\github_workspace\NewTask\app\baseApk\app-base-release.apk'。
我完成了乐加固,再根据乐加固生成了热修复的多聚到包,但是如果再集成了腾讯的MTA统计,又该怎么配置才能识别各个各个渠道的统计?
WIN7下面打出来的渠道包安装到手机上,应用宝提示安装包损坏,另外打出来的渠道包都不能删除,提示被其他程序占用,mac下面使用这个渠道打包工具没问题
V2.0.0原始的签名包APK(app\build\outputs\apk里面的)资源未释放
1.是否通过grade assembleRelease
命令生成基础包?
2.是否可以配置为grade channelRelease
同时也生成一个基础包出来?以备还可以用命令行打一些不在channels.txt里的渠道
谢谢
我的是2.2.3
能否提供一个脚本,配合乐固加固完然后多渠道打包?
如何结合AndResguard工具一起打包?
能否支持根据渠道包,设置不同的桌面icon和应用名
我现在用的是walle 打的渠道包; 但是渠道包很容易就被修改成另一个渠道;而且已经上线的应用,下载下来渠道也变成了另一个渠道的值; 我想问 vasdolly 的机制和walle 一模一样吗;打出来的包会不会也这么容易就被修改了渠道value
用这种打包方式如何写入除了渠道其他的信息呢,写入的信息是否会被人看见?
看了你的文章介绍,如果有加固需求的话,这种改怎么弄了。
我们的场景如下,首先打出一个未签名的apk,然后使用梆梆加固,加固后添加渠道列表,得到10多个渠道包,然后再签名。这种场景下。怎么使用tinker的热修复呢。也就是我加固后的渠道包,他们的crc应该都不一样了吧。
那个后台统计应该可以看到不同渠道下载量吧?
flavorDimensions "mode"
productFlavors {
aaa {
dimension "mode"
applicationId "com.example.aaa"
signingConfig signingConfigs.aaa
}
bbb{
dimension "mode"
applicationId "com.example.bbb"
signingConfig signingConfigs.bbb
}
ccc{
dimension "mode"
applicationId "com.example.ccc"
signingConfig signingConfigs.ccc
}
}
def getCurrentFlavorName= "${getCurrentFlavorName()}"
apkNameFormat = getCurrentFlavorName + '-${buildType}-V${versionName}-C${versionCode}-${buildTime}-${flavorName}'
import java.util.regex.Matcher
import java.util.regex.Pattern
def getCurrentFlavorName() {
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()
Pattern pattern;
if( tskReqStr.contains( "assemble" ) )
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
else if(tskReqStr.contains( "channel" ))
pattern = Pattern.compile("channel(\\w+)(Release|Debug)")
else
pattern = Pattern.compile("generate(\\w+)(Release|Debug)")
Matcher matcher = pattern.matcher( tskReqStr )
if( matcher.find() )
return matcher.group(1).toLowerCase()
else
{
println "NO MATCH FOUND"
return "";
}
}
def keyValue = [
'appName' : project.name,
'flavorName' : channel, //----------->channelName
'buildType' : mVariant.buildType.name,
'versionName': mVariant.versionName,
'versionCode': mVariant.versionCode,
'appId' : mVariant.applicationId,
'buildTime' : buildTime
'mVariant' : mVariant, // add
'flavorName' : mVariant.name, //add
]
"6C 74 6C 6F 76 75 7A 68是魔数,04 00表示渠道信息长度为4,6C 65 6F 6E就是渠道信息leon了。0E 00就是APK注释长度了,正好是15。"
正好E,14吧
Error:(3, 0) plugin 'com.android.application' must be apply
AAR模块的build.grale 没有 com.android.application,报错
渠道定义在什么地方了?如何与友盟的渠道集成?
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.