Skip to content

Commit e81afb4

Browse files
committed
feat(build): upgrade tinkerPatch to 1.1.7
1 parent 53cf0c9 commit e81afb4

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed

app/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ apply plugin: 'com.android.application'
22

33
dependencies {
44
compile fileTree(dir: 'libs', include: ['*.jar'])
5-
compile "com.android.support:appcompat-v7:23.1.1"
5+
compile "com.android.support:appcompat-v7:25.3.1"
66
compile "com.android.support:multidex:1.0.1"
77

88
//无需引入tinker的任何库,使用tinkerpatch sdk即可
99
compile("com.tinkerpatch.sdk:tinkerpatch-android-sdk:${TINKERPATCH_VERSION}") { changing = true }
10+
// compile("com.tinkerpatch.sdk:tinkerpatch-okhttp3-loader:${TINKERPATCH_VERSION}") { changing = true }
11+
// compile "com.squareup.okhttp3:okhttp:$OKHTTP3_VERSION"
12+
// compile("com.tinkerpatch.sdk:tinkerpatch-okhttp-loader:${TINKERPATCH_VERSION}") { changing = true }
13+
// compile "com.squareup.okhttp:okhttp:$OKHTTP_VERSION"
1014
}
1115

1216
android {
13-
compileSdkVersion 23
14-
buildToolsVersion "23.0.2"
17+
compileSdkVersion 25
18+
buildToolsVersion "25.0.2"
1519

1620
signingConfigs {
1721
debug {

app/src/main/java/com/tinkerpatch/easy_sample/SampleApplication.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,18 @@ private void initTinkerPatch() {
7979
// 我们可以从这里获得Tinker加载过程的信息
8080
if (BuildConfig.TINKER_ENABLE) {
8181
tinkerApplicationLike = TinkerPatchApplicationLike.getTinkerPatchApplicationLike();
82-
8382
// 初始化TinkerPatch SDK
84-
TinkerPatch.init(tinkerApplicationLike)
83+
TinkerPatch.init(
84+
tinkerApplicationLike
85+
// new TinkerPatch.Builder(tinkerApplicationLike)
86+
// .requestLoader(new OkHttp3Loader())
87+
// .build()
88+
)
8589
.reflectPatchLibrary()
8690
.setPatchRollbackOnScreenOff(true)
8791
.setPatchRestartOnSrceenOff(true)
88-
.setFetchPatchIntervalByHours(3);
92+
.setFetchPatchIntervalByHours(3)
93+
;
8994
// 获取当前的补丁版本
9095
Log.d(TAG, "Current patch version is " + TinkerPatch.with().getPatchVersion());
9196

@@ -156,18 +161,19 @@ public void onPatchRollback() {
156161
}
157162

158163
/**
159-
* 自定义Tinker类的高级用法, 一般不推荐使用
164+
* 自定义Tinker类的高级用法, 使用更灵活,但是需要对tinker有更进一步的了解
160165
* 更详细的解释请参考:http://tinkerpatch.com/Docs/api
161166
*/
162167
private void complexSample() {
163-
TinkerPatch.Builder builder = new TinkerPatch.Builder(tinkerApplicationLike);
164168
//修改tinker的构造函数,自定义类
165-
builder.listener(new DefaultPatchListener(this))
169+
TinkerPatch.Builder builder = new TinkerPatch.Builder(tinkerApplicationLike)
170+
.listener(new DefaultPatchListener(this))
166171
.loadReporter(new DefaultLoadReporter(this))
167172
.patchReporter(new DefaultPatchReporter(this))
168173
.resultServiceClass(TinkerServerResultService.class)
169174
.upgradePatch(new UpgradePatch())
170175
.patchRequestCallback(new TinkerPatchRequestCallback());
176+
//.requestLoader(new OkHttpLoader());
171177

172178
TinkerPatch.init(builder.build());
173179
}

app/tinkerpatch.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.util.regex.Pattern
66
* TODO: 请按自己的需求修改为适应自己工程的参数
77
*/
88
def bakPath = file("${buildDir}/bakApk/")
9-
def baseInfo = "app-3.0.0-0429-16-26-20"
9+
def baseInfo = "app-3.0.1-0524-18-09-33"
1010
def variantName = "debug"
1111

1212
/**

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
buildscript {
44
repositories {
5+
// mavenLocal()
56
jcenter()
67
}
78
dependencies {
@@ -15,7 +16,7 @@ buildscript {
1516

1617
allprojects {
1718
repositories {
18-
//mavenLocal()
19+
// mavenLocal()
1920
jcenter()
2021
}
2122
}

gradle.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ org.gradle.jvmargs=-Xmx1536m
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1717
# org.gradle.parallel=true
1818

19-
TINKERPATCH_VERSION=1.1.6
19+
TINKERPATCH_VERSION=1.1.7
20+
OKHTTP3_VERSION=3.8.0
21+
OKHTTP_VERSION=2.7.5

0 commit comments

Comments
 (0)