version:2.5

fix:显示图库文件,默认禁止
add:
This commit is contained in:
2022-02-22 14:17:33 +08:00
parent c67024dde5
commit a51b5ff4df
4 changed files with 52 additions and 28 deletions

View File

@@ -66,8 +66,8 @@ android {
defaultConfig {
minSdkVersion 26
targetSdkVersion 28
versionCode 15
versionName "2.4"
versionCode 16
versionName "2.5"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'

View File

@@ -298,9 +298,9 @@ public class IconCache extends BaseIconCache {
if (appClassNameList.indexOf(info.getComponentName().getClassName()) == -1) {
icon = BitmapUtils.getRoundedBitmap(mIconProvider.getIcon(info, mIconDpi, flattenDrawable), mContext);
} else {
if (name.equals("com.android.calendar.AllInOneActivity")) {
if ("com.android.calendar.AllInOneActivity".equals(name)) {
icon = BitmapUtils.createCalendarIconBitmap(mContext.getResources().getDrawable(R.drawable.mask), mContext);
} else if (name.equals("com.android.deskclock.DeskClock")) {
} else if ("com.android.deskclock.DeskClock".equals(name)) {
icon = BitmapUtils.getDeskClockIcon(mContext);
} else {
int i = appClassNameList.indexOf(name);

View File

@@ -276,11 +276,13 @@ public class LoaderTask implements Runnable {
this.add("com.aoleyunos.dop1");
this.add("com.aoleyunos.dop2");
//system
// this.add("com.android.documentsui");
this.add("com.android.documentsui");
// this.add("com.android.messaging");
this.add("com.android.music");
this.add("com.android.gallery3d");
this.add("com.android.camera");
this.add("com.android.camera2");
this.add("com.android.calculator2");
this.add("com.android.settings");
this.add("com.android.stk");
this.add("com.mediatek.camera");

View File

@@ -25,9 +25,6 @@ import static com.aoleyun.os.model.AppLaunchTracker.CONTAINER_ALL_APPS;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Process;
import android.provider.Settings;
import android.text.TextUtils;
@@ -54,16 +51,12 @@ import com.aoleyun.os.PromiseAppInfo;
import com.aoleyun.os.R;
import com.aoleyun.os.statistics.AppInformation;
import com.aoleyun.os.statistics.StatisticsInfo;
import com.aoleyun.os.uiuiutils.Utils;
import com.aoleyun.os.WorkspaceItemInfo;
import com.aoleyun.os.compat.AppWidgetManagerCompat;
import com.aoleyun.os.folder.Folder;
import com.aoleyun.os.folder.FolderIcon;
import com.aoleyun.os.network.bean.AppPasswdBean;
import com.aoleyun.os.network.bean.BaseResponse;
import com.aoleyun.os.network.HTTPInterface;
import com.aoleyun.os.network.NetworkManager;
import com.aoleyun.os.network.api.AddAppLog;
import com.aoleyun.os.testing.TestProtocol;
import com.aoleyun.os.uiuiutils.TimeUtils;
import com.aoleyun.os.util.PackageManagerHelper;
@@ -78,11 +71,6 @@ import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
/**
* Class for handling clicks on workspace and all-apps items
*/
@@ -123,13 +111,16 @@ public class ItemClickHandler {
Object tag = v.getTag();
if (tag instanceof WorkspaceItemInfo) {
String packageName = ((WorkspaceItemInfo) tag).getTargetComponent().getPackageName();
if (is_forbid(v.getContext(), packageName)) {
return;
}
//获取本地密码
String ApplicationLock = MMKV.defaultMMKV().decodeString("ApplicationLock");
Log.e("onClick", "onClick: " + ApplicationLock);
Type type = new TypeToken<List<AppPasswdBean>>() {
}.getType();
List<AppPasswdBean> appPasswdBeans = new Gson().fromJson(ApplicationLock, type);
String packageName = ((WorkspaceItemInfo) tag).getTargetComponent().getPackageName();
Log.e("ItemClickHandler", "onClick: " + packageName);
if (appPasswdBeans == null) {
onClickAppShortcut(v, (WorkspaceItemInfo) tag, launcher, sourceContainer);
@@ -190,17 +181,48 @@ public class ItemClickHandler {
}
}
private static boolean cameraClosed(Context context, String pkg) {
if ("com.mediatek.camera".equalsIgnoreCase(pkg)) {
if (Settings.System.getInt(context.getContentResolver(), "qch_app_camera", 0) == 1) {
Toast.makeText(context, "摄像头已禁止使用", Toast.LENGTH_SHORT).show();
return true;
} else {
return false;
}
} else {
return false;
private static boolean is_forbid(Context context, String pkg) {
switch (pkg) {
case "com.mediatek.camera":
case "com.android.camera2":
if (Settings.System.getInt(context.getContentResolver(), "qch_app_camera", 1) == 1) {
ToastUtil.show( "摄像头已禁止使用");
return true;
}
break;
case "com.android.gallery3d":
if (Settings.System.getInt(context.getContentResolver(), "qch_app_gallery", 1) == 1) {
ToastUtil.show( "图库已禁止使用");
return true;
}
break;
case "com.android.documentsui":
if (Settings.System.getInt(context.getContentResolver(), "qch_app_filemanager", 1) == 1) {
ToastUtil.show( "文件已禁止使用");
return true;
}
break;
case "com.android.deskclock":
if (Settings.System.getInt(context.getContentResolver(), "qch_app_deskclock", 1) == 1) {
ToastUtil.show( "时钟已禁止使用");
return true;
}
break;
case "com.android.music":
if (Settings.System.getInt(context.getContentResolver(), "qch_app_music", 1) == 1) {
ToastUtil.show( "音乐已禁止使用");
return true;
}
break;
case "com.android.soundrecorder":
if (Settings.System.getInt(context.getContentResolver(), "qch_app_soundrecorder", 1) == 1) {
ToastUtil.show( "录音机已禁止使用");
return true;
}
break;
default:
}
return false;
}
public static String[] packages = {