version:2.5
fix:显示图库文件,默认禁止 add:
This commit is contained in:
@@ -66,8 +66,8 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 26
|
minSdkVersion 26
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 15
|
versionCode 16
|
||||||
versionName "2.4"
|
versionName "2.5"
|
||||||
ndk {
|
ndk {
|
||||||
//选择要添加的对应 cpu 类型的 .so 库。
|
//选择要添加的对应 cpu 类型的 .so 库。
|
||||||
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
|
|||||||
@@ -298,9 +298,9 @@ public class IconCache extends BaseIconCache {
|
|||||||
if (appClassNameList.indexOf(info.getComponentName().getClassName()) == -1) {
|
if (appClassNameList.indexOf(info.getComponentName().getClassName()) == -1) {
|
||||||
icon = BitmapUtils.getRoundedBitmap(mIconProvider.getIcon(info, mIconDpi, flattenDrawable), mContext);
|
icon = BitmapUtils.getRoundedBitmap(mIconProvider.getIcon(info, mIconDpi, flattenDrawable), mContext);
|
||||||
} else {
|
} 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);
|
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);
|
icon = BitmapUtils.getDeskClockIcon(mContext);
|
||||||
} else {
|
} else {
|
||||||
int i = appClassNameList.indexOf(name);
|
int i = appClassNameList.indexOf(name);
|
||||||
|
|||||||
@@ -276,11 +276,13 @@ public class LoaderTask implements Runnable {
|
|||||||
this.add("com.aoleyunos.dop1");
|
this.add("com.aoleyunos.dop1");
|
||||||
this.add("com.aoleyunos.dop2");
|
this.add("com.aoleyunos.dop2");
|
||||||
//system
|
//system
|
||||||
// this.add("com.android.documentsui");
|
this.add("com.android.documentsui");
|
||||||
// this.add("com.android.messaging");
|
// this.add("com.android.messaging");
|
||||||
this.add("com.android.music");
|
this.add("com.android.music");
|
||||||
|
this.add("com.android.gallery3d");
|
||||||
this.add("com.android.camera");
|
this.add("com.android.camera");
|
||||||
this.add("com.android.camera2");
|
this.add("com.android.camera2");
|
||||||
|
this.add("com.android.calculator2");
|
||||||
this.add("com.android.settings");
|
this.add("com.android.settings");
|
||||||
this.add("com.android.stk");
|
this.add("com.android.stk");
|
||||||
this.add("com.mediatek.camera");
|
this.add("com.mediatek.camera");
|
||||||
|
|||||||
@@ -25,9 +25,6 @@ import static com.aoleyun.os.model.AppLaunchTracker.CONTAINER_ALL_APPS;
|
|||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -54,16 +51,12 @@ import com.aoleyun.os.PromiseAppInfo;
|
|||||||
import com.aoleyun.os.R;
|
import com.aoleyun.os.R;
|
||||||
import com.aoleyun.os.statistics.AppInformation;
|
import com.aoleyun.os.statistics.AppInformation;
|
||||||
import com.aoleyun.os.statistics.StatisticsInfo;
|
import com.aoleyun.os.statistics.StatisticsInfo;
|
||||||
import com.aoleyun.os.uiuiutils.Utils;
|
|
||||||
import com.aoleyun.os.WorkspaceItemInfo;
|
import com.aoleyun.os.WorkspaceItemInfo;
|
||||||
import com.aoleyun.os.compat.AppWidgetManagerCompat;
|
import com.aoleyun.os.compat.AppWidgetManagerCompat;
|
||||||
import com.aoleyun.os.folder.Folder;
|
import com.aoleyun.os.folder.Folder;
|
||||||
import com.aoleyun.os.folder.FolderIcon;
|
import com.aoleyun.os.folder.FolderIcon;
|
||||||
import com.aoleyun.os.network.bean.AppPasswdBean;
|
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.HTTPInterface;
|
||||||
import com.aoleyun.os.network.NetworkManager;
|
|
||||||
import com.aoleyun.os.network.api.AddAppLog;
|
|
||||||
import com.aoleyun.os.testing.TestProtocol;
|
import com.aoleyun.os.testing.TestProtocol;
|
||||||
import com.aoleyun.os.uiuiutils.TimeUtils;
|
import com.aoleyun.os.uiuiutils.TimeUtils;
|
||||||
import com.aoleyun.os.util.PackageManagerHelper;
|
import com.aoleyun.os.util.PackageManagerHelper;
|
||||||
@@ -78,11 +71,6 @@ import java.lang.reflect.Type;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
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
|
* Class for handling clicks on workspace and all-apps items
|
||||||
*/
|
*/
|
||||||
@@ -123,13 +111,16 @@ public class ItemClickHandler {
|
|||||||
|
|
||||||
Object tag = v.getTag();
|
Object tag = v.getTag();
|
||||||
if (tag instanceof WorkspaceItemInfo) {
|
if (tag instanceof WorkspaceItemInfo) {
|
||||||
|
String packageName = ((WorkspaceItemInfo) tag).getTargetComponent().getPackageName();
|
||||||
|
if (is_forbid(v.getContext(), packageName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//获取本地密码
|
//获取本地密码
|
||||||
String ApplicationLock = MMKV.defaultMMKV().decodeString("ApplicationLock");
|
String ApplicationLock = MMKV.defaultMMKV().decodeString("ApplicationLock");
|
||||||
Log.e("onClick", "onClick: " + ApplicationLock);
|
Log.e("onClick", "onClick: " + ApplicationLock);
|
||||||
Type type = new TypeToken<List<AppPasswdBean>>() {
|
Type type = new TypeToken<List<AppPasswdBean>>() {
|
||||||
}.getType();
|
}.getType();
|
||||||
List<AppPasswdBean> appPasswdBeans = new Gson().fromJson(ApplicationLock, type);
|
List<AppPasswdBean> appPasswdBeans = new Gson().fromJson(ApplicationLock, type);
|
||||||
String packageName = ((WorkspaceItemInfo) tag).getTargetComponent().getPackageName();
|
|
||||||
Log.e("ItemClickHandler", "onClick: " + packageName);
|
Log.e("ItemClickHandler", "onClick: " + packageName);
|
||||||
if (appPasswdBeans == null) {
|
if (appPasswdBeans == null) {
|
||||||
onClickAppShortcut(v, (WorkspaceItemInfo) tag, launcher, sourceContainer);
|
onClickAppShortcut(v, (WorkspaceItemInfo) tag, launcher, sourceContainer);
|
||||||
@@ -190,17 +181,48 @@ public class ItemClickHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean cameraClosed(Context context, String pkg) {
|
private static boolean is_forbid(Context context, String pkg) {
|
||||||
if ("com.mediatek.camera".equalsIgnoreCase(pkg)) {
|
switch (pkg) {
|
||||||
if (Settings.System.getInt(context.getContentResolver(), "qch_app_camera", 0) == 1) {
|
case "com.mediatek.camera":
|
||||||
Toast.makeText(context, "摄像头已禁止使用", Toast.LENGTH_SHORT).show();
|
case "com.android.camera2":
|
||||||
|
if (Settings.System.getInt(context.getContentResolver(), "qch_app_camera", 1) == 1) {
|
||||||
|
ToastUtil.show( "摄像头已禁止使用");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} else {
|
break;
|
||||||
return false;
|
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 = {
|
public static String[] packages = {
|
||||||
|
|||||||
Reference in New Issue
Block a user