给出官方的文档和接入方案
https://bugly.qq.com/docs/user-guide/instruction-manual-android-hotfix/?v=20161219153020
https://bugly.qq.com/docs/user-guide/instruction-manual-android-hotfix-demo/
下面是我个人的接入步骤(基于studio):
1.新创建一个工程,这就不应多说了,每个人都会。
2.创建好工程后,开始配置:
1).
2).
app的build.gradle中的配置代码:
apply plugin: 'com.android.application'
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
// 多dex配置
compile 'com.android.support:multidex:1.0.1'
// 集成Bugly热更新aar(灰度时使用方式)
// compile(name: 'bugly_crashreport_upgrade-1.2.0', ext: 'aar')
compile 'com.tencent.bugly:crashreport_upgrade:latest.release'
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
// 编译选项
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
// recommend
dexOptions {
jumboMode = true
}
// 签名配置
signingConfigs {
release {
try {
storeFile file("./keystore/release.jks")
storePassword "testres"
keyAlias "testres"
keyPassword "testres"
} catch (ex) {
throw new InvalidUserDataException(ex.toString())
}
keyAlias 'fly'
keyPassword '000000'
storeFile file('C:/Users/John/Desktop/release.jks')
storePassword '000000'
}
debug {
storeFile file('C:/Users/John/Desktop/debug.jks')
keyAlias 'fly'
keyPassword '000000'
storePassword '000000'
}
}
// 默认配置
defaultConfig {
applicationId "com.tencent.bugly.hotfix"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
// 开启multidex
multiDexEnabled true
// 以Proguard的方式手动加入要放到Main.dex中的类
multiDexKeepProguard file("keep_in_main_dex.txt")
}
// 构建类型
buildTypes {
release {
minifyEnabled true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
signingConfig signingConfigs.debug
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
repositories {
flatDir {
dirs 'libs'
}
}
/* productFlavors {
xiaomi {
}
yyb {
}
}*/
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
def gitSha() {
try {
String gitRev = 'git rev-parse --short HEAD'.execute(null, project.rootDir).text.trim()
if (gitRev == null) {
throw new GradleException("can't get git rev, you should add git to system path or just input test value, such as 'testTinkerId'")
}
return gitRev
} catch (Exception e) {
throw new GradleException("can't get git rev, you should add git to system path or just input test value, such as 'testTinkerId'")
}
}
def bakPath = file("${buildDir}/bakApk/")
/**
* you can use assembleRelease to build you base apk
* use tinkerPatchRelease -POLD_APK= -PAPPLY_MAPPING= -PAPPLY_RESOURCE= to build patch
* add apk from the build/bakApk
*/
ext {
// for some reason, you may want to ignore tinkerBuild, such as instant run debug build?
tinkerEnabled = true
// for normal build
// old apk file to build patch apk
tinkerOldApkPath = "${bakPath}/app-release-1223-11-05-19.apk"
// proguard mapping file to build patch apk
tinkerApplyMappingPath = "${bakPath}/app-release-1223-11-05-19-mapping.txt"
// resource R.txt to build patch apk, must input if there is resource changed
tinkerApplyResourcePath = "${bakPath}/app-release-1223-11-05-19-R.txt"
// only use for build all flavor, if not, just ignore this field
tinkerBuildFlavorDirectory = "${bakPath}/app-release-1223-11-05-19"
}
def getOldApkPath() {
return hasProperty("OLD_APK") ? OLD_APK : ext.tinkerOldApkPath
}
def getApplyMappingPath() {
return hasProperty("APPLY_MAPPING") ? APPLY_MAPPING : ext.tinkerApplyMappingPath
}
def getApplyResourceMappingPath() {
return hasProperty("APPLY_RESOURCE") ? APPLY_RESOURCE : ext.tinkerApplyResourcePath
}
def getTinkerIdValue() {
return hasProperty("TINKER_ID") ? TINKER_ID : gitSha()
}
def buildWithTinker() {
return hasProperty("TINKER_ENABLE") ? TINKER_ENABLE : ext.tinkerEnabled
}
def getTinkerBuildFlavorDirectory() {
return ext.tinkerBuildFlavorDirectory
}
/**
* 更多Tinker插件详细的配置,参考:https://github.com/Tencent/tinker/wiki
*/
if (buildWithTinker()) {
apply plugin: 'com.tencent.bugly.tinker-support'
// 依赖tinker插件
apply plugin: 'com.tencent.tinker.patch'
tinkerSupport {
}
// 全局信息相关配置项
tinkerPatch {
oldApk = getOldApkPath() //必选, 基准包路径
ignoreWarning = false // 可选,默认false
useSign = true // 可选,默认true, 验证基准apk和patch签名是否一致
// 编译相关配置项
buildConfig {
applyMapping = getApplyMappingPath() // 可选,设置mapping文件,建议保持旧apk的proguard混淆方式
applyResourceMapping = getApplyResourceMappingPath() // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配
// tinkerId = "flyflfasdfasdfasdfasdf" // 必选,默认为null
// tinkerId = "dsfasdfadfadsssfassssssssdf"
tinkerId = "teemodfadfadsssfassssssssdf"
}
// dex相关配置项
dex {
dexMode = "jar" // 可选,默认为jar
usePreGeneratedPatchDex = false // 可选,默认为false
pattern = ["classes*.dex",
"assets/secondary-dex-?.jar"]
// 必选
loader = ["com.tencent.tinker.loader.*",
"com.example.teemo.fixapplication.SampleApplication",
]
}
// lib相关的配置项
lib {
pattern = ["lib/armeabi/*.so"]
}
// res相关的配置项
res {
pattern = ["res/*", "assets/*", "resources.arsc", "AndroidManifest.xml"]
ignoreChange = ["assets/sample_meta.txt"]
largeModSize = 100
}
// 用于生成补丁包中的'package_meta.txt'文件
packageConfig {
configField("patchMessage", "tinker is sample to use")
configField("platform", "all")
configField("patchVersion", "1.0")
}
// 7zip路径配置项,执行前提是useSign为true
sevenZip {
zipArtifact = "com.tencent.mm:SevenZip:1.1.10" // optional
// path = "/usr/local/bin/7za" // optional
}
// 如果只用我们提供的插件,可以进行以下配置
/* apply plugin: 'com.tencent.bugly.tinker-support'
tinkerSupport {
// 开启tinker-support插件,默认值true
enable = true
// 是否编译完成后,归档apk到指定目录,默认值false
autoBackupApk = false
// 指定归档目录,默认值当前module的子目录tinker
// backupApkDir = 'tinker'
// 是否启用覆盖tinkerPatch配置功能,默认值false
// 开启后tinkerPatch配置不生效,即无需添加tinkerPatch
overrideTinkerPatchConfiguration = true
// 编译补丁包时,必需指定基线版本的apk,默认值为空
// 如果为空,则表示不是进行补丁包的编译
// @{link tinkerPatch.oldApk }
baseApk = getOldApkPath()
// 对应tinker插件applyMapping
baseApkProguardMapping = getApplyMappingPath()
// 对应tinker插件applyResourceMapping
baseApkResourceMapping = getApplyResourceMappingPath()
tinkerId = "aaaaafasdfasdfasdfasdf"
}*/
}
}
List<String> flavors = new ArrayList<>();
project.android.productFlavors.each { flavor ->
flavors.add(flavor.name)
}
boolean hasFlavors = flavors.size() > 0
/**
* bak apk and mapping
*/
android.applicationVariants.all { variant ->
/**
* task type, you want to bak
*/
def taskName = variant.name
def date = new Date().format("MMdd-HH-mm-ss")
tasks.all {
if ("assemble${taskName.capitalize()}".equalsIgnoreCase(it.name)) {
it.doLast {
copy {
def fileNamePrefix = "${project.name}-${variant.baseName}"
def newFileNamePrefix = hasFlavors ? "${fileNamePrefix}" : "${fileNamePrefix}-${date}"
def destPath = hasFlavors ? file("${bakPath}/${project.name}-${date}/${variant.flavorName}") : bakPath
from variant.outputs.outputFile
into destPath
rename { String fileName ->
fileName.replace("${fileNamePrefix}.apk", "${newFileNamePrefix}.apk")
}
from "${buildDir}/outputs/mapping/${variant.dirName}/mapping.txt"
into destPath
rename { String fileName ->
fileName.replace("mapping.txt", "${newFileNamePrefix}-mapping.txt")
}
from "${buildDir}/intermediates/symbols/${variant.dirName}/R.txt"
into destPath
rename { String fileName ->
fileName.replace("R.txt", "${newFileNamePrefix}-R.txt")
}
}
}
}
}
}
project.afterEvaluate {
//sample use for build all flavor for one time
if (hasFlavors) {
task(tinkerPatchAllFlavorRelease) {
group = 'tinker'
def originOldPath = getTinkerBuildFlavorDirectory()
for (String flavor : flavors) {
def tinkerTask = tasks.getByName("tinkerPatch${flavor.capitalize()}Release")
dependsOn tinkerTask
def preAssembleTask = tasks.getByName("process${flavor.capitalize()}ReleaseManifest")
preAssembleTask.doFirst {
String flavorName = preAssembleTask.name.substring(7, 8).toLowerCase() + preAssembleTask.name.substring(8, preAssembleTask.name.length() - 15)
project.tinkerPatch.oldApk = "${originOldPath}/${flavorName}/${project.name}-${flavorName}-release.apk"
project.tinkerPatch.buildConfig.applyMapping = "${originOldPath}/${flavorName}/${project.name}-${flavorName}-release-mapping.txt"
project.tinkerPatch.buildConfig.applyResourceMapping = "${originOldPath}/${flavorName}/${project.name}-${flavorName}-release-R.txt"
}
}
}
task(tinkerPatchAllFlavorDebug) {
group = 'tinker'
def originOldPath = getTinkerBuildFlavorDirectory()
for (String flavor : flavors) {
def tinkerTask = tasks.getByName("tinkerPatch${flavor.capitalize()}Debug")
dependsOn tinkerTask
def preAssembleTask = tasks.getByName("process${flavor.capitalize()}DebugManifest")
preAssembleTask.doFirst {
String flavorName = preAssembleTask.name.substring(7, 8).toLowerCase() + preAssembleTask.name.substring(8, preAssembleTask.name.length() - 13)
project.tinkerPatch.oldApk = "${originOldPath}/${flavorName}/${project.name}-${flavorName}-debug.apk"
project.tinkerPatch.buildConfig.applyMapping = "${originOldPath}/${flavorName}/${project.name}-${flavorName}-debug-mapping.txt"
project.tinkerPatch.buildConfig.applyResourceMapping = "${originOldPath}/${flavorName}/${project.name}-${flavorName}-debug-R.txt"
}
}
}
}
}
app的build.gradle中的配置代码里面需要注意的问题:
1.签名配置问题
如何在studio中配置签名
2.版本问题
3.路径问题
4.tinkerId问题;
3.在app下面添加文件
4.配置清单文件:
5.代码类
到这里准备工作已就绪,接下来就是具体操作了:
第一:运行一遍app把版本号和tinkerId传递到网络(腾讯)
出现下面这说明成功了。
第二:把项目clean
第三:生成基线包;
双击选中的,这个会在build/outputs/bakApk路径下生成每次编译的基准包、混淆配置文件、资源Id文件,如下图所示
第四,对基线版本的bug修复
第五、修改待修复apk路径、mapping文件路径、resId文件路径
第六,这时候注意了,官方没有说明的一点,到这一步了,要去修改tinkerId了。如下图:
第七,运行生成补丁包
如果你要生成不同编译环境的补丁包,只需要执行Tinker插件生成的task,比如tinkerPatchRelease就能生成release编译环境的补丁包。
生成的补丁包在build/outputs/patch目录下:
到这里操作工作完成了。
下面是上传补丁包了:
点击发布新补丁,上传前面生成的patch包,我们平台会自动为你匹配到目标版本,你可以选择下发范围(开发设备、全量设备、自定义),填写完备注之后,点击立即下发让补丁生效,这样你就可以在客户端当中收到我们的策略,SDK会自动帮你把补丁包下到本地。
好,到这里就结束了。后续请回去看官方文档。
接下来的是合并失败的日志:
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix W/CrashReport: Bugly debug模式开启,请在发布时把isDebug关闭。 -- Running in debug model for 'isDebug' is enabled. Please disable it when you release.
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix E/CrashReport: --------------------------------------------------------------------------------------------
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix W/CrashReport: Bugly debug模式将有以下行为特性 -- The following list shows the behaviour of debug model:
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix W/CrashReport: [1] 输出详细的Bugly SDK的Log -- More detailed log of Bugly SDK will be output to logcat;
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix W/CrashReport: [2] 每一条Crash都会被立即上报 -- Every crash caught by Bugly will be uploaded immediately.
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix W/CrashReport: [3] 自定义日志将会在Logcat中输出 -- Custom log will be output to logcat.
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix E/CrashReport: --------------------------------------------------------------------------------------------
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix I/CrashReportInfo: [init] Open debug mode of Bugly.
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [init] Bugly version: v2.4.0
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix I/CrashReport: crash report start initializing...
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix I/CrashReportInfo: [init] Bugly start initializing...
12-23 13:50:35.539 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [init] Bugly complete version: v2.4.0(1.2.1)
12-23 13:50:35.542 22463-22463/com.tencent.bugly.hotfix D/CrashReport: com info create end
12-23 13:50:35.549 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [param] Set APP ID:f90d9a5a70
12-23 13:50:35.556 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 0ms) task: com.tencent.bugly.crashreport.biz.a$a
12-23 13:50:35.556 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [session] launch app, new start
12-23 13:50:35.558 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 36569444ms) task: com.tencent.bugly.crashreport.biz.a$b
12-23 13:50:35.560 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 21600000ms) task: com.tencent.bugly.crashreport.biz.a$c
12-23 13:50:35.562 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ah$2
12-23 13:50:35.562 22463-22463/com.tencent.bugly.hotfix I/CrashReport: Initializing crash module.
12-23 13:50:35.563 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ah$1
12-23 13:50:35.564 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [UserInfo] Record user info.
12-23 13:50:35.567 22463-22463/com.tencent.bugly.hotfix I/CrashReport: backup java handler: com.tencent.bugly.beta.tinker.TinkerUncaughtExceptionHandler@4182a228
12-23 13:50:35.567 22463-22463/com.tencent.bugly.hotfix I/CrashReport: registered java monitor: com.tencent.bugly.crashreport.crash.e@41856710
12-23 13:50:35.567 22463-22463/com.tencent.bugly.hotfix I/CrashReport: user change native true
12-23 13:50:35.567 22463-22463/com.tencent.bugly.hotfix I/CrashReport: native changed to true
12-23 13:50:35.568 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [Native] Trying to load so: Bugly
12-23 13:50:35.569 22463-22463/com.tencent.bugly.hotfix W/CrashReport: Couldn't load Bugly: findLibrary returned null
12-23 13:50:35.569 22463-22463/com.tencent.bugly.hotfix W/CrashReport: [Native] Failed to load so: Bugly
12-23 13:50:35.569 22463-22463/com.tencent.bugly.hotfix I/CrashReport: anr changed to true
12-23 13:50:35.575 22463-22463/com.tencent.bugly.hotfix I/CrashReport: start anr monitor!
12-23 13:50:35.575 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.crashreport.crash.anr.b$2
12-23 13:50:35.576 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.crashreport.crash.d$1
12-23 13:50:35.576 22463-22463/com.tencent.bugly.hotfix D/CrashReport: add action android.net.conn.CONNECTIVITY_CHANGE
12-23 13:50:35.576 22463-22463/com.tencent.bugly.hotfix I/CrashReport: regis BC
12-23 13:50:35.669 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [ExtraCrashManager] Trying to notify Bugly agents.
12-23 13:50:35.669 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [ExtraCrashManager] Bugly game agent has been notified.
12-23 13:50:35.707 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ah$1
12-23 13:50:35.707 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ah$2
12-23 13:50:35.708 22463-22463/com.tencent.bugly.hotfix I/CrashReport: Beta init start....
12-23 13:50:35.708 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ah$1
12-23 13:50:35.708 22463-22463/com.tencent.bugly.hotfix I/CrashReport: Beta will init at: com.tencent.bugly.hotfix
12-23 13:50:35.708 22463-22463/com.tencent.bugly.hotfix I/CrashReport: current process: com.tencent.bugly.hotfix
12-23 13:50:35.710 22463-22463/com.tencent.bugly.hotfix I/CrashReport: current upgrade sdk version:1.2.1
12-23 13:50:35.710 22463-22463/com.tencent.bugly.hotfix I/CrashReport: setted upgradeCheckPeriod: 0
12-23 13:50:35.710 22463-22463/com.tencent.bugly.hotfix I/CrashReport: setted initDelay: 3000
12-23 13:50:35.711 22463-22463/com.tencent.bugly.hotfix I/CrashReport: autoCheckUpgrade is opened
12-23 13:50:35.711 22463-22463/com.tencent.bugly.hotfix I/CrashReport: showInterruptedStrategy is opened
12-23 13:50:35.711 22463-22463/com.tencent.bugly.hotfix I/CrashReport: isDIY is closed
12-23 13:50:35.718 22463-22463/com.tencent.bugly.hotfix I/CrashReport: apkSaveDir: /storage/sdcard0/Download/com.tencent.bugly.hotfix/.beta/apk, resSaveDir: /storage/sdcard0/Download/com.tencent.bugly.hotfix/.beta/res
12-23 13:50:35.732 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success.
12-23 13:50:35.733 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success with ID: 28
12-23 13:50:35.742 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [patch] inject failure
12-23 13:50:35.849 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [Database] insert ge_1002 success.
12-23 13:50:35.849 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [patch] delete patch.apk success
12-23 13:50:35.849 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [patch] delete tmpPatch.apk success
12-23 13:50:35.851 22463-22463/com.tencent.bugly.hotfix I/CrashReport: TINKER_ID:teemodfadfadsssfassssssssdf
12-23 13:50:35.851 22463-22463/com.tencent.bugly.hotfix I/CrashReport: NEW_TINKER_ID:
12-23 13:50:35.853 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 3000ms) task: com.tencent.bugly.beta.global.d
12-23 13:50:35.853 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ah$1
12-23 13:50:35.853 22463-22463/com.tencent.bugly.hotfix I/CrashReport: Beta init finished...
12-23 13:50:35.854 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 0ms) task: com.tencent.bugly.crashreport.common.strategy.a$1
12-23 13:50:35.854 22463-22463/com.tencent.bugly.hotfix I/CrashReportInfo: [init] Bugly initialization finished.
12-23 13:50:35.867 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [Strategy] Notify com.tencent.bugly.crashreport.biz.b
12-23 13:50:35.869 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.crashreport.biz.a$2
12-23 13:50:35.870 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [Strategy] Notify com.tencent.bugly.CrashModule
12-23 13:50:35.870 22463-22504/com.tencent.bugly.hotfix W/CrashReport: server native changed to true
12-23 13:50:35.870 22463-22504/com.tencent.bugly.hotfix I/CrashReport: native changed to true
12-23 13:50:35.870 22463-22504/com.tencent.bugly.hotfix I/CrashReport: [Native] Trying to load so: Bugly
12-23 13:50:35.871 22463-22505/com.tencent.bugly.hotfix D/CrashReport: Uploading frequency will not be checked if SDK is in debug mode.
12-23 13:50:35.871 22463-22504/com.tencent.bugly.hotfix W/CrashReport: Couldn't load Bugly: findLibrary returned null
12-23 13:50:35.871 22463-22504/com.tencent.bugly.hotfix W/CrashReport: [Native] Failed to load so: Bugly
12-23 13:50:35.872 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 0ms) task: com.tencent.bugly.crashreport.crash.c$2
12-23 13:50:35.872 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [Strategy] Notify com.tencent.bugly.beta.Beta
12-23 13:50:35.872 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [Util] try to lock file:local_crash_lock (pid=22463 | tid=22504)
12-23 13:50:35.873 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [Util] successfully locked file:local_crash_lock (pid=22463 | tid=22504)
12-23 13:50:35.891 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [Util] try to unlock file:local_crash_lock (pid=22463 | tid=22504)
12-23 13:50:35.893 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [Util] successfully unlocked file:local_crash_lock (pid=22463 | tid=22504)
12-23 13:50:35.908 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UserInfo] Upload user info(size: 2)
12-23 13:50:35.939 22463-22505/com.tencent.bugly.hotfix D/CrashReport: summary type 3 vm:8
12-23 13:50:35.940 22463-22505/com.tencent.bugly.hotfix D/CrashReport: summary type 1 vm:7
12-23 13:50:35.956 22463-22463/com.tencent.bugly.hotfix D/CrashReport: >>> com.example.teemo.fixapplication.MainActivity onCreated <<<
12-23 13:50:35.969 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [au] Successfully get 'getprop' list.
12-23 13:50:35.987 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [au] System properties number: 303ffffdsfsdfff.
12-23 13:50:36.008 22463-22505/com.tencent.bugly.hotfix D/CrashReport: su not found
12-23 13:50:36.029 22463-22505/com.tencent.bugly.hotfix I/CrashReport: rom:Huawei/G520-5000/hwG520-5000:4.1.2/HuaweiG520-5000/C01B316:user/ota-rel-keys,release-keys/fail
12-23 13:50:36.041 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Add upload task (pid=22463 | tid=22505)
12-23 13:50:36.042 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Initialize security context now (pid=22463 | tid=22505)
12-23 13:50:36.042 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Add upload task to queue (pid=22463 | tid=22505)
12-23 13:50:36.042 22463-22505/com.tencent.bugly.hotfix I/CrashReport: [UploadManager] Create and start a new thread to execute a task of initializing security context: BUGLY_ASYNC_UPLOAD
12-23 13:50:36.043 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [Util] try to lock file:security_info (pid=22463 | tid=22526)
12-23 13:50:36.044 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [Util] successfully locked file:security_info (pid=22463 | tid=22526)
12-23 13:50:36.044 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Load security info from database (pid=22463 | tid=22526)
12-23 13:50:36.046 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Sucessfully got session ID, try to execute upload tasks now (pid=22463 | tid=22526)
12-23 13:50:36.047 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Try to poll all upload task need and put them into temp queue (pid=22463 | tid=22526)
12-23 13:50:36.047 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Execute urgent upload tasks of queue which has 1 tasks (pid=22463 | tid=22526)
12-23 13:50:36.047 22463-22526/com.tencent.bugly.hotfix I/CrashReport: [UploadManager] Create and start a new thread to execute a upload task: BUGLY_ASYNC_UPLOAD
12-23 13:50:36.048 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ap$2
12-23 13:50:36.048 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [Util] try to unlock file:security_info (pid=22463 | tid=22526)
12-23 13:50:36.049 22463-22526/com.tencent.bugly.hotfix D/CrashReport: [Util] successfully unlocked file:security_info (pid=22463 | tid=22526)
12-23 13:50:36.051 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Local network consume: 27 KB
12-23 13:50:36.051 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Upload] Run upload task with cmd: 840
12-23 13:50:36.052 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Integrate security to HTTP headers (pid=22463 | tid=22527)
12-23 13:50:36.052 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Util] Zip 1794 bytes data with type Gzip
12-23 13:50:36.082 22463-22463/com.tencent.bugly.hotfix D/CrashReport: >>> com.example.teemo.fixapplication.MainActivity onResumed <<<
12-23 13:50:36.083 22463-22463/com.tencent.bugly.hotfix I/CrashReport: [session] launch app one times (app in background 1482472236 seconds and over 30 seconds)
12-23 13:50:36.083 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 0ms) task: com.tencent.bugly.crashreport.biz.a$a
12-23 13:50:36.083 22463-22463/com.tencent.bugly.hotfix I/CrashReport: add a timer to upload hot start user info
12-23 13:50:36.083 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a delay(time: 300000ms) task: com.tencent.bugly.crashreport.biz.a$a
12-23 13:50:36.084 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UserInfo] Record user info.
12-23 13:50:36.143 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] deleted t_lr data 1
12-23 13:50:36.190 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_lr success.
12-23 13:50:36.192 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Uploading(ID:1001) time: 2016-12-23 13:50:36
12-23 13:50:36.193 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Upload] Send 1096 bytes
12-23 13:50:36.195 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Upload] Upload to http://android.bugly.qq.com/rqd/async?aid=72085a72-971c-457e-a7bd-58fcc4405b84 with cmd 840 (pid=22463 | tid=22527).
12-23 13:50:36.195 22463-22527/com.tencent.bugly.hotfix D/CrashReport: request: http://android.bugly.qq.com/rqd/async?aid=72085a72-971c-457e-a7bd-58fcc4405b84, send: 1096 (pid=22463 | tid=22527)
12-23 13:50:36.270 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success.
12-23 13:50:36.270 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success with ID: 29
12-23 13:50:36.275 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Upload] Bugly version from headers is: bugly/1.0
12-23 13:50:36.276 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Upload] Status from server is 0 (pid=22463 | tid=22527).
12-23 13:50:36.276 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Upload] Received 146 bytes
12-23 13:50:36.280 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Util] Unzip 130 bytes data with type Gzip
12-23 13:50:36.280 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Upload] Response cmd is: 0, length of sBuffer is: 0
12-23 13:50:36.281 22463-22527/com.tencent.bugly.hotfix I/CrashReport: [Upload] Success: userinfo
12-23 13:50:36.282 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Local network consume: 27 KB
12-23 13:50:36.364 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] deleted t_lr data 1
12-23 13:50:36.656 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_lr success.
12-23 13:50:36.656 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Network total consume: 28 KB
12-23 13:50:36.656 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [UserInfo] Successfully uploaded user info.
12-23 13:50:36.685 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success.
12-23 13:50:36.685 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success with ID: 26
12-23 13:50:36.711 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success.
12-23 13:50:36.711 22463-22527/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_ui success with ID: 28
12-23 13:50:38.853 22463-22504/com.tencent.bugly.hotfix I/CrashReport: Beta async init start...
12-23 13:50:38.904 22463-22504/com.tencent.bugly.hotfix I/CrashReport: [this md5:C56980285760110666E6050B024420C7] [strategy md5:5f5d94edcf6f1702e378d3969c84147d221f86de]
12-23 13:50:38.905 22463-22463/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.beta.download.BetaReceiver$1
12-23 13:50:38.936 22463-22504/com.tencent.bugly.hotfix I/CrashReport: [cmd:804][md5:C56980285760110666E6050B024420C7][verName:1.0][verCode:1][deviceid:868232003814563|null|2791555990b59359][apkBuild:teemodfadfadsssfassssssssdf][patchBuild:][patchVersion:1]
12-23 13:50:38.936 22463-22504/com.tencent.bugly.hotfix D/CrashReport: current app version is: [1.0.1], base tinkerId:[teemodfadfadsssfassssssssdf], patch tinkerId:[]
12-23 13:50:38.940 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Add upload task (pid=22463 | tid=22504)
12-23 13:50:38.940 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Sucessfully got session ID, try to execute upload task now (pid=22463 | tid=22504)
12-23 13:50:38.940 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Add upload task to queue (pid=22463 | tid=22504)
12-23 13:50:38.940 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Try to poll all upload task need and put them into temp queue (pid=22463 | tid=22504)
12-23 13:50:38.940 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Execute upload tasks of queue which has 1 tasks (pid=22463 | tid=22504)
12-23 13:50:38.945 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ap$2
12-23 13:50:38.952 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Local network consume: 28 KB
12-23 13:50:38.952 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Upload] Run upload task with cmd: 804
12-23 13:50:38.952 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Integrate security to HTTP headers (pid=22463 | tid=22503)
12-23 13:50:38.953 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Util] Zip 1168 bytes data with type Gzip
12-23 13:50:38.975 22463-22504/com.tencent.bugly.hotfix I/CrashReport: [cmd:803][md5:C56980285760110666E6050B024420C7][verName:1.0][verCode:1][deviceid:868232003814563|null|2791555990b59359][apkBuild:teemodfadfadsssfassssssssdf][patchBuild:][patchVersion:1]
12-23 13:50:38.976 22463-22504/com.tencent.bugly.hotfix D/CrashReport: current app version is: [1.0.1], base tinkerId:[teemodfadfadsssfassssssssdf], patch tinkerId:[]
12-23 13:50:38.981 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Add upload task (pid=22463 | tid=22504)
12-23 13:50:38.981 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Sucessfully got session ID, try to execute upload task now (pid=22463 | tid=22504)
12-23 13:50:38.982 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Add upload task to queue (pid=22463 | tid=22504)
12-23 13:50:38.982 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Try to poll all upload task need and put them into temp queue (pid=22463 | tid=22504)
12-23 13:50:38.982 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Execute upload tasks of queue which has 1 tasks (pid=22463 | tid=22504)
12-23 13:50:38.983 22463-22504/com.tencent.bugly.hotfix D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.proguard.ap$2
12-23 13:50:38.984 22463-22504/com.tencent.bugly.hotfix I/CrashReport: Beta async init end...
12-23 13:50:39.005 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Database] deleted t_lr data 1
12-23 13:50:39.006 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Local network consume: 28 KB
12-23 13:50:39.007 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Upload] Run upload task with cmd: 803
12-23 13:50:39.007 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Integrate security to HTTP headers (pid=22463 | tid=22505)
12-23 13:50:39.007 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Util] Zip 1177 bytes data with type Gzip
12-23 13:50:39.067 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_lr success.
12-23 13:50:39.069 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Uploading(ID:1002) time: 2016-12-23 13:50:38
12-23 13:50:39.070 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Upload] Send 846 bytes
12-23 13:50:39.072 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Upload] Upload to http://android.bugly.qq.com/rqd/async?aid=05f81dcc-ad12-4be3-a09b-9ae13d25a1d6 with cmd 804 (pid=22463 | tid=22503).
12-23 13:50:39.073 22463-22503/com.tencent.bugly.hotfix D/CrashReport: request: http://android.bugly.qq.com/rqd/async?aid=05f81dcc-ad12-4be3-a09b-9ae13d25a1d6, send: 846 (pid=22463 | tid=22503)
12-23 13:50:39.120 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Database] deleted t_lr data 1
12-23 13:50:39.144 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_lr success.
12-23 13:50:39.145 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Uploading(ID:1002) time: 2016-12-23 13:50:39
12-23 13:50:39.146 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Upload] Send 854 bytes
12-23 13:50:39.147 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Upload] Upload to http://android.bugly.qq.com/rqd/async?aid=81ad6026-cc69-4662-b990-f6c8a7072ad9 with cmd 803 (pid=22463 | tid=22505).
12-23 13:50:39.147 22463-22505/com.tencent.bugly.hotfix D/CrashReport: request: http://android.bugly.qq.com/rqd/async?aid=81ad6026-cc69-4662-b990-f6c8a7072ad9, send: 854 (pid=22463 | tid=22505)
12-23 13:50:39.156 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Upload] Bugly version from headers is: bugly/1.0
12-23 13:50:39.156 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Upload] Status from server is 0 (pid=22463 | tid=22503).
12-23 13:50:39.156 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Upload] Received 359 bytes
12-23 13:50:39.161 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Util] Unzip 343 bytes data with type Gzip
12-23 13:50:39.168 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Upload] Response cmd is: 804, length of sBuffer is: 293
12-23 13:50:39.168 22463-22503/com.tencent.bugly.hotfix I/CrashReport: [Upload] Success: 804
12-23 13:50:39.169 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Local network consume: 28 KB
12-23 13:50:39.196 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Database] deleted t_lr data 1
12-23 13:50:39.220 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_lr success.
12-23 13:50:39.220 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Network total consume: 30 KB
12-23 13:50:39.221 22463-22503/com.tencent.bugly.hotfix I/CrashReport: upload succ:[804] [sended 846] [recevied 359]
12-23 13:50:39.232 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Upload] Bugly version from headers is: bugly/1.0
12-23 13:50:39.247 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Upload] Status from server is 0 (pid=22463 | tid=22505).
12-23 13:50:39.248 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Upload] Received 129 bytes
12-23 13:50:39.264 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Util] Unzip 113 bytes data with type Gzip
12-23 13:50:39.271 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Upload] Response cmd is: 0, length of sBuffer is: 0
12-23 13:50:39.272 22463-22505/com.tencent.bugly.hotfix I/CrashReport: [Upload] Success: 803
12-23 13:50:39.283 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Local network consume: 30 KB
12-23 13:50:39.317 22463-22503/com.tencent.bugly.hotfix D/CrashReport: [Database] insert st_1002 success.
12-23 13:50:39.319 22463-22503/com.tencent.bugly.hotfix I/CrashReport: onUpgradeReceived: title:
newFeature:
publishTime: 0
publishType: 0
appBasicInfo: {
appId: f90d9a5a70
platformId: 1
versionCode: 0
versionName: null
buildNo: 0
iconUrl: null
apkId: 0
channelId: null
md5: 5f5d94edcf6f1702e378d3969c84147d221f86de
sdkVer:
bundleId: null
}
apkBaseInfo: { 下面是补丁信息
apkMd5: 5f5d94edcf6f1702e378d3969c84147d221f86de
apkUrl: https://s.beta.gtimg.com/rdmimg/hot_patch/f90d9a5a70/572d72f2-df4f-46b9-be6f-c95114a04cb5.zip
manifestMd5:
fileSize: 3714
signatureMd5:
}
updateStrategy: 0
popTimes: 0
popInterval: 0
diffApkInfo: {
null}
netType: null
reserved: 2, {
(
H2
1
)
(
H1
false
)
}
strategyId: 70d5149d-3d3b-4a36-9f7a-1f7845ec7985
status: 1
updateTime: 1482471286000
updateType: 3
[type: 3]
12-23 13:50:39.366 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Database] deleted t_lr data 1
12-23 13:50:39.390 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [Database] insert t_lr success.
12-23 13:50:39.390 22463-22505/com.tencent.bugly.hotfix D/CrashReport: [UploadManager] Network total consume: 30 KB
12-23 13:50:39.392 22463-22503/com.tencent.bugly.hotfix W/CrashReport: task start com.tencent.bugly.proguard.t
12-23 13:50:39.394 22463-22505/com.tencent.bugly.hotfix I/CrashReport: upload succ:[803] [sended 854] [recevied 129]
12-23 13:50:39.572 22463-22592/com.tencent.bugly.hotfix I/CrashReport: checkServerTrusted
12-23 13:50:39.961 22463-22592/com.tencent.bugly.hotfix D/CrashReport: [Database] insert dl_1002 success.
12-23 13:50:40.024 22463-22592/com.tencent.bugly.hotfix D/CrashReport: [Database] insert dl_1002 success.
12-23 13:50:40.092 22463-22592/com.tencent.bugly.hotfix D/CrashReport: [Database] insert dl_1002 success.
12-23 13:50:40.092 22463-22463/com.tencent.bugly.hotfix I/CrashReport: patch download success !!! 补丁包下载成功
12-23 13:50:40.230 22463-22463/com.tencent.bugly.hotfix E/CrashReport: Tinker report code:2
12-23 13:50:40.230 22463-22463/com.tencent.bugly.hotfix E/CrashReport: Tinker report code:71
12-23 13:50:40.230 22463-22463/com.tencent.bugly.hotfix E/CrashReport: Tinker report code:3
12-23 13:50:40.421 22463-22638/com.tencent.bugly.hotfix I/CrashReport: Tinker patch failure, result:
PatchResult:
isUpgradePatch:true
isSuccess:false 合成失败 打印出true就是成功的意思
rawPatchFilePath:/data/data/com.tencent.bugly.hotfix/app_tmpPatch/tmpPatch.apk
costTime:39
上面这个问题是由于debug和线上的情况不一致出现的。
要用同一个路径下面的包去更新。如下图:
再来一个bug:
造成这种原因是由于tinkerID的问题(基线包和补丁包tinkerID应该不一样)