Skip to content

Commit

Permalink
1. [hotfix] fix dex check error in some case
Browse files Browse the repository at this point in the history
  • Loading branch information
shwenzhang committed Nov 1, 2016
1 parent ac84abb commit e4b56a3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Tinker
[![license](http://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat)](https://github.com/Tencent/tinker/blob/master/LICENSE)
[![Release Version](https://img.shields.io/badge/release-1.7.2-red.svg)](https://github.com/Tencent/tinker/releases)
[![Release Version](https://img.shields.io/badge/release-1.7.3-red.svg)](https://github.com/Tencent/tinker/releases)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/tinker/pulls)
[![WeChat Approved](https://img.shields.io/badge/Wechat_Approved-1.6.2-red.svg)](https://github.com/Tencent/tinker/wiki)

Expand All @@ -14,7 +14,7 @@ Add tinker-gradle-plugin as a dependency in your main `build.gradle` in the root
```gradle
buildscript {
dependencies {
classpath ('com.tencent.tinker:tinker-patch-gradle-plugin:1.7.2')
classpath ('com.tencent.tinker:tinker-patch-gradle-plugin:1.7.3')
}
}
```
Expand All @@ -24,9 +24,9 @@ Then you need to "apply" the plugin and add dependencies by adding the following
```gradle
dependencies {
//optional, help to generate the final application
provided('com.tencent.tinker:tinker-android-anno:1.7.2')
provided('com.tencent.tinker:tinker-android-anno:1.7.3')
//tinker's main Android lib
compile('com.tencent.tinker:tinker-android-lib:1.7.2')
compile('com.tencent.tinker:tinker-android-lib:1.7.3')
}
...
...
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
VERSION_NAME_PREFIX=1.7.2
VERSION_NAME_PREFIX=1.7.3
VERSION_NAME_SUFFIX=
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ private static boolean extractDexDiffInternals(Context context, String dir, Stri
String dexDiffMd5 = info.dexDiffMd5;
String oldDexCrc = info.oldDexCrC;

if (dexDiffMd5.equals("0") && !ShareTinkerInternals.isVmArt()) {
TinkerLog.w(TAG, "patch dex %s is only for art, just continue", patchRealPath);
continue;
}
String extractedFileMd5 = ShareTinkerInternals.isVmArt() ? info.destMd5InArt : info.destMd5InDvm;

if (!SharePatchFileUtil.checkIfMd5Valid(extractedFileMd5)) {
Expand Down Expand Up @@ -411,7 +415,7 @@ private static boolean extractDexToJar(ZipFile zipFile, ZipEntry entryFile, File
private static void checkVmArtProperty() {
boolean art = ShareTinkerInternals.isVmArt();
if (!art && Build.VERSION.SDK_INT >= 21) {
throw new TinkerRuntimeException("it is dalvik vm, but sdk version " + Build.VERSION.SDK_INT + " is larger than 21");
throw new TinkerRuntimeException("it is dalvik vm, but sdk version " + Build.VERSION.SDK_INT + " is larger than 21!");
}
}

Expand Down
2 changes: 1 addition & 1 deletion tinker-sample-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

TINKER_VERSION=1.7.2
TINKER_VERSION=1.7.3

0 comments on commit e4b56a3

Please sign in to comment.