version:4.7

fix:
update:增加远程获取隐藏app列表,禁用app列表
This commit is contained in:
2022-05-23 16:22:23 +08:00
parent 1b83a79957
commit 14fd58b82f
7 changed files with 81 additions and 12 deletions

View File

@@ -12,4 +12,6 @@ interface SystemInfoInterface {
double aDouble, String aString);
String getSerial();
List<String> getHideIcon();
List<String> getDisableIcon();
}

View File

@@ -70,10 +70,10 @@ public class BaseApplication extends MultiDexApplication {
public void onCreate() {
super.onCreate();
context = this;
if (SystemUtils.isMainProcessName(this, Process.myPid())) {
//非主进程不初始化
init();
}
// if (SystemUtils.isMainProcessName(this, Process.myPid())) {
//非主进程不初始化
init();
// }
}
private void init() {

View File

@@ -120,11 +120,13 @@ public class CacheHelper {
edit.commit();//write CLEAN
} catch (IOException e) {
e.printStackTrace();
Log.e(TAG, "put: " + e.getMessage());
try {
//s
edit.abort();//write REMOVE
} catch (IOException e1) {
e1.printStackTrace();
Log.e(TAG, "put: " + e1.getMessage());
}
} finally {
try {
@@ -133,6 +135,7 @@ public class CacheHelper {
}
} catch (IOException e) {
e.printStackTrace();
Log.e(TAG, "put: " + e.getMessage());
}
}
}

View File

@@ -7,8 +7,11 @@ import android.os.RemoteException;
import android.util.Log;
import com.aoleyun.sn.SystemInfoInterface;
import com.aoleyun.sn.utils.JGYUtils;
import com.aoleyun.sn.utils.Utils;
import java.util.List;
public class RemoteService extends Service {
private String TAG = RemoteService.class.getSimpleName();
@@ -36,5 +39,17 @@ public class RemoteService extends Service {
public String getSerial() throws RemoteException {
return Utils.getSerial();
}
@Override
public List<String> getHideIcon() throws RemoteException {
return JGYUtils.getInstance().getHidePackage();
}
@Override
public List<String> getDisableIcon() throws RemoteException {
return JGYUtils.getInstance().getDisablePackage();
}
};
}

View File

@@ -944,7 +944,6 @@ public class ApkUtils {
this.add("com.android.calculator2");
this.add("com.qi.TFSystem");
this.add("com.qi.appstore");
}};
public static void showAllAPP(Context context) {
@@ -1187,7 +1186,7 @@ public class ApkUtils {
}
//排除所有系统应用,不显示
if (isSystemApp(context, packageName)) {
if (!AoleyunOSApp.contains(packageName)) {
if (!AoleyunOSApp.contains(packageName) && !aihuaApp.contains(packageName)) {
continue;
}
} else {

View File

@@ -1388,6 +1388,7 @@ public class JGYUtils {
this.add("com.alibaba.android.rimet");
this.add("com.tencent.wemeet.app");
this.add("com.qi.studycomputer.launcher");
}};
/**
@@ -2073,6 +2074,57 @@ public class JGYUtils {
}
}
public List<String> getHidePackage() {
String jsonString = cacheHelper.getAsString(UrlAddress.GET_HIDE_DESKTOPICON);
//为 "" 是已经请求成功的
if (jsonString == null) {
return new ArrayList<>();
} else {
Gson gson = new Gson();
Type type = new TypeToken<List<String>>() {
}.getType();
List<String> list = gson.fromJson(jsonString, type);
if (list == null) {
return new ArrayList<>();
} else {
return list;
}
}
}
public List<String> getDisablePackage() {
List<String> list = new ArrayList<>();
if (Settings.System.getInt(crv, "qch_app_camera", 0) == 1) {
list.add("com.mediatek.camera");
list.add("com.android.camera");
list.add("com.android.camera2");
}
if (Settings.System.getInt(crv, "qch_call_forbid", 0) == 1) {
list.add("com.android.dialer");
}
if (Settings.System.getInt(crv, "qch_app_deskclock", 0) == 1) {
list.add("com.android.deskclock");
}
if (Settings.System.getInt(crv, "qch_app_soundrecorder", 0) == 1) {
list.add("com.android.soundrecorder");
}
if (Settings.System.getInt(crv, "qch_app_music", 0) == 1) {
list.add("com.android.music");
}
if (Settings.System.getInt(crv, "qch_app_gallery", 0) == 1) {
list.add("com.android.gallery3d");
}
if (Settings.System.getInt(crv, "qch_app_filemanager", 0) == 1) {
list.add("com.mediatek.filemanager");
list.add("com.android.documentsui");
}
if (Settings.System.getInt(crv, "qch_app_browser", 0) == 1) {
list.add("com.android.browser");
list.add("com.aoleyun.browser");
}
return list;
}
public static final String PACKAGE_DEVICEINFO = "com.aoleyun.sn";
public static final String CLASS_DEVICEINFO = "com.aoleyun.sn.receiver.BootReceiver";
@@ -2152,6 +2204,4 @@ public class JGYUtils {
public static boolean isCubeDevice() {
return getHardware().startsWith(UNISOC_HARDWARE) && Build.BRAND.equalsIgnoreCase(CUBE_BRAND);
}
}