Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 198cd89

Browse filesBrowse files
committed
refacor(sdk): expose PatchRequestCallback to user
1 parent 387f909 commit 198cd89
Copy full SHA for 198cd89

File tree

1 file changed

+40
-3
lines changed
Filter options

1 file changed

+40
-3
lines changed

‎tinkerpatch-sdk/src/main/java/com/tencent/tinker/app/TinkerServerManager.java

Copy file name to clipboardExpand all lines: tinkerpatch-sdk/src/main/java/com/tencent/tinker/app/TinkerServerManager.java
+40-3Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.tencent.tinker.server.TinkerServerClient;
3838
import com.tencent.tinker.server.client.ConfigRequestCallback;
3939
import com.tencent.tinker.server.client.DefaultPatchRequestCallback;
40+
import com.tencent.tinker.server.client.PatchRequestCallback;
4041
import com.tencent.tinker.server.utils.Debugger;
4142

4243
import org.json.JSONException;
@@ -63,8 +64,44 @@ public class TinkerServerManager {
6364
* @param appVersion 在Tinkerpatch中填写的appVersion
6465
* @param channel 发布的渠道名称,由于GooglePlay渠道的政策限制,我们会停止所有channel中含有google关键字的动态下发功能。
6566
*/
66-
public static void installTinkerServer(Context context, Tinker tinker,
67-
int hours, String appKey, String appVersion, String channel) {
67+
public static void installTinkerServer(
68+
Context context,
69+
Tinker tinker,
70+
int hours,
71+
String appKey,
72+
String appVersion,
73+
String channel
74+
) {
75+
installTinkerServer(
76+
context,
77+
tinker,
78+
hours,
79+
appKey,
80+
appVersion,
81+
channel,
82+
new TinkerServerPatchRequestCallback()
83+
);
84+
}
85+
86+
/**
87+
* 初始化 TinkerServer 实例
88+
* @param context context
89+
* @param tinker {@link Tinker} 实例
90+
* @param hours 访问服务器的时间间隔, 单位为小时, 应为 >= 0
91+
* @param appKey 从Tinkerpatch中得到的appKey
92+
* @param appVersion 在Tinkerpatch中填写的appVersion
93+
* @param channel 发布的渠道名称,由于GooglePlay渠道的政策限制,我们会停止所有channel中含有google关键字的动态下发功能。
94+
* @param patchRequestCallback {@link PatchRequestCallback} patch请求的callback
95+
*/
96+
public static void installTinkerServer(
97+
Context context,
98+
Tinker tinker,
99+
int hours,
100+
String appKey,
101+
String appVersion,
102+
String channel,
103+
PatchRequestCallback patchRequestCallback
104+
) {
68105
final boolean debug = Debugger.getInstance(context).isDebug();
69106
TinkerLog.i(TAG, String.format("installTinkerServer, debug value: %s appVersion: %s, channel: %s",
70107
String.valueOf(debug), appVersion, channel)
@@ -75,7 +112,7 @@ public static void installTinkerServer(Context context, Tinker tinker,
75112
appKey,
76113
appVersion,
77114
debug,
78-
new TinkerServerPatchRequestCallback()
115+
patchRequestCallback
79116
);
80117
// add channel condition
81118
sTinkerServerClient.updateTinkerCondition(CONDITION_CHANNEL, channel);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.