version:3.1
fix: update:修改唯一标识为IMEI
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -119,12 +119,14 @@
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider> <!-- Rich push 核心功能 since 2.0.6 -->
|
||||
</provider>
|
||||
<!-- Rich push 核心功能 since 2.0.6 -->
|
||||
<activity
|
||||
android:name="cn.jpush.android.ui.PopWinActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/MyDialogStyle"
|
||||
tools:replace="android:exported" /> <!-- Required SDK核心功能 -->
|
||||
tools:replace="android:exported" />
|
||||
<!-- Required SDK核心功能 -->
|
||||
<activity
|
||||
android:name="cn.jpush.android.ui.PushActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
@@ -137,7 +139,8 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="com.uiui.appstore" />
|
||||
</intent-filter>
|
||||
</activity> <!-- Required SDK 核心功能 -->
|
||||
</activity>
|
||||
<!-- Required SDK 核心功能 -->
|
||||
<!-- 可配置android:process参数将PushService放在其他进程中 -->
|
||||
<service
|
||||
android:name="cn.jpush.android.service.PushService"
|
||||
@@ -149,13 +152,15 @@
|
||||
<action android:name="cn.jpush.android.intent.PushService" />
|
||||
<action android:name="cn.jpush.android.intent.PUSH_TIME" />
|
||||
</intent-filter>
|
||||
</service> <!-- since 3.0.9 Required SDK 核心功能 -->
|
||||
</service>
|
||||
<!-- since 3.0.9 Required SDK 核心功能 -->
|
||||
<provider
|
||||
android:name="cn.jpush.android.service.DataProvider"
|
||||
android:authorities="com.uiui.appstore.DataProvider"
|
||||
android:exported="false"
|
||||
android:process=":pushcore"
|
||||
tools:replace="android:authorities" /> <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
|
||||
tools:replace="android:authorities" />
|
||||
<!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
|
||||
<!-- 若不启用该功能可删除该组件,将不拉起其他应用也不能被其他应用拉起 -->
|
||||
<service
|
||||
android:name="cn.jpush.android.service.DaemonService"
|
||||
@@ -166,18 +171,21 @@
|
||||
|
||||
<category android:name="com.uiui.appstore" />
|
||||
</intent-filter>
|
||||
</service> <!-- since 3.1.0 Required SDK 核心功能 -->
|
||||
</service>
|
||||
<!-- since 3.1.0 Required SDK 核心功能 -->
|
||||
<provider
|
||||
android:name="cn.jpush.android.service.DownloadProvider"
|
||||
android:authorities="com.uiui.appstore.DownloadProvider"
|
||||
android:exported="true"
|
||||
tools:replace="android:authorities" /> <!-- Required SDK核心功能 -->
|
||||
tools:replace="android:authorities" />
|
||||
<!-- Required SDK核心功能 -->
|
||||
<receiver
|
||||
android:name="cn.jpush.android.service.PushReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter android:priority="1000">
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> <!-- Required 显示通知栏 -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />
|
||||
<!-- Required 显示通知栏 -->
|
||||
<category android:name="com.uiui.appstore" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
@@ -191,7 +199,8 @@
|
||||
|
||||
<data android:scheme="package" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- Required SDK核心功能 -->
|
||||
</receiver>
|
||||
<!-- Required SDK核心功能 -->
|
||||
<receiver
|
||||
android:name="cn.jpush.android.service.AlarmReceiver"
|
||||
android:exported="false" /> <!-- since 3.3.0 Required SDK核心功能 -->
|
||||
@@ -214,20 +223,27 @@
|
||||
<intent-filter>
|
||||
<action android:name="cn.jiguang.user.service.action" />
|
||||
</intent-filter>
|
||||
</service> <!-- User defined. For test only 用户自定义的广播接收器 -->
|
||||
</service>
|
||||
<!-- User defined. For test only 用户自定义的广播接收器 -->
|
||||
<receiver
|
||||
android:name="com.uiui.appstore.jpush.MyReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="cn.jpush.android.intent.REGISTRATION" /> <!-- Required 用户注册SDK的intent -->
|
||||
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> <!-- Required 用户接收SDK消息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> <!-- Required 用户接收SDK通知栏信息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> <!-- Required 用户打开自定义通知栏的intent -->
|
||||
<action android:name="cn.jpush.android.intent.CONNECTION" /> <!-- 接收网络变化 连接/断开 since 1.6.3 -->
|
||||
<action android:name="cn.jpush.android.intent.REGISTRATION" />
|
||||
<!-- Required 用户注册SDK的intent -->
|
||||
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" />
|
||||
<!-- Required 用户接收SDK消息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" />
|
||||
<!-- Required 用户接收SDK通知栏信息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" />
|
||||
<!-- Required 用户打开自定义通知栏的intent -->
|
||||
<action android:name="cn.jpush.android.intent.CONNECTION" />
|
||||
<!-- 接收网络变化 连接/断开 since 1.6.3 -->
|
||||
<category android:name="com.uiui.appstore" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
|
||||
</receiver>
|
||||
<!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
|
||||
<receiver android:name="com.uiui.appstore.jpush.MyJPushMessageReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
|
||||
|
||||
@@ -61,7 +61,7 @@ public class LocalAppAdapter extends RecyclerView.Adapter<LocalAppAdapter.LocalA
|
||||
if (localApp.isCanUnintall()) {
|
||||
holder.btnDownLoad.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
holder.btnDownLoad.setVisibility(View.GONE);
|
||||
holder.btnDownLoad.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
holder.btnDownLoad.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -36,9 +36,11 @@ import java.io.OutputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
@@ -638,12 +640,25 @@ public class ApkUtils {
|
||||
}
|
||||
}
|
||||
|
||||
static HashSet<String> fuxiaoyingApp = new HashSet<String>() {{
|
||||
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<LocalApp> getLocalApp(Context context) {
|
||||
List<LocalApp> appList = new ArrayList<>();
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN, null);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
List<ResolveInfo> 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<String> 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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user