version:cube
fix: update:优化检测升级
This commit is contained in:
@@ -721,6 +721,19 @@ public class NetInterfaceManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void checkUpdate() {
|
||||||
|
String jsonString = cacheHelper.getAsString(UrlAddress.CHECK_UPDATE);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type listType = new TypeToken<List<AppUpdateInfo>>() {
|
||||||
|
}.getType();
|
||||||
|
List<AppUpdateInfo> appUpdateInfos = gson.fromJson(jsonString, listType);
|
||||||
|
if (appUpdateInfos == null) return;
|
||||||
|
for (AppUpdateInfo info : appUpdateInfos) {
|
||||||
|
JsonObject jsonObject = parseString(new Gson().toJson(info)).getAsJsonObject();
|
||||||
|
JGYUtils.getInstance().installAPK(jsonObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取灰度测试更新
|
* 获取灰度测试更新
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public class NewAppReceiver extends BroadcastReceiver {
|
|||||||
Log.e(TAG, "sendAppInfo: " + state + packageName);
|
Log.e(TAG, "sendAppInfo: " + state + packageName);
|
||||||
JGYUtils.getInstance().checkDefaultDesktop(packageName);
|
JGYUtils.getInstance().checkDefaultDesktop(packageName);
|
||||||
JGYUtils.getInstance().checkForceDownload();
|
JGYUtils.getInstance().checkForceDownload();
|
||||||
|
NetInterfaceManager.getInstance().checkUpdate();
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
|
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
|
||||||
ApkUtils.addShortcut(context);
|
ApkUtils.addShortcut(context);
|
||||||
|
|||||||
@@ -409,6 +409,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
|||||||
mPresenter.checkAoleyunUpdate();
|
mPresenter.checkAoleyunUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
NetInterfaceManager.getInstance().checkUpdate();
|
||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user