version:6.4.8
fix: update:修改主页效果
This commit is contained in:
@@ -762,6 +762,7 @@ public class ApkUtils {
|
||||
this.add("com.aoleyun.os");
|
||||
this.add("com.aoleyun.browser");
|
||||
this.add("com.aoleyun.browser");
|
||||
this.add("com.uiui.filecloud");
|
||||
}};
|
||||
|
||||
//出厂自带的app
|
||||
|
||||
@@ -32,7 +32,6 @@ import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.content.ContextCompat;
|
||||
@@ -96,10 +95,18 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableEmitter;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
|
||||
|
||||
|
||||
@@ -2500,7 +2507,7 @@ public class JGYUtils {
|
||||
String app_package = adminAppInfo.getApp_package();
|
||||
String app_url = adminAppInfo.getApp_url();
|
||||
String app_md5 = adminAppInfo.getApp_md5();
|
||||
int app_id = adminAppInfo.getId();
|
||||
int app_id = adminAppInfo.getId();
|
||||
long app_version_code = adminAppInfo.getApp_version_code();
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("app_name", app_name);
|
||||
@@ -2532,4 +2539,134 @@ public class JGYUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final String AOLE_DIR = "aoleapp";
|
||||
|
||||
public void checkLocalExternalFiles() {
|
||||
int install = mMMKV.decodeInt(CommonConfig.INSTALL_SD_APKS, 0);
|
||||
Log.e(TAG, "checkLocalExternalFiles: installed = " + install);
|
||||
if (install == 1) {
|
||||
Log.e(TAG, "checkLocalExternalFiles: install");
|
||||
// return;
|
||||
}
|
||||
File[] externalFiles = mContext.getExternalFilesDirs(null);
|
||||
Log.e(TAG, "checkLocalAppInstall: externalFiles = " + Arrays.toString(externalFiles));
|
||||
|
||||
String SdPath = Environment.getExternalStorageDirectory().getAbsolutePath();
|
||||
Log.e(TAG, "checkLocalAppInstall: SdPath = " + SdPath);
|
||||
String aolePath = SdPath + File.separator + AOLE_DIR;
|
||||
File file = new File(aolePath);
|
||||
if (!file.exists()) {
|
||||
Log.e(TAG, "checkLocalExternalFiles: dir not exists");
|
||||
return;
|
||||
}
|
||||
String[] apkName = file.list();
|
||||
if (apkName == null || apkName.length == 0) {
|
||||
Log.e(TAG, "checkLocalAppInstall: apkName is empty");
|
||||
} else {
|
||||
Observable.create(new ObservableOnSubscribe<HashMap<String, String>>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<HashMap<String, String>> emitter) throws Throwable {
|
||||
HashMap<String, String> packageListMap = new HashMap<>();
|
||||
for (String fileName : apkName) {
|
||||
String apkPath = aolePath + File.separator + fileName;
|
||||
Log.e(TAG, "subscribe: " + apkPath);
|
||||
String pkg = ApkUtils.getPackageName(mContext, apkPath);
|
||||
if (mJxwApps.contains(pkg)) {
|
||||
packageListMap.put(pkg, apkPath);
|
||||
} else {
|
||||
Log.e(TAG, "checkLocalAppInstall: skip: " + pkg + " fileName: " + fileName);
|
||||
}
|
||||
}
|
||||
emitter.onNext(packageListMap);
|
||||
emitter.onComplete();
|
||||
}
|
||||
}).subscribe(new Observer<HashMap<String, String>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkLocalAppInstall", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull HashMap<String, String> stringStringHashMap) {
|
||||
Log.e("checkLocalAppInstall", "onNext: " + stringStringHashMap);
|
||||
stringStringHashMap.forEach(new BiConsumer<String, String>() {
|
||||
@Override
|
||||
public void accept(String key, String value) {
|
||||
if (ApkUtils.isAvailable(mContext, key)) {
|
||||
Log.e("checkLocalAppInstall", "accept: installed: " + key);
|
||||
} else {
|
||||
ApkUtils.installApp(mContext, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkLocalAppInstall", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkLocalAppInstall", "onComplete: ");
|
||||
mMMKV.encode(CommonConfig.INSTALL_SD_APKS, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private Set<String> mJxwApps = new HashSet<String>() {{
|
||||
this.add("air.com.zhihuiyoujiao.flashplayer");
|
||||
this.add("com.example.arithmeticformula");
|
||||
this.add("com.example.elementcycleapp");
|
||||
this.add("com.example.pianpangbushou");
|
||||
this.add("com.iflytek.cyber.iot.show.core");
|
||||
this.add("com.iflytek.speechcloud");
|
||||
this.add("com.jxw.bihuamingcheng");
|
||||
this.add("com.jxw.bishunguize");
|
||||
this.add("com.jxw.characterlearning");
|
||||
this.add("com.jxw.dmxcy");
|
||||
this.add("com.jxw.englishsoundmark");
|
||||
this.add("com.jxw.examsystem");
|
||||
this.add("com.jxw.game");
|
||||
this.add("com.jxw.gb.zwpg");
|
||||
this.add("com.jxw.handwrite");
|
||||
this.add("com.jxw.jinfangyici");
|
||||
this.add("com.jxw.jxwbook");
|
||||
this.add("com.jxw.jxwcalculator");
|
||||
this.add("com.jxw.laboratory");
|
||||
this.add("com.jxw.learnchinesepinyin");
|
||||
this.add("com.jxw.letterstudynew");
|
||||
this.add("com.jxw.liancichengju");
|
||||
this.add("com.jxw.mskt.video");
|
||||
this.add("com.jxw.newyouer.video");
|
||||
this.add("com.jxw.online_study");
|
||||
this.add("com.jxw.question");
|
||||
this.add("com.jxw.schultegrid");
|
||||
this.add("com.jxw.singsound");
|
||||
this.add("com.jxw.studydigital");
|
||||
this.add("com.jxw.teacher.video");
|
||||
this.add("com.jxw.wuweijidanci");
|
||||
this.add("com.jxw.youer.video");
|
||||
this.add("com.jxw.yuwenxiezuo");
|
||||
this.add("com.jxw.yyhb");
|
||||
this.add("com.jxw.zncd");
|
||||
this.add("com.jxw.souti");
|
||||
this.add("com.jxw.xdfzq");
|
||||
this.add("com.oirsdfg89.flg");
|
||||
this.add("com.study.flashplayer");
|
||||
this.add("com.tech.translate");
|
||||
this.add("com.uiui.zybrowser");
|
||||
this.add("com.uiui.zysn ");
|
||||
this.add("com.jxw.launcher");
|
||||
this.add("com.uiui.zyappstore");
|
||||
this.add("com.uiui.zy");
|
||||
this.add("com.uiui.zyos");
|
||||
this.add("com.teclast.zyos");
|
||||
this.add("com.teclast.zybrowser");
|
||||
this.add("com.teclast.zyappstore");
|
||||
this.add("com.teclast.zy");
|
||||
}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user