diff --git a/app/build.gradle b/app/build.gradle index ef5db2b..402edcb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,8 +39,8 @@ android { productFlavors { beta { flavorDimensions "default" - versionCode 19 - versionName "2.8" + versionCode 22 + versionName "3.1" manifestPlaceholders = [ JPUSH_PKGNAME: "com.uiui.appstore", JPUSH_APPKEY : "c93d01f43046fa500d162817", //JPush 上注册的包名对应的 Appkey. diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4842269..d60b05e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -119,12 +119,14 @@ - + + + tools:replace="android:exported" /> + - + + - + + + tools:replace="android:authorities" /> + - + + + tools:replace="android:authorities" /> + - + + @@ -191,7 +199,8 @@ - + + @@ -214,20 +223,27 @@ - + + - - - - - + + + + + + + + + + - + + diff --git a/app/src/main/java/com/uiui/appstore/adapter/LocalAppAdapter.java b/app/src/main/java/com/uiui/appstore/adapter/LocalAppAdapter.java index ca882f5..362c955 100644 --- a/app/src/main/java/com/uiui/appstore/adapter/LocalAppAdapter.java +++ b/app/src/main/java/com/uiui/appstore/adapter/LocalAppAdapter.java @@ -61,7 +61,7 @@ public class LocalAppAdapter extends RecyclerView.Adapter fuxiaoyingApp = new HashSet() {{ + this.add("com.fuying.fuxiaoying"); + this.add("com.zhiduoke.fxy"); + this.add("com.fuying.english"); + this.add("com.pengren.growthspace"); + this.add("com.moshujiamm.moshujia"); + this.add("com.gankao.gkwxhd"); + this.add("com.fuying.aobama.pad"); + }}; + synchronized public static List getLocalApp(Context context) { List appList = new ArrayList<>(); Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); List resolveInfoList = context.getPackageManager().queryIntentActivities(intent, 0); - String qch_force_app = Settings.System.getString(context.getContentResolver(), "qch_force_app"); + String aole_force_app = Settings.System.getString(context.getContentResolver(), "aole_force_app"); + Set forceAppSet = new HashSet<>(Arrays.asList(aole_force_app.split(","))); + forceAppSet.addAll(fuxiaoyingApp); + for (int i = 0; i < resolveInfoList.size(); i++) { LocalApp bean = new LocalApp(); bean.setAppName(resolveInfoList.get(i).loadLabel(context.getPackageManager()).toString()); @@ -657,7 +672,7 @@ public class ApkUtils { bean.setPackageName(packageName); Drawable icon = resolveInfoList.get(i).loadIcon(context.getPackageManager()); bean.setIcon(icon); - if (!TextUtils.isEmpty(qch_force_app) && qch_force_app.contains(packageName)) { + if (forceAppSet.contains(packageName)) { bean.setCanUnintall(false); } else { bean.setCanUnintall(true); diff --git a/app/src/main/java/com/uiui/appstore/utils/JGYUtils.java b/app/src/main/java/com/uiui/appstore/utils/JGYUtils.java index f46f5c4..f75d453 100644 --- a/app/src/main/java/com/uiui/appstore/utils/JGYUtils.java +++ b/app/src/main/java/com/uiui/appstore/utils/JGYUtils.java @@ -13,6 +13,7 @@ import android.os.BatteryManager; import android.os.Build; import android.os.PowerManager; import android.provider.Settings; +import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; @@ -344,4 +345,34 @@ public class JGYUtils { bootIntent.setComponent(new ComponentName(PACKAGE_UPDATETOOLS, CLASS_UPDATETOOLS)); mContext.sendBroadcast(bootIntent); } + + public String getIMEI() { + String IMEI = "unknow"; + String IMEI1, IMEI2, IMEI3; + //获取手机设备号 + TelephonyManager TelephonyMgr = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); + //8.0及以后版本获取 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + IMEI = TelephonyMgr.getDeviceId(); + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { +// try { +// Method method = TelephonyMgr.getClass().getMethod("getImei"); +// IMEI = (String) method.invoke(TelephonyMgr); +// } catch (Exception e) { +// e.printStackTrace(); +// Log.e("getIMEI", e.getMessage()); +// } +// IMEI = TelephonyMgr.getDeviceId(); + +// } else {//9.0到10.0获取 + IMEI = Settings.System.getString(mContext.getContentResolver(), Settings.Secure.ANDROID_ID); + } +// Log.e("IMEI:", "IMEI: " + IMEI); + if (null == IMEI) { + return "-"; + } else { + return IMEI.toUpperCase(); + } + } + } diff --git a/app/src/main/java/com/uiui/appstore/utils/Utils.java b/app/src/main/java/com/uiui/appstore/utils/Utils.java index a585b55..9d2d242 100644 --- a/app/src/main/java/com/uiui/appstore/utils/Utils.java +++ b/app/src/main/java/com/uiui/appstore/utils/Utils.java @@ -586,22 +586,23 @@ public class Utils { */ @SuppressLint({"MissingPermission", "NewApi"}) public static String getSerial() { - String serial = "unknow"; - try { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+ - serial = Build.getSerial(); - } else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+ - serial = Build.SERIAL; - } else {//8.0- - Class c = Class.forName("android.os.SystemProperties"); - Method get = c.getMethod("get", String.class); - serial = (String) get.invoke(c, "ro.serialno"); - } - } catch (Exception e) { - e.printStackTrace(); - Log.e("e", "读取设备序列号异常:" + e.toString()); - } - return serial; + return JGYUtils.getInstance().getIMEI(); +// String serial = "unknow"; +// try { +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+ +// serial = Build.getSerial(); +// } else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+ +// serial = Build.SERIAL; +// } else {//8.0- +// Class c = Class.forName("android.os.SystemProperties"); +// Method get = c.getMethod("get", String.class); +// serial = (String) get.invoke(c, "ro.serialno"); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// Log.e("e", "读取设备序列号异常:" + e.toString()); +// } +// return serial; } public static final long A_GB = 1073741824; @@ -628,11 +629,11 @@ public class Utils { } - public static String transferLongToDate(Long millSec){ + public static String transferLongToDate(Long millSec) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - Date date= new Date(millSec); + Date date = new Date(millSec); return sdf.format(date); @@ -686,6 +687,7 @@ public class Utils { // mCanvas.drawBitmap(mBitmap, mRect, mRect, mPaint); // return bgBitmap; } + public static Bitmap DrawableToBitmap(Drawable drawable) { // 获取 drawable 长宽 @@ -707,6 +709,4 @@ public class Utils { } - - } \ No newline at end of file