Skip to content

Commit 10ed791

Browse files
committed
发布2.0.6版本
1 parent 86c8f29 commit 10ed791

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ The following is the version description. Choose one.
172172
dependencies {
173173
...
174174
// androidx project
175-
implementation 'com.github.xuexiangjys:XUpdate:2.0.5'
175+
implementation 'com.github.xuexiangjys:XUpdate:2.0.6'
176176
}
177177
```
178178

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ allprojects {
171171
dependencies {
172172
...
173173
// androidx版本
174-
implementation 'com.github.xuexiangjys:XUpdate:2.0.5'
174+
implementation 'com.github.xuexiangjys:XUpdate:2.0.6'
175175
}
176176
```
177177

xupdate-lib/src/main/java/com/xuexiang/xupdate/_XUpdate.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.xuexiang.xupdate;
1818

1919
import android.content.Context;
20+
2021
import androidx.annotation.NonNull;
2122

2223
import com.xuexiang.xupdate.entity.DownloadEntity;
@@ -204,8 +205,8 @@ public static void onUpdateError(int errorCode) {
204205
/**
205206
* 更新出现错误
206207
*
207-
* @param errorCode
208-
* @param message
208+
* @param errorCode 错误码
209+
* @param message 错误信息
209210
*/
210211
public static void onUpdateError(int errorCode, String message) {
211212
onUpdateError(new UpdateError(errorCode, message));

xupdate-lib/src/main/java/com/xuexiang/xupdate/listener/impl/DefaultInstallListener.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public boolean onInstallApk(@NonNull Context context, @NonNull File apkFile, @No
4343
if (checkApkFile(downloadEntity, apkFile)) {
4444
return installApkFile(context, apkFile);
4545
} else {
46-
_XUpdate.onUpdateError(INSTALL_FAILED, "apk文件校验不通过!");
46+
_XUpdate.onUpdateError(INSTALL_FAILED, "Apk file verify failed, please check whether the MD5 value you set is correct!");
4747
return false;
4848
}
4949
}
@@ -53,7 +53,7 @@ public boolean onInstallApk(@NonNull Context context, @NonNull File apkFile, @No
5353
*
5454
* @param downloadEntity 下载信息实体
5555
* @param apkFile apk文件
56-
* @return
56+
* @return apk文件是否有效
5757
*/
5858
protected boolean checkApkFile(DownloadEntity downloadEntity, @NonNull File apkFile) {
5959
return downloadEntity != null && downloadEntity.isApkFileValid(apkFile);
@@ -62,15 +62,15 @@ protected boolean checkApkFile(DownloadEntity downloadEntity, @NonNull File apkF
6262
/**
6363
* 安装apk文件【此处可自定义apk的安装方法,可重写该方法】
6464
*
65-
* @param context
66-
* @param apkFile
67-
* @return
65+
* @param context 上下文
66+
* @param apkFile apk文件
67+
* @return 是否安装成功
6868
*/
6969
protected boolean installApkFile(Context context, File apkFile) {
7070
try {
7171
return ApkInstallUtils.install(context, apkFile);
7272
} catch (IOException e) {
73-
_XUpdate.onUpdateError(INSTALL_FAILED, "获取apk的路径出错!");
73+
_XUpdate.onUpdateError(INSTALL_FAILED, "An error occurred while install apk:" + e.getMessage());
7474
}
7575
return false;
7676
}

xupdate-lib/src/main/java/com/xuexiang/xupdate/utils/ApkInstallUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ private static boolean installNormal(Context context, String filePath) {
231231
/**
232232
* 使用系统的意图进行apk安装
233233
*
234-
* @param context
235-
* @param appFile
236-
* @return
234+
* @param context 上下文
235+
* @param appFile 应用文件
236+
* @return 安装是否成功
237237
*/
238238
private static boolean installNormal(Context context, File appFile) {
239239
try {
@@ -247,7 +247,7 @@ private static boolean installNormal(Context context, File appFile) {
247247
return true;
248248
}
249249
} catch (Exception e) {
250-
_XUpdate.onUpdateError(INSTALL_FAILED, "使用系统的意图进行apk安装失败!");
250+
_XUpdate.onUpdateError(INSTALL_FAILED, "Apk installation failed using the intent of the system!");
251251
}
252252
return false;
253253
}
@@ -270,7 +270,7 @@ public static Intent getInstallAppIntent(File appFile) {
270270
intent.setDataAndType(fileUri, "application/vnd.android.package-archive");
271271
return intent;
272272
} catch (Exception e) {
273-
_XUpdate.onUpdateError(INSTALL_FAILED, "获取安装的意图失败!");
273+
_XUpdate.onUpdateError(INSTALL_FAILED, "Failed to get intent for installation!");
274274
}
275275
return null;
276276
}

0 commit comments

Comments
 (0)