version:3.0.8
fix: update:优化禁用逻辑
This commit is contained in:
@@ -73,8 +73,8 @@ android {
|
||||
|
||||
official {
|
||||
flavorDimensions "default"
|
||||
versionCode 42
|
||||
versionName "3.0.2"
|
||||
versionCode 48
|
||||
versionName "3.0.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,9 +169,38 @@ android {
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
iPlay50SE {
|
||||
storeFile file("keystore/iPlay50SE.keystore")
|
||||
storePassword "123456"
|
||||
keyAlias "iplay50se"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
iPlay50SEDebug.initWith(debug)
|
||||
iPlay50SEDebug {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"ipaly50"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.iPlay50SE
|
||||
}
|
||||
|
||||
iPlay50SERelease.initWith(release)
|
||||
iPlay50SERelease {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"ipaly50"'
|
||||
signingConfig signingConfigs.iPlay50SE
|
||||
}
|
||||
|
||||
unisocDebug.initWith(debug)
|
||||
unisocDebug {
|
||||
manifestPlaceholders = [
|
||||
@@ -233,6 +262,26 @@ android {
|
||||
signingConfig signingConfigs.teclastMTK
|
||||
}
|
||||
|
||||
G6Debug.initWith(debug)
|
||||
G6Debug {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"G6"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.G10P
|
||||
}
|
||||
|
||||
G6Release.initWith(release)
|
||||
G6Release {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"G6"'
|
||||
signingConfig signingConfigs.G10P
|
||||
}
|
||||
|
||||
G13Debug.initWith(debug)
|
||||
G13Debug {
|
||||
manifestPlaceholders = [
|
||||
|
||||
BIN
app/keystore/iPlay50SE.keystore
Normal file
BIN
app/keystore/iPlay50SE.keystore
Normal file
Binary file not shown.
@@ -26,29 +26,29 @@
|
||||
|
||||
<!--百度-->
|
||||
<!-- 这个权限用于进行网络定位-->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<!-- 这个权限用于访问GPS定位-->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位-->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<!-- 获取运营商信息,用于支持提供运营商信息相关的接口-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||
<!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据-->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<!-- 访问网络,网络定位需要上网 -->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- 允许挂载和反挂载文件系统可移动存储 -->
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
|
||||
<!-- 允许程序读取底层系统日志文件 -->
|
||||
<uses-permission android:name="android.permission.READ_LOGS"/>
|
||||
<uses-permission android:name="android.permission.READ_LOGS" />
|
||||
<!-- 允许访问振动设备 -->
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<!-- 允许使用PowerManager的 WakeLocks保持进程在休眠时从屏幕消失 -->
|
||||
<!-- <uses-permission android:name="android.permission.WAKE_LOCK"/>-->
|
||||
<!-- <uses-permission android:name="android.permission.WAKE_LOCK"/>-->
|
||||
<!-- 允许程序读取或写入系统设置 -->
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
|
||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
||||
<!-- android 9.0上使用前台服务,需要添加权限 -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<!-- 用于读取手机当前的状态 -->
|
||||
@@ -56,7 +56,7 @@
|
||||
<!-- 读取缓存数据 -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<!-- 获取模拟定位信息 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
|
||||
|
||||
<uses-permission
|
||||
android:name="android.permission.PACKAGE_USAGE_STATS"
|
||||
@@ -81,15 +81,15 @@
|
||||
<uses-permission android:name="com.fuying.sn.permission.XGPUSH_RECEIVE" />
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS SDK 所需权限 -->
|
||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||
|
||||
<!-- 【常用】 移动推送 TPNS SDK所需权限 -->
|
||||
<!-- <uses-permission android:name="android.permission.WAKE_LOCK" />-->
|
||||
<!-- <uses-permission android:name="android.permission.VIBRATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.WAKE_LOCK" />-->
|
||||
<!-- <uses-permission android:name="android.permission.VIBRATE" />-->
|
||||
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
|
||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||
|
||||
<application
|
||||
@@ -99,10 +99,10 @@
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/ImmerseTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:allowBackup">
|
||||
<activity
|
||||
android:name="com.fuying.sn.activity.main.MainActivity"
|
||||
@@ -117,8 +117,8 @@
|
||||
<activity
|
||||
android:name="com.fuying.sn.activity.SplashActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
</activity>
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<service
|
||||
android:name="com.fuying.sn.service.ControlPanelService"
|
||||
android:enabled="true"
|
||||
@@ -127,8 +127,7 @@
|
||||
<service
|
||||
android:name="com.fuying.sn.service.RemoteService"
|
||||
android:enabled="true"
|
||||
android:exported="true"
|
||||
/>
|
||||
android:exported="true" />
|
||||
|
||||
<service
|
||||
android:name="com.fuying.sn.service.main.MainService"
|
||||
@@ -162,6 +161,7 @@
|
||||
<action android:name="android.intent.action.TIME_TICK" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<receiver
|
||||
android:name="com.fuying.sn.receiver.BootReceiver"
|
||||
android:enabled="true"
|
||||
@@ -198,6 +198,7 @@
|
||||
android:name="com.fuying.sn.receiver.InstallResultReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.fuying.sn.fileprovider"
|
||||
@@ -212,97 +213,14 @@
|
||||
<service
|
||||
android:name="com.baidu.location.f"
|
||||
android:enabled="true"
|
||||
android:process=":remote"/>
|
||||
android:process=":remote" />
|
||||
|
||||
<!-- 应用的其它配置 -->
|
||||
<uses-library
|
||||
android:name="org.apache.http.legacy"
|
||||
android:required="false" />
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS 默认通知 -->
|
||||
<activity
|
||||
android:name="com.tencent.android.tpush.TpnsActivity"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<intent-filter>
|
||||
<data
|
||||
android:host="com.fuying.sn"
|
||||
android:scheme="tpns" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS receiver广播接收 -->
|
||||
<receiver
|
||||
android:name="com.tencent.android.tpush.XGPushReceiver"
|
||||
android:process=":xg_vip_service">
|
||||
<intent-filter android:priority="0x7fffffff">
|
||||
|
||||
<!-- 【必须】 移动推送 TPNS SDK的内部广播 -->
|
||||
<action android:name="com.tencent.android.xg.vip.action.SDK" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.INTERNAL_PUSH_MESSAGE" />
|
||||
<action android:name="com.tencent.android.xg.vip.action.ACTION_SDK_KEEPALIVE" />
|
||||
|
||||
<!-- 【可选】 系统广播:网络切换 -->
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
|
||||
<!-- 【可选】 系统广播:开屏 -->
|
||||
<action android:name="android.intent.action.USER_PRESENT" />
|
||||
|
||||
<!-- 【可选】 一些常用的系统广播,增强移动推送 TPNS service的复活机会,请根据需要选择。当然,您也可以添加App自定义的一些广播让启动service -->
|
||||
<action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
|
||||
<!-- 【必须】移动推送 TPNS service -->
|
||||
<service
|
||||
android:name="com.tencent.android.tpush.service.XGVipPushService"
|
||||
android:persistent="true"
|
||||
android:process=":xg_vip_service" />
|
||||
|
||||
|
||||
<!-- 【必须】通知 service ,android:name 部分改为包名.XGVIP_PUSH_ACTION -->
|
||||
<service
|
||||
android:name="com.tencent.android.tpush.rpc.XGRemoteService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
|
||||
<!-- 【必须】请修改为当前APP名包.XGVIP_PUSH_ACTION -->
|
||||
<action android:name="com.fuying.sn.XGVIP_PUSH_ACTION" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
||||
<!-- 【必须】【注意】authorities 修改为包名.XGVIP_PUSH_AUTH -->
|
||||
<provider
|
||||
android:name="com.tencent.android.tpush.XGPushProvider"
|
||||
android:authorities="com.fuying.sn.XGVIP_PUSH_AUTH"
|
||||
tools:replace="android:authorities" />
|
||||
|
||||
|
||||
<!-- 【必须】【注意】authorities 修改为包名.TPUSH_PROVIDER -->
|
||||
<provider
|
||||
android:name="com.tencent.android.tpush.SettingsContentProvider"
|
||||
android:authorities="com.fuying.sn.TPUSH_PROVIDER"
|
||||
tools:replace="android:authorities" />
|
||||
|
||||
|
||||
<!-- 【可选】用于增强保活能力 -->
|
||||
<provider
|
||||
android:name="com.tencent.android.tpush.XGVipPushKAProvider"
|
||||
android:authorities="com.fuying.sn.AUTH_XGPUSH_KEEPALIVE"
|
||||
android:exported="true"
|
||||
tools:replace="android:exported,android:authorities" />
|
||||
|
||||
|
||||
<!-- 【可选】APP实现的Receiver,用于接收消息透传和操作结果的回调,请根据需要添加 -->
|
||||
|
||||
<!-- YOUR_PACKAGE_PATH.CustomPushReceiver需要改为自己的Receiver: -->
|
||||
<receiver android:name="com.fuying.sn.tpush.MessageReceiver">
|
||||
<intent-filter>
|
||||
@@ -315,18 +233,7 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- MQTT START -->
|
||||
<service
|
||||
android:name="com.tencent.tpns.mqttchannel.services.MqttService"
|
||||
android:exported="false"
|
||||
android:process=":xg_vip_service" />
|
||||
|
||||
<provider
|
||||
android:name="com.tencent.tpns.baseapi.base.SettingsContentProvider"
|
||||
android:authorities="com.fuying.sn.XG_SETTINGS_PROVIDER"
|
||||
android:exported="false"
|
||||
tools:replace="android:authorities" />
|
||||
<!-- MQTT END-->
|
||||
|
||||
<!-- 【必须】 请修改为 APP 的 AccessId,“15”开头的10位数字,中间没空格 -->
|
||||
<meta-data
|
||||
@@ -340,7 +247,6 @@
|
||||
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="${AK}" >
|
||||
</meta-data>
|
||||
android:value="${AK}" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -124,9 +124,11 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
|
||||
setOnClickListener();
|
||||
tv_customversion.setText(JGYUtils.getCustomVersion());
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.iPlay50SEPlatform
|
||||
) {
|
||||
tv_sn.setText("SN:" + Utils.getSerial());
|
||||
}else {
|
||||
} else {
|
||||
tv_sn.setText("IMEI:" + Utils.getIMEI(MainActivity.this));
|
||||
}
|
||||
|
||||
@@ -238,7 +240,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
Log.e(TAG, "onNewIntent: " );
|
||||
Log.e(TAG, "onNewIntent: ");
|
||||
if (REFRESHACTION.equals(intent.getAction())) {
|
||||
mPresenter.getSnInfo();
|
||||
}
|
||||
@@ -375,7 +377,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
class RefreshReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.e("RefreshReceiver", "onReceive: " );
|
||||
Log.e("RefreshReceiver", "onReceive: ");
|
||||
if (REFRESHACTION.equals(intent.getAction())) {
|
||||
mPresenter.getSnInfo();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,6 @@ public class RunningAppManager {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static RunningAppManager mRunningAppManager;
|
||||
private Context mContext;
|
||||
private CacheHelper mCacheHelper;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
public static final String RemainingTimeMap = "RemainingTimeMap_KEY";
|
||||
@@ -84,7 +83,9 @@ public class RunningAppManager {
|
||||
public static final String AllApplUsageTimeMap = "AllAppUsageTimeMap_KEY";
|
||||
|
||||
//剩余时间
|
||||
private long globalRemainingTime = 0L;
|
||||
private long globalRemainingTime;
|
||||
private String GLOBAL_REMAINING_TIME_KEY = "GLOBAL_REMAINING_TIME_KEY";
|
||||
|
||||
//存储每个单独有配置app剩余时间
|
||||
private HashMap<String, AppRunTimeBean> mRemainingTimeMap = new HashMap<>();
|
||||
//存储整机配置app使用时间
|
||||
@@ -92,8 +93,8 @@ public class RunningAppManager {
|
||||
//存储所有app使用时间
|
||||
private HashMap<String, AppUsageTime> mAllAppUsageTime = new HashMap<>();
|
||||
|
||||
public static long minuteTime = 60 * 1000;
|
||||
public static long dayTime = minuteTime * 60 * 24;
|
||||
public static final long minuteTime = 60 * 1000;
|
||||
public static final long dayTime = minuteTime * 60 * 24;
|
||||
|
||||
//日期格式化
|
||||
private static DateFormat dateFormat = new SimpleDateFormat("HH:mm");
|
||||
@@ -110,9 +111,9 @@ public class RunningAppManager {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
}
|
||||
this.mContext = context;
|
||||
this.mCacheHelper = new CacheHelper(context);
|
||||
registerTimeReceiver(mContext);
|
||||
|
||||
globalRemainingTime = mMMKV.decodeLong(GLOBAL_REMAINING_TIME_KEY, 0);
|
||||
String remainsTimeJson = mMMKV.decodeString(RemainingTimeMap, "");
|
||||
Log.i(TAG, "remainsTimeJson: " + remainsTimeJson);
|
||||
Gson gson = new Gson();
|
||||
@@ -230,7 +231,7 @@ public class RunningAppManager {
|
||||
Log.i(TAG, "checkForegroundAppName: getAppPackageName = " + appPackageName);
|
||||
if (appPackageName.equals(topPackage)) {
|
||||
Log.i(TAG, "checkForegroundAppName: 没有切换应用");
|
||||
if (RunningAppManager.getInstance().inControlTime(appPackageName)) {
|
||||
if (inControlTime(appPackageName)) {
|
||||
removeTask(topPackage);
|
||||
killApp();
|
||||
gotoLauncher();
|
||||
@@ -259,13 +260,13 @@ public class RunningAppManager {
|
||||
onClickTime = System.currentTimeMillis() / 1000;
|
||||
// NetInterfaceManager.getInstance().sendRunningApp();
|
||||
AppUsedTimeUtils.getInstance().setStart_time(onClickTime);
|
||||
if (RunningAppManager.getInstance().inControlTime(appPackageName)) {
|
||||
if (inControlTime(appPackageName)) {
|
||||
Log.i(TAG, "checkForegroundAppName: 没有剩余时间2");
|
||||
removeTask(topPackage);
|
||||
killApp();
|
||||
gotoLauncher();
|
||||
} else {
|
||||
RunningAppManager.getInstance().recordPackageOpenTime(topPackage);
|
||||
recordPackageOpenTime(topPackage);
|
||||
Log.i(TAG, "checkForegroundAppName: 没有管控2");
|
||||
}
|
||||
}
|
||||
@@ -467,6 +468,10 @@ public class RunningAppManager {
|
||||
|
||||
public void setGlobalUsageTime(long time) {
|
||||
this.globalRemainingTime = time;
|
||||
if (globalRemainingTime < 0) {
|
||||
globalRemainingTime = 0;
|
||||
}
|
||||
mMMKV.encode(GLOBAL_REMAINING_TIME_KEY, globalRemainingTime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -577,6 +582,18 @@ public class RunningAppManager {
|
||||
}
|
||||
boolean havaConfigure = TimeControlManager.getInstance().havaConfigure(pkg);
|
||||
MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl();
|
||||
|
||||
Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime);
|
||||
if (globalRemainingTime <= 0) {
|
||||
if (machineControl != null) {
|
||||
if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show("今日可使用时间已用完");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (havaConfigure) {
|
||||
AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg);
|
||||
//全局配置的
|
||||
@@ -593,6 +610,8 @@ public class RunningAppManager {
|
||||
appUsageTime.setUsageTime(appUsageTime.getUsageTime() + 1);
|
||||
}
|
||||
mGlobalUsageTime.put(pkg, appUsageTime);
|
||||
} else if (appTimeControl.getTc_use_type() == 0) {
|
||||
return;
|
||||
} else {
|
||||
mGlobalUsageTime.remove(pkg);
|
||||
}
|
||||
@@ -622,6 +641,7 @@ public class RunningAppManager {
|
||||
mRemainingTimeMap.put(pkg, timeBean);
|
||||
appTimeControl.setToday_time(remainingTime);
|
||||
TimeControlManager.getInstance().setAppTimeControl(pkg, appTimeControl);
|
||||
setGlobalUsageTime(globalRemainingTime - time);
|
||||
} else {
|
||||
if (machineControl == null) {
|
||||
return;
|
||||
@@ -684,6 +704,9 @@ public class RunningAppManager {
|
||||
this.add("com.uiui.info");
|
||||
this.add("com.tt.ttutils");
|
||||
this.add(JGYUtils.fuxiaoying);
|
||||
this.add("com.sprd.engineermode");
|
||||
this.add("com.teclast.update");
|
||||
this.add("com.incar.update");
|
||||
}};
|
||||
|
||||
/**
|
||||
@@ -703,9 +726,9 @@ public class RunningAppManager {
|
||||
if (isControl == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean havaConfigure = TimeControlManager.getInstance().havaConfigure(pkg);
|
||||
MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl();
|
||||
|
||||
if (havaConfigure) {
|
||||
//有单独设置 不管是分类整机还是其他都是这个设置
|
||||
AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg);
|
||||
@@ -715,8 +738,34 @@ public class RunningAppManager {
|
||||
return true;
|
||||
}
|
||||
if (appTimeControl.getTc_use_type() == 0) {
|
||||
Log.e(TAG, "inControlTime: " + "应用始终可用");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime);
|
||||
if (globalRemainingTime <= 0) {
|
||||
if (machineControl != null) {
|
||||
if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show("今日可使用时间已用完");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (havaConfigure) {
|
||||
//有单独设置 不管是分类整机还是其他都是这个设置
|
||||
AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg);
|
||||
// if (appTimeControl.getIs_control() == 0) {
|
||||
// ToastUtil.show("应用已被禁用");
|
||||
// Log.e(TAG, "inControlTime: " + "应用已被禁用");
|
||||
// return true;
|
||||
// }
|
||||
// if (appTimeControl.getTc_use_type() == 0) {
|
||||
// Log.e(TAG, "inControlTime: " + "应用始终可用");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
//打开时间段管控
|
||||
if (appTimeControl.getIs_part() == 1) {
|
||||
boolean inControlTime = inControlTime(machineControl, appTimeControl);
|
||||
@@ -725,7 +774,6 @@ public class RunningAppManager {
|
||||
Log.i(TAG, "inControlTime: " + "应用在管控时间段不能打开" + appTimeControl.time_part.toString());
|
||||
ToastUtil.show("该应用" + partTime2String(appTimeControl));
|
||||
Log.e(TAG, "inControlTime: " + "该应用" + partTime2String(appTimeControl));
|
||||
|
||||
return true;
|
||||
} else {
|
||||
if (appTimeControl.getIs_quota() == 0) {
|
||||
@@ -829,6 +877,10 @@ public class RunningAppManager {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param pkg
|
||||
* @return json数据
|
||||
*/
|
||||
public String getDisableContent(String pkg) {
|
||||
// NetInterfaceManager.getInstance().getMyAppList(new NetInterfaceManager.MyAppListCallback() {
|
||||
// @Override
|
||||
@@ -850,6 +902,17 @@ public class RunningAppManager {
|
||||
// }
|
||||
boolean havaConfigure = TimeControlManager.getInstance().havaConfigure(pkg);
|
||||
MachineControl machineControl = TimeControlManager.getInstance().getGlobalMachineControl();
|
||||
|
||||
Log.e(TAG, "inControlTime: globalRemainingTime = " + globalRemainingTime);
|
||||
if (globalRemainingTime <= 0) {
|
||||
if (machineControl != null) {
|
||||
if (machineControl.getIs_part() == 0 && machineControl.getIs_quota() == 0) {
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
if (havaConfigure) {
|
||||
//有单独设置 不管是分类整机还是其他都是这个设置
|
||||
AppTimeControl appTimeControl = TimeControlManager.getInstance().getAppTimeControl(pkg);
|
||||
@@ -877,7 +940,7 @@ public class RunningAppManager {
|
||||
} else {
|
||||
if (appTimeControl.getIs_quota() == 0) {
|
||||
//要求设置了管控时间段没有设置使用额度也可以使用
|
||||
return "没有管控";
|
||||
return "";
|
||||
}
|
||||
if (getAppRemainingTime(pkg) <= 0) {
|
||||
//没有剩余时间
|
||||
@@ -904,7 +967,7 @@ public class RunningAppManager {
|
||||
}
|
||||
} else {
|
||||
if (appTimeControl.getIs_quota() == 0) {
|
||||
return "没有管控";
|
||||
return "";
|
||||
}
|
||||
if (getAppRemainingTime(pkg) <= 0) {
|
||||
//没有剩余时间
|
||||
@@ -1183,7 +1246,7 @@ public class RunningAppManager {
|
||||
}
|
||||
//禁用时段需要满足所有
|
||||
boolean inPartTime = inPartTimes.indexOf(true) >= 0;
|
||||
return !inPartTime;
|
||||
return inPartTime;
|
||||
} else if (partType == 1) {
|
||||
//开放时段只需要满足一个就行
|
||||
for (PartTime partTime : partTimeHashSet) {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class TimeControlManager {
|
||||
public void setGlobalMachineControl(MachineControl machineControl) {
|
||||
this.mGlobalMachineControl = machineControl;
|
||||
if (machineControl != null) {
|
||||
RunningAppManager.getInstance().setGlobalUsageTime(machineControl.getRest_time());
|
||||
RunningAppManager.getInstance().setGlobalUsageTime(machineControl.getToday_time());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,12 +130,13 @@ public class AmapManager {
|
||||
default:
|
||||
}
|
||||
}
|
||||
Log.e(TAG, "AmapAddress: " + (String) SPUtils.get(mContext, "AmapAddress", "-"));
|
||||
Log.e(TAG, "AmapError: " + (String) SPUtils.get(mContext, "AmapError", "-"));
|
||||
Log.e(TAG, "AmapAddress: " + SPUtils.get(mContext, "AmapAddress", "-"));
|
||||
Log.e(TAG, "AmapError: " + SPUtils.get(mContext, "AmapError", "-"));
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-gps");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "-network");
|
||||
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED, "");
|
||||
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.ASSISTED_GPS_ENABLED, 0);
|
||||
mLocationClient.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -194,6 +195,7 @@ public class AmapManager {
|
||||
Log.e(TAG, "onLocationChanged: " + "定位失败");
|
||||
SPUtils.put(mContext, "AmapError", sb);
|
||||
Log.e(TAG, "onLocDiagnosticMessage: " + sb);
|
||||
mLocationClient.stop();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -631,9 +631,11 @@ public class NetInterfaceManager {
|
||||
} else if (code == 300) {
|
||||
mCacheHelper.put(UrlAddress.SNINFO, "");
|
||||
SPUtils.put(mContext, CommonConfig.isLogined, 0);
|
||||
Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0);
|
||||
} else if (code == 401) {
|
||||
mCacheHelper.put(UrlAddress.SNINFO, "");
|
||||
SPUtils.put(mContext, CommonConfig.isLogined, 2);
|
||||
Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,6 +675,10 @@ public class NetInterfaceManager {
|
||||
set.add(JGYUtils.MTK8515Tag);
|
||||
} else if (platform == JGYUtils.G13Platform) {
|
||||
set.add(JGYUtils.G13Tag);
|
||||
} else if (platform == JGYUtils.G6Platform) {
|
||||
set.add(JGYUtils.G6Tag);
|
||||
} else if (platform == JGYUtils.iPlay50SEPlatform) {
|
||||
set.add(JGYUtils.iPlay50SETag);
|
||||
}
|
||||
});
|
||||
clearAndAppendTags(set);
|
||||
@@ -809,7 +815,7 @@ public class NetInterfaceManager {
|
||||
public void checkDeviceType(int type) {
|
||||
switch (type) {
|
||||
case cElderlyUsers:
|
||||
getElderlyUsersApp();
|
||||
// getElderlyUsersApp();
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@@ -1873,49 +1879,6 @@ public class NetInterfaceManager {
|
||||
|
||||
}
|
||||
});
|
||||
// getQueryAllAppControl()
|
||||
// .subscribe(new Observer<BaseResponse<List<AppInfo>>>() {
|
||||
// @Override
|
||||
// public void onSubscribe(@NonNull Disposable d) {
|
||||
// Log.e("getAllappPackage", "onSubscribe: ");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(@NonNull BaseResponse<List<AppInfo>> listBaseResponse) {
|
||||
// int code = listBaseResponse.code;
|
||||
// if (code == 200) {
|
||||
// Log.e("getAllappPackage", "onNext: " + listBaseResponse);
|
||||
// List<AppInfo> appInfoList = listBaseResponse.data;
|
||||
// if (null != appInfoList && appInfoList.size() != 0) {
|
||||
// mMMKV.encode(UrlAddress.GET_ALL_PACKAGE, GsonUtils.toJSONString(appInfoList));
|
||||
// HashSet<String> allAppPkg = new HashSet<>();
|
||||
// for (AppInfo appInfo : appInfoList) {
|
||||
// allAppPkg.add(appInfo.getApp_package());
|
||||
// }
|
||||
// String allPkgSet = String.join(",", allAppPkg);
|
||||
// Settings.System.putString(crv, CommonConfig.ONLY_SHORTCUT_LIST, allPkgSet);
|
||||
// ApkUtils.writeAppPackageList(mContext, allPkgSet);
|
||||
// getAppStart(appInfoList);
|
||||
// } else {
|
||||
// mMMKV.encode(UrlAddress.GET_ALL_PACKAGE, "");
|
||||
// ApkUtils.writeAppPackageList(mContext, "");
|
||||
// }
|
||||
// } else {
|
||||
// mMMKV.encode(UrlAddress.GET_ALL_PACKAGE, "");
|
||||
// ApkUtils.writeAppPackageList(mContext, "");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(@NonNull Throwable e) {
|
||||
// Log.e("getAllappPackage", "onError: " + e.getMessage());
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// Log.e("getAllappPackage", "onComplete: ");
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
public void getForceInstall(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, CompleteCallback callback) {
|
||||
@@ -2093,6 +2056,7 @@ public class NetInterfaceManager {
|
||||
String data = new Gson().toJson(systemSettingsBaseResponse.data.getUser());
|
||||
ControlManager.getInstance().setSystemSetting(data);
|
||||
} else {
|
||||
Settings.System.putInt(mContext.getContentResolver(), CommonConfig.KEY_IS_CONTROL, 0);
|
||||
ControlManager.getInstance().setDisableSetting();
|
||||
}
|
||||
} else {
|
||||
@@ -2427,7 +2391,7 @@ public class NetInterfaceManager {
|
||||
|
||||
|
||||
public void getSnTimeControl(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, CompleteCallback callback) {
|
||||
ConnectMode connectMode = ConnectMode.ONE_MINUTE;
|
||||
ConnectMode connectMode = ConnectMode.DEFAULT;
|
||||
if (refresh) {
|
||||
connectMode = ConnectMode.DEFAULT;
|
||||
}
|
||||
@@ -2477,7 +2441,7 @@ public class NetInterfaceManager {
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<MachineControl> machineControlBaseResponse) {
|
||||
Log.e("getSnTimeControlObserver", "onNext: ");
|
||||
Log.e("getSnTimeControlObserver", "onNext: " + machineControlBaseResponse);
|
||||
if (machineControlBaseResponse.code == 200) {
|
||||
MachineControl machineControl = machineControlBaseResponse.data;
|
||||
TimeControlManager.getInstance().setGlobalMachineControl(machineControl);
|
||||
@@ -2637,6 +2601,9 @@ public class NetInterfaceManager {
|
||||
Log.e(TAG, "installOverallApp: " + packageList);
|
||||
for (OverallAppBean overallAppBean : overallAppBeanList) {
|
||||
String packages = overallAppBean.getApp_package();
|
||||
if (JGYUtils.fuyingApp.contains(packages)) {
|
||||
continue;
|
||||
}
|
||||
String url = overallAppBean.getApp_url();
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
continue;
|
||||
|
||||
@@ -68,10 +68,10 @@ public class APKinstallReceiver extends BroadcastReceiver {
|
||||
newAppListener.setNewAppListener(packageName);
|
||||
if (JGYUtils.PACKAGE_APPSTORE.equals(packageName)) {
|
||||
//启动应用市场
|
||||
JGYUtils.getInstance().wakeUpDeviceInfo();
|
||||
// JGYUtils.getInstance().wakeUpDeviceInfo();
|
||||
} else if (JGYUtils.PACKAGE_UPDATETOOLS.equals(packageName)) {
|
||||
//启动升级组件
|
||||
JGYUtils.getInstance().wakeUpUpdateTools();
|
||||
// JGYUtils.getInstance().wakeUpUpdateTools();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public class RemoteService extends Service {
|
||||
|
||||
@Override
|
||||
public boolean inControl(String pkg) throws RemoteException {
|
||||
Log.e(TAG, "inControl: " + RunningAppManager.getInstance().inControlTime(pkg));
|
||||
return RunningAppManager.getInstance().inControlTime(pkg);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,23 +125,23 @@ public class MainSPresenter implements MainSContact.Presenter {
|
||||
NetInterfaceManager.getInstance().getSnInfo(true, getLifecycle(), new NetInterfaceManager.ObserverCallback() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("getSnInfo", "onSubscribe: ");
|
||||
Log.e("getSnInfom", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse response) {
|
||||
Log.e("getSnInfo", "onNext: ");
|
||||
Log.e("getSnInfom", "onNext: " + response);
|
||||
mView.setSnInfo(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("getSnInfo", "onError: " + e.getMessage());
|
||||
Log.e("getSnInfom", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getSnInfo", "onComplete: ");
|
||||
Log.e("getSnInfom", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
mPresenter.getSnInfo();
|
||||
mPresenter.getAppAndWhite();
|
||||
SPUtils.put(MainService.this, CommonConfig.JGY_FIRST_BOOT, 1);
|
||||
tPushInit();
|
||||
}
|
||||
}
|
||||
}, 15000);
|
||||
@@ -242,6 +243,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void onReceiveLocation(BDLocation bdLocation) {
|
||||
Log.e("initConfig", "onReceiveLocation: ");
|
||||
locationClient.stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -784,6 +784,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
NetInterfaceManager.getInstance().getSystemSettings();
|
||||
break;
|
||||
case ACTION_WHOLE_MACHINE_QUOTA:
|
||||
NetInterfaceManager.getInstance().getSystemSettings();
|
||||
NetInterfaceManager.getInstance().getAppTimeControl();
|
||||
NetInterfaceManager.getInstance().getSnTimeControl();
|
||||
break;
|
||||
@@ -1022,7 +1023,6 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
}
|
||||
|
||||
synchronized private void unintallApk(Context context, String jsonString) {
|
||||
int sn_id = (int) SPUtils.get(context, "sn_id", -1);
|
||||
JsonObject object = GsonUtils.getJsonObject(jsonString);
|
||||
String packageName = object.get("app_package").getAsString();
|
||||
// 台电设备不删除无法静默卸载
|
||||
@@ -1030,7 +1030,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
|
||||
ToastUtil.debugShow("收到应用卸载消息:包名" + packageName);
|
||||
if (!"".equals(packageName) && !packageName.equals(context.getApplicationContext().getPackageName())) {
|
||||
if (!ApkUtils.isAvailable(context.getApplicationContext(), packageName)) {
|
||||
// NetInterfaceManager.getInstance().setAppuninstallInfo(sn_id, packageName);
|
||||
|
||||
} else {
|
||||
ApkUtils.uninstallApp(context, packageName);
|
||||
}
|
||||
|
||||
@@ -97,6 +97,9 @@ public class JGYUtils {
|
||||
public static final int MTK8515Platform = 6;
|
||||
public static final int G13Platform = 7;
|
||||
public static final int UnknowPlatform = 0;
|
||||
public static final int iPlay50SEPlatform = 8;
|
||||
public static final int G6Platform = 10;
|
||||
|
||||
|
||||
public static final String MTKTag = "MTK";
|
||||
public static final String ZhanruiTag = "展锐";
|
||||
@@ -104,6 +107,8 @@ public class JGYUtils {
|
||||
public static final String T30PROTag = "T30PRO";
|
||||
public static final String MTK8515Tag = "8515";
|
||||
public static final String G13Tag = "G13";
|
||||
public static final String iPlay50SETag = "ipaly50SE";
|
||||
public static final String G6Tag = "G6";
|
||||
|
||||
|
||||
private HashSet<String> ownApp = new HashSet<String>() {{
|
||||
@@ -159,6 +164,21 @@ public class JGYUtils {
|
||||
public static final String growthspace = "com.pengren.growthspace";
|
||||
public static final String pandaabc = "com.pandaabc.stu";
|
||||
public static final String qibenyi = "com.goer.fuying";
|
||||
public static final String word = "com.fuying.word";
|
||||
|
||||
public static Set<String> fuyingApp = new HashSet<String>() {{
|
||||
this.add(fxyywgj);
|
||||
this.add(gkwxhd);
|
||||
this.add(fuxiaoying);
|
||||
this.add(moshujia);
|
||||
this.add(english);
|
||||
this.add(zhiduoke);
|
||||
this.add(aobama);
|
||||
this.add(growthspace);
|
||||
this.add(pandaabc);
|
||||
this.add(qibenyi);
|
||||
this.add(word);
|
||||
}};
|
||||
|
||||
public static final String FUXIAOYING_KEY = "fuxiaoying_update_key";
|
||||
|
||||
@@ -499,6 +519,12 @@ public class JGYUtils {
|
||||
} else if (G13Tag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "G13");
|
||||
return G13Platform;
|
||||
} else if (G6Tag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "G6");
|
||||
return G6Platform;
|
||||
} else if (iPlay50SETag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "ipaly50SE");
|
||||
return iPlay50SEPlatform;
|
||||
} else {
|
||||
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||
return UnknowPlatform;
|
||||
@@ -532,6 +558,10 @@ public class JGYUtils {
|
||||
getAppPlatformCallback.AppPlatform(MTK8515Platform);
|
||||
} else if (G13Tag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(G13Platform);
|
||||
} else if (G6Tag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(G6Platform);
|
||||
} else if (iPlay50SETag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(iPlay50SEPlatform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
@@ -543,6 +573,8 @@ public class JGYUtils {
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.T30ProPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK8515Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G6Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.iPlay50SEPlatform
|
||||
) {
|
||||
return getProperty("ro.build.display.id", "获取失败");
|
||||
} else {
|
||||
|
||||
@@ -615,7 +615,9 @@ public class Utils {
|
||||
* @return
|
||||
*/
|
||||
public static String getSerial() {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.iPlay50SEPlatform
|
||||
) {
|
||||
return getSn();
|
||||
} else {
|
||||
return JGYUtils.getInstance().getIMEI();
|
||||
|
||||
Reference in New Issue
Block a user