正在查看: 管控平台 v5.2.3.0. 应用的 CheckUpdateService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 管控平台 v5.2.3.0. 应用的 CheckUpdateService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.iflytek.mdmservice.service;
import android.app.IntentService;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import androidx.core.content.ContextCompat;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmcommon.SpHelper;
import java.io.File;
import java.util.ArrayList;
import net.sqlcipher.BuildConfig;
public class CheckUpdateService extends IntentService {
public CheckUpdateService() {
super("CheckUpdateService");
}
private boolean a() {
PackageManager packageManager = getPackageManager();
try {
long j = packageManager.getPackageInfo("com.iflytek.mdmupdate", 0).versionCode;
long j2 = SpHelper.getLong("com.iflytek.mdmupdate".replace(".", BuildConfig.FLAVOR).concat("versioncode"), 0L);
if (j == j2) {
ArrayList<String> arrayList = new ArrayList(3);
arrayList.add("com.iflytek.mdmadmin");
arrayList.add("com.iflytek.mdmstore");
arrayList.add("com.iflytek.mdmservice");
for (String str : arrayList) {
String concat = str.replace(".", BuildConfig.FLAVOR).concat("versioncode");
long j3 = SpHelper.getLong(concat, 0L);
try {
PackageInfo packageInfo = packageManager.getPackageInfo(str, 0);
if (packageInfo != null) {
long j4 = packageInfo.versionCode;
if (j4 == j3) {
SpHelper.delete(concat);
} else if (j4 < j3 || j3 == 0) {
return true;
}
} else {
continue;
}
} catch (PackageManager.NameNotFoundException e) {
LogUtil.e("MDMUpdate", e.getMessage());
}
}
} else if (j > j2) {
return true;
}
return false;
} catch (PackageManager.NameNotFoundException e2) {
LogUtil.e("MDMUpdate", "checkMdmUpdate error: " + e2.getMessage());
return false;
}
}
private boolean b() {
return d("android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE");
}
private boolean c(File file) {
if (file == null || !file.exists()) {
return false;
}
if (file.isDirectory()) {
File[] listFiles = file.listFiles();
if (listFiles == null || listFiles.length == 0) {
return false;
}
for (File file2 : listFiles) {
c(file2);
}
}
return file.delete();
}
private boolean d(String... strArr) {
for (String str : strArr) {
if (ContextCompat.checkSelfPermission(this, str) != 0) {
return false;
}
}
return true;
}
@Override
protected void onHandleIntent(@androidx.annotation.Nullable android.content.Intent r19) {
throw new UnsupportedOperationException("Method not decompiled: com.iflytek.mdmservice.service.CheckUpdateService.onHandleIntent(android.content.Intent):void");
}
}