1.2.6 准备分包
This commit is contained in:
254
app/build.gradle
254
app/build.gradle
@@ -1,11 +1,28 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
static def appName() {
|
||||
return "小酷守护"
|
||||
static String getBuildConfigFieldValue(def variant, def fiedName) {
|
||||
def properties = variant.productFlavors[0].properties
|
||||
def name = properties.get("name")
|
||||
if (name != variant.flavorName) {
|
||||
return ""
|
||||
}
|
||||
def configs = properties.get("buildConfigFields")
|
||||
def address = null
|
||||
for (Map.Entry<String, Object> item : configs) {
|
||||
def key = item.key
|
||||
if (key == fiedName) {
|
||||
address = item.value
|
||||
}
|
||||
}
|
||||
if (address == null) return ""
|
||||
def field = address.getClass().getDeclaredField("value")
|
||||
field.setAccessible(true)
|
||||
return field.get(address).toString().replace("\"", "")
|
||||
}
|
||||
|
||||
|
||||
static def releaseTime() {
|
||||
return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault())
|
||||
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
|
||||
}
|
||||
|
||||
android {
|
||||
@@ -13,11 +30,9 @@ android {
|
||||
buildToolsVersion "29.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.uiuipad.find"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 19
|
||||
versionName "1.1.8"
|
||||
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -46,6 +61,57 @@ android {
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
//多版本
|
||||
productFlavors {
|
||||
kuxin {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.uiuipad.find"
|
||||
versionCode 27
|
||||
versionName "1.2.6"
|
||||
buildConfigField "String", "app_name", '"小酷守护"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333898263",
|
||||
ALIPUSH_SECRET: "e1b374229ffe479eb34ba74432b7e454",
|
||||
]
|
||||
}
|
||||
|
||||
aiKuxin {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.aole.safe"
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
buildConfigField "String", "app_name", '"守护中心"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333982424",
|
||||
ALIPUSH_SECRET: "c831992e2de743dcad66f5ec420798a4",
|
||||
]
|
||||
}
|
||||
|
||||
aigo {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.safeos.ae"
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
buildConfigField "String", "app_name", '"安全守护"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333982410",
|
||||
ALIPUSH_SECRET: "6d8785a73d904055ac00f84d83400be4",
|
||||
]
|
||||
}
|
||||
|
||||
phone {
|
||||
flavorDimensions "default"
|
||||
applicationId "com.dangsafe.kf"
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
buildConfigField "String", "app_name", '"时间守护"'
|
||||
manifestPlaceholders = [
|
||||
ALIPUSH_KEY : "333982833",
|
||||
ALIPUSH_SECRET: "67a5bf10515947459c04fc000367feca",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
//签名
|
||||
signingConfigs {
|
||||
//iPlay50 mini,iPlay50 android13 共用签名
|
||||
@@ -81,43 +147,173 @@ android {
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
G10P {
|
||||
storeFile file("keystore/G10PMTK11.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "G10PMTK11"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
teclast8183 {
|
||||
storeFile file("keystore/TeclastMTK12.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "TeclastMTK12"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
}
|
||||
|
||||
UnisocS6688 {
|
||||
storeFile file("keystore/UnisocS6688Userdebug.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "unisocs6688userdebug"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
Aigo1071 {
|
||||
storeFile file("keystore/Aigo1071.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "aigo1071"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
Aigo1071Debug.initWith(debug)
|
||||
Aigo1071Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.Aigo1071
|
||||
buildConfigField "String", "platform", '"W8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
Aigo1071Release.initWith(release)
|
||||
Aigo1071Release {
|
||||
signingConfig signingConfigs.Aigo1071
|
||||
buildConfigField "String", "platform", '"W8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
UnisocS6688Debug.initWith(debug)
|
||||
UnisocS6688Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.UnisocS6688
|
||||
buildConfigField "String", "platform", '"S6688"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
UnisocS6688Release.initWith(release)
|
||||
UnisocS6688Release {
|
||||
signingConfig signingConfigs.UnisocS6688
|
||||
buildConfigField "String", "platform", '"S6688"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
teclast8183Debug.initWith(debug)
|
||||
teclast8183Debug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.teclast8183
|
||||
buildConfigField "String", "platform", '"A11MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
teclast8183Release.initWith(release)
|
||||
teclast8183Release {
|
||||
signingConfig signingConfigs.teclast8183
|
||||
buildConfigField "String", "platform", '"A11MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
G10PDebug.initWith(debug)
|
||||
G10PDebug {
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.G10P
|
||||
buildConfigField "String", "platform", '"G10P"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
G10PRelease.initWith(release)
|
||||
G10PRelease {
|
||||
signingConfig signingConfigs.G10P
|
||||
buildConfigField "String", "platform", '"G10P"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
}
|
||||
|
||||
U807UserDebug.initWith(release)
|
||||
U807UserDebug {
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
// versionNameSuffix "-debug"
|
||||
// debuggable true
|
||||
signingConfig signingConfigs.U807UserDebug
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
U807Debug.initWith(debug)
|
||||
U807Debug {
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.U807
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
U807Release.initWith(release)
|
||||
U807Release {
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
signingConfig signingConfigs.U807
|
||||
buildConfigField "String", "platform", '"U807"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
iPlay50SEDebug.initWith(debug)
|
||||
iPlay50SEDebug {
|
||||
buildConfigField "String", "platform", '"iPaly50SE"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.iPlay50SE
|
||||
buildConfigField "String", "platform", '"MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
iPlay50SERelease.initWith(release)
|
||||
iPlay50SERelease {
|
||||
buildConfigField "String", "platform", '"iPaly50SE"'
|
||||
signingConfig signingConfigs.iPlay50SE
|
||||
buildConfigField "String", "platform", '"MTK8183"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59"
|
||||
]
|
||||
}
|
||||
|
||||
debug {
|
||||
@@ -127,10 +323,14 @@ android {
|
||||
zipAlignEnabled true
|
||||
minifyEnabled false
|
||||
signingConfig signingConfigs.iPlay50mini
|
||||
buildConfigField "String", "platform", '"iPlay50mini"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
if (outputFile != null) {
|
||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
def fileName = "${getBuildConfigFieldValue(variant, "app_name")}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
output.outputFileName = fileName
|
||||
}
|
||||
}
|
||||
@@ -146,18 +346,46 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.iPlay50mini
|
||||
buildConfigField "String", "platform", '"iPlay50mini"'
|
||||
manifestPlaceholders = [
|
||||
Baidu_AK: "YCmfZSw54O992lChzS3c4roYioitT54h"
|
||||
]
|
||||
// 将release版本的包名重命名,加上版本及日期
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = ""
|
||||
if (outputFile != null) {
|
||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
def fileName = "${getBuildConfigFieldValue(variant, "app_name")}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
||||
output.outputFileName = new File(outputFile, fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
kuxin {
|
||||
res {
|
||||
srcDirs 'src/res'
|
||||
}
|
||||
}
|
||||
aiKuxin {
|
||||
res {
|
||||
srcDirs 'src/aiKuxin/res'
|
||||
}
|
||||
}
|
||||
aigo {
|
||||
res {
|
||||
srcDirs 'src/aigo/res'
|
||||
}
|
||||
}
|
||||
phone {
|
||||
res {
|
||||
srcDirs 'src/phone/res'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
path file('CMakeLists.txt')
|
||||
|
||||
BIN
app/keystore/Aigo1071.jks
Normal file
BIN
app/keystore/Aigo1071.jks
Normal file
Binary file not shown.
BIN
app/keystore/G10PMTK11.jks
Normal file
BIN
app/keystore/G10PMTK11.jks
Normal file
Binary file not shown.
BIN
app/keystore/TeclastMTK12.jks
Normal file
BIN
app/keystore/TeclastMTK12.jks
Normal file
Binary file not shown.
BIN
app/keystore/UnisocS6688Userdebug.jks
Normal file
BIN
app/keystore/UnisocS6688Userdebug.jks
Normal file
Binary file not shown.
3
app/src/aiKuxin/res/values/strings.xml
Normal file
3
app/src/aiKuxin/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">守护中心</string>
|
||||
</resources>
|
||||
3
app/src/aigo/res/values/strings.xml
Normal file
3
app/src/aigo/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">安全守护</string>
|
||||
</resources>
|
||||
@@ -85,7 +85,11 @@
|
||||
android:name=".activity.AudioActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/activity_styles" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.NoticeActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:theme="@style/FloatingWindow" />
|
||||
<service
|
||||
android:name=".service.main.MainService"
|
||||
android:enabled="true"
|
||||
@@ -183,33 +187,43 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<service
|
||||
android:name=".push.alipush.AliMessageIntentService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<!-- <service-->
|
||||
<!-- android:name=".push.alipush.AliMessageIntentService"-->
|
||||
<!-- android:exported="false">-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="com.alibaba.sdk.android.push.RECEIVE" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- </service>-->
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider>
|
||||
|
||||
<!-- 请填写你自己的- appKey -->
|
||||
<meta-data
|
||||
android:name="com.alibaba.app.appkey"
|
||||
android:value="333898263" />
|
||||
android:value="${ALIPUSH_KEY}" />
|
||||
<!-- 请填写你自己的appSecret -->
|
||||
<meta-data
|
||||
android:name="com.alibaba.app.appsecret"
|
||||
android:value="e1b374229ffe479eb34ba74432b7e454" />
|
||||
android:value="${ALIPUSH_SECRET}" />
|
||||
|
||||
<!-- AK鉴权 -->
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="yhlCxeBmZ1I7ZO50Emw4ptPtcYGOFg59" />
|
||||
android:value="${Baidu_AK}" />
|
||||
<!-- http://lbsyun.baidu.com/apiconsole/key -->
|
||||
</application>
|
||||
|
||||
|
||||
105
app/src/main/java/com/uiuipad/find/activity/NoticeActivity.java
Normal file
105
app/src/main/java/com/uiuipad/find/activity/NoticeActivity.java
Normal file
@@ -0,0 +1,105 @@
|
||||
package com.uiuipad.find.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioManager;
|
||||
import android.media.MediaPlayer;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.PowerManager;
|
||||
import android.os.Vibrator;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.uiuipad.find.R;
|
||||
import com.uiuipad.find.util.ApkUtils;
|
||||
import com.uiuipad.find.util.WakeUpUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class NoticeActivity extends AppCompatActivity {
|
||||
private String TAG = NoticeActivity.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.positive)
|
||||
TextView positive;
|
||||
|
||||
private int mId;
|
||||
private MediaPlayer mMediaPlayer;
|
||||
private PowerManager mPowerManager;
|
||||
private PowerManager.WakeLock mWakeLock;
|
||||
private AudioManager mAudioManager;
|
||||
|
||||
private Vibrator mVibrator;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_notice);
|
||||
ButterKnife.bind(this);
|
||||
|
||||
Intent intent = getIntent();
|
||||
mId = intent.getIntExtra("id", -1);
|
||||
|
||||
mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
mWakeLock = mPowerManager.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "WakeAndLock");
|
||||
mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||
mWakeLock.acquire(60 * 1000L);
|
||||
long[] pattern = {1000, 5000, 1000, 5000};
|
||||
mVibrator.vibrate(pattern, 0);
|
||||
WakeUpUtils.wakeUpAndUnlockScreen(this);
|
||||
|
||||
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||
int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM);
|
||||
mAudioManager.setStreamVolume(AudioManager.STREAM_ALARM, maxVolume, AudioManager.FLAG_PLAY_SOUND);
|
||||
// mMediaPlayer.setAudioAttributes(new AudioAttributes.Builder().setContentType(AudioAttributes.USAGE_ALARM).build());
|
||||
Uri uri = Uri.parse("android.resource://com.uiui.aios/raw/new_alarm_clock");
|
||||
mMediaPlayer = new MediaPlayer();
|
||||
try {
|
||||
mMediaPlayer.setDataSource(getApplicationContext(), uri);
|
||||
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
|
||||
mMediaPlayer.prepare();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mMediaPlayer.setLooping(true);
|
||||
// 开始播放
|
||||
// mMediaPlayer.start();
|
||||
|
||||
positive.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ApkUtils.openPackage(NoticeActivity.this,"com.uiuipad.zyinfo","com.uiuipad.zyinfo.activity.main.MainActivity");
|
||||
mVibrator.cancel();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mMediaPlayer != null) {
|
||||
if (mMediaPlayer.isPlaying()) {
|
||||
mMediaPlayer.stop();
|
||||
}
|
||||
mMediaPlayer.release();
|
||||
mMediaPlayer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.uiuipad.find.comm.CommonConfig;
|
||||
import com.uiuipad.find.network.NetInterfaceManager;
|
||||
import com.uiuipad.find.util.BitmapUtils;
|
||||
import com.uiuipad.find.util.CXAESUtil;
|
||||
import com.uiuipad.find.util.ControlUtils;
|
||||
import com.uiuipad.find.util.Utils;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
@@ -81,6 +82,7 @@ public class MainAPresenter implements MainAContact.Presenter {
|
||||
mView.setSnInfoNotFound();
|
||||
} else if (code == 403) {
|
||||
mView.setSnInfoNoBind();
|
||||
ControlUtils.disableSystemControl(mContext);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -179,6 +179,12 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
mPresenter.getQrCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mPresenter.detachView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == KeyEvent.ACTION_DOWN) {
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.uiuipad.find.hook;
|
||||
|
||||
import android.app.IActivityController;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
public class KuxinActivityController extends IActivityController.Stub {
|
||||
private static final String TAG = KuxinActivityController.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public boolean activityStarting(Intent intent, String pkg) {
|
||||
Log.e(TAG, "activityStarting: " + pkg + ", intent= " + intent);
|
||||
//retrun false;//false 则不会启动,直接返回。
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activityResuming(String pkg) {
|
||||
Log.e(TAG, "activityResuming: " + pkg);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int appEarlyNotResponding(String processName, int pid, String annotation) {
|
||||
Log.e(TAG, "appEarlyNotResponding: " + processName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appCrashed(String processName, int pid, String shortMsg, String longMsg, long timeMillis, String stackTrace) {
|
||||
Log.e(TAG, "appCrashed: " + processName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int appNotResponding(String processName, int pid, String processStats) {
|
||||
Log.e(TAG, "appNotResponding: " + processName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int systemNotResponding(String msg) {
|
||||
Log.e(TAG, "systemNotResponding: " + msg);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class NetInterfaceManager {
|
||||
}
|
||||
|
||||
mUploadIconPkgs = mMMKV.decodeStringSet(uploadIconPkgsKey, new HashSet<>());
|
||||
Log.e("init", "NetInterfaceManager: mUploadIconPkgs = "+mUploadIconPkgs );
|
||||
Log.e("init", "NetInterfaceManager: mUploadIconPkgs = " + mUploadIconPkgs);
|
||||
}
|
||||
|
||||
private String getCacheDir() {
|
||||
@@ -282,25 +282,25 @@ public class NetInterfaceManager {
|
||||
|
||||
public Observable<BaseResponse> getUpdateSnInfoControl() {
|
||||
Map<String, RequestBody> params = new HashMap<>();
|
||||
params.put("wifi_name", NetInterfaceManager.convertToRequestBody(Utils.getWifiSsid(mContext)));
|
||||
params.put("wifi_signal", NetInterfaceManager.convertToRequestBody(Utils.getWifiRssi(mContext)));
|
||||
params.put("battery", NetInterfaceManager.convertToRequestBody(Utils.getBattery(mContext)));
|
||||
params.put("bluetooth", NetInterfaceManager.convertToRequestBody(Utils.getBluetoothList()));
|
||||
params.put("memory", NetInterfaceManager.convertToRequestBody(Utils.getUsedMemoryString(mContext)));
|
||||
params.put("storage", NetInterfaceManager.convertToRequestBody(Utils.getDataTotalSize(mContext)));
|
||||
params.put("memory_use", NetInterfaceManager.convertToRequestBody(Utils.getUsedMemoryString(mContext)));
|
||||
params.put("storage_use", NetInterfaceManager.convertToRequestBody(Utils.getUsedSize(mContext)));
|
||||
params.put("sn", NetInterfaceManager.convertToRequestBody(Utils.getSerial()));
|
||||
params.put("xiaoku_version", NetInterfaceManager.convertToRequestBody(BuildConfig.VERSION_NAME));
|
||||
params.put("xiaoku_version_time", NetInterfaceManager.convertToRequestBody(ApkUtils.getAppLastUpdateTime(mContext, BuildConfig.APPLICATION_ID)));
|
||||
params.put("desktop_version", NetInterfaceManager.convertToRequestBody(ApkUtils.getAPPVersionName(mContext, "com.uiuipad.os")));
|
||||
params.put("desktop_version_time", NetInterfaceManager.convertToRequestBody(ApkUtils.getAppLastUpdateTime(mContext, "com.uiuipad.os")));
|
||||
params.put("browser_version", NetInterfaceManager.convertToRequestBody(ApkUtils.getAPPVersionName(mContext, "com.uiuipad.browser")));
|
||||
params.put("browser_version_time", NetInterfaceManager.convertToRequestBody(ApkUtils.getAppLastUpdateTime(mContext, "com.uiuipad.browser")));
|
||||
params.put("imei", NetInterfaceManager.convertToRequestBody(Utils.getIMEI(mContext)));
|
||||
params.put("model", NetInterfaceManager.convertToRequestBody(Build.MODEL));
|
||||
params.put("system", NetInterfaceManager.convertToRequestBody(Build.VERSION.RELEASE));
|
||||
params.put("rom", NetInterfaceManager.convertToRequestBody(Utils.getCustomVersion()));
|
||||
params.put("wifi_name", convertToRequestBody(Utils.getWifiSsid(mContext)));
|
||||
params.put("wifi_signal", convertToRequestBody(Utils.getWifiRssi(mContext)));
|
||||
params.put("battery", convertToRequestBody(Utils.getBattery(mContext)));
|
||||
params.put("bluetooth", convertToRequestBody(Utils.getBluetoothList()));
|
||||
params.put("memory", convertToRequestBody(Utils.getUsedMemoryString(mContext)));
|
||||
params.put("storage", convertToRequestBody(Utils.getDataTotalSize(mContext)));
|
||||
params.put("memory_use", convertToRequestBody(Utils.getUsedMemoryString(mContext)));
|
||||
params.put("storage_use", convertToRequestBody(Utils.getUsedSize(mContext)));
|
||||
params.put("sn", convertToRequestBody(Utils.getSerial()));
|
||||
params.put("xiaoku_version", convertToRequestBody(BuildConfig.VERSION_NAME));
|
||||
params.put("xiaoku_version_time", convertToRequestBody(ApkUtils.getAppLastUpdateTime(mContext, BuildConfig.APPLICATION_ID)));
|
||||
params.put("desktop_version", convertToRequestBody(ApkUtils.getAPPVersionName(mContext, "com.uiuipad.os")));
|
||||
params.put("desktop_version_time", convertToRequestBody(ApkUtils.getAppLastUpdateTime(mContext, "com.uiuipad.os")));
|
||||
params.put("browser_version", convertToRequestBody(ApkUtils.getAPPVersionName(mContext, "com.uiuipad.browser")));
|
||||
params.put("browser_version_time", convertToRequestBody(ApkUtils.getAppLastUpdateTime(mContext, "com.uiuipad.browser")));
|
||||
params.put("imei", convertToRequestBody(Utils.getIMEI(mContext)));
|
||||
params.put("model", convertToRequestBody(Build.MODEL));
|
||||
params.put("system", convertToRequestBody(Build.VERSION.RELEASE));
|
||||
params.put("rom", convertToRequestBody(Utils.getCustomVersion()));
|
||||
|
||||
return mRetrofit.create(UpdateSnInfoApi.class)
|
||||
.updateSnInfo(params)
|
||||
@@ -510,7 +510,7 @@ public class NetInterfaceManager {
|
||||
|
||||
public void updateAppInstall() {
|
||||
String jsonString = ApkUtils.getInstallAppInfo(mContext);
|
||||
NetInterfaceManager.getInstance().getUpdateAppInstallControl(jsonString)
|
||||
getInstance().getUpdateAppInstallControl(jsonString)
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
@@ -569,7 +569,7 @@ public class NetInterfaceManager {
|
||||
//设置一个file文件
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), fileBody);
|
||||
Map<String, RequestBody> params = new HashMap<>();
|
||||
params.put("package", NetInterfaceManager.convertToRequestBody(packageInfo.packageName));
|
||||
params.put("package", convertToRequestBody(packageInfo.packageName));
|
||||
Call<BaseResponse> call = getUploadAppImgApi().uploadAppImg(params, body);
|
||||
call.enqueue(new RetryCallback<BaseResponse>(call, 1, 30 * 1000) {
|
||||
@Override
|
||||
|
||||
@@ -4,8 +4,11 @@ import android.annotation.SuppressLint;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
@@ -17,10 +20,12 @@ import com.baidu.location.BDAbstractLocationListener;
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.baidu.location.LocationClient;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.uiuipad.find.activity.AudioActivity;
|
||||
import com.uiuipad.find.activity.NoticeActivity;
|
||||
import com.uiuipad.find.bean.kuxin.AppInfo;
|
||||
import com.uiuipad.find.bean.kuxin.BaseResponse;
|
||||
import com.uiuipad.find.bean.kuxin.SnSetting;
|
||||
@@ -33,9 +38,11 @@ import com.uiuipad.find.network.RetryCallback;
|
||||
import com.uiuipad.find.service.ManagerService;
|
||||
import com.uiuipad.find.service.main.MainService;
|
||||
import com.uiuipad.find.util.ApkUtils;
|
||||
import com.uiuipad.find.util.CacheUtils;
|
||||
import com.uiuipad.find.util.Camera2BackgroundUtil;
|
||||
import com.uiuipad.find.util.CmdUtil;
|
||||
import com.uiuipad.find.util.ControlUtils;
|
||||
import com.uiuipad.find.util.FileUtils;
|
||||
import com.uiuipad.find.util.TimeUtils;
|
||||
import com.uiuipad.find.util.ToastUtil;
|
||||
import com.uiuipad.find.util.Utils;
|
||||
@@ -136,6 +143,8 @@ public class PushManager {
|
||||
private static final String FORCE_STOP_APP = "32";
|
||||
/*恢复出厂*/
|
||||
private static final String RESTORE_FACTORY = "33";
|
||||
/*作业提醒*/
|
||||
private static final String HOMEWORK_NOTIFY = "34";
|
||||
|
||||
|
||||
private PushManager(Context context) {
|
||||
@@ -227,11 +236,13 @@ public class PushManager {
|
||||
case BROWSER_CONTROL:
|
||||
break;
|
||||
case APP_REINSTALL:
|
||||
installApp(extras);
|
||||
break;
|
||||
case APP_UNINSTALL:
|
||||
uninstallApp(extras);
|
||||
break;
|
||||
case CLEAR_APP_CACHE:
|
||||
|
||||
clearAppData(extras);
|
||||
break;
|
||||
case FRONT_CAMERA:
|
||||
ToastUtil.debugShow("收到管控:行为查看");
|
||||
@@ -248,10 +259,54 @@ public class PushManager {
|
||||
ToastUtil.debugShow("收到管控:恢复出厂");
|
||||
ControlUtils.doMasterClear(mContext);
|
||||
break;
|
||||
case HOMEWORK_NOTIFY: {
|
||||
Intent intent = new Intent(mContext, NoticeActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
private void installApp(String extras) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
|
||||
try {
|
||||
String pkg = jsonObject.get("package").getAsString();
|
||||
String app_url = jsonObject.get("app_url").getAsString();
|
||||
FileUtils.ariaDownload(mContext, app_url, jsonObject);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "installApp: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void clearAppData(String extras) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
|
||||
JsonElement jsonElement = jsonObject.get("package");
|
||||
if (!jsonElement.isJsonNull()) {
|
||||
String pkg = jsonElement.getAsString();
|
||||
try {
|
||||
new CacheUtils().clearApplicationUserData(mContext, pkg);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "clearAppData: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "clearAppData: null json");
|
||||
}
|
||||
}
|
||||
|
||||
private void uninstallApp(String extras) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
|
||||
JsonElement jsonElement = jsonObject.get("package");
|
||||
if (!jsonElement.isJsonNull()) {
|
||||
String pkg = jsonElement.getAsString();
|
||||
ApkUtils.uninstallApp(mContext, pkg);
|
||||
} else {
|
||||
Log.e(TAG, "uninstallApp: null json");
|
||||
}
|
||||
}
|
||||
|
||||
private void setControl(Context context, String type, String extras) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
|
||||
switch (type) {
|
||||
|
||||
@@ -33,17 +33,20 @@ import com.uiuipad.find.comm.CommonConfig;
|
||||
import com.uiuipad.find.network.NetInterfaceManager;
|
||||
import com.uiuipad.find.receiver.APKinstallReceiver;
|
||||
import com.uiuipad.find.receiver.BootReceiver;
|
||||
import com.uiuipad.find.util.AppUtil;
|
||||
import com.uiuipad.find.util.ControlUtils;
|
||||
import com.uiuipad.find.util.TimeUtils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableEmitter;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* @author jgy02
|
||||
@@ -152,12 +155,7 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
@Override
|
||||
public void onNext(String action) {
|
||||
Log.e("killObserver", "onNext: " + action);
|
||||
// ControlUtils.killPackage(ManagerService.this, JGYUtils.PACKAGE_APPSTORE);
|
||||
// int is_activation = Settings.Global.getInt(getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||
// Log.e(TAG, "onReceive: is_activation = " + is_activation);
|
||||
// if (is_activation == 0) {
|
||||
// ControlUtils.killPackage(ManagerService.this, JGYUtils.PACKAGE_OS);
|
||||
// }
|
||||
killApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -171,6 +169,21 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
}
|
||||
};
|
||||
|
||||
private void killApp() {
|
||||
Log.e(TAG, "killApp: ");
|
||||
AppUtil.killPackage(ManagerService.this, "com.jxw.mskt.video");
|
||||
AppUtil.killPackage(ManagerService.this, "com.jxw.teacher.video");
|
||||
AppUtil.killPackage(ManagerService.this, "com.jxw.newyouer.video");
|
||||
AppUtil.killPackage(ManagerService.this, "com.jxw.question");
|
||||
AppUtil.killPackage(ManagerService.this, "com.jxw.launcher");
|
||||
AppUtil.killPackage(ManagerService.this, "com.uiui.zysn");
|
||||
AppUtil.killPackage(ManagerService.this, "com.uiui.sn");
|
||||
AppUtil.killPackage(ManagerService.this, "com.uiui.appstore");
|
||||
AppUtil.killPackage(ManagerService.this, "com.uiui.zy");
|
||||
AppUtil.killPackage(ManagerService.this, "com.uiui.zyappstore");
|
||||
AppUtil.killPackage(ManagerService.this, "com.sohu.inputmethod.sogou");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
@@ -204,6 +217,34 @@ public class ManagerService extends Service implements NetworkUtils.OnNetworkSta
|
||||
.throttleLast(3, TimeUnit.MINUTES)
|
||||
// .throttleLast(3, TimeUnit.SECONDS)
|
||||
.subscribe(killObserver);
|
||||
|
||||
Observable.interval(0, 3, TimeUnit.MINUTES)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Long>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("interval", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull Long aLong) {
|
||||
Log.e("interval", "onNext: " + aLong);
|
||||
if (!ControlUtils.getScreenStatus(ManagerService.this)) {
|
||||
killApp();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("interval", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("interval", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -105,13 +105,14 @@ public class SocketService extends Service implements NetworkUtils.OnNetworkStat
|
||||
case Intent.ACTION_USER_PRESENT:
|
||||
case Intent.ACTION_SCREEN_ON:
|
||||
mHandler.post(heartBeatRunnable);//开启心跳检测
|
||||
sendMsg(1);
|
||||
// sendMsg(1);
|
||||
break;
|
||||
case Intent.ACTION_SCREEN_OFF:
|
||||
case Intent.ACTION_SHUTDOWN:
|
||||
case Intent.ACTION_FACTORY_RESET:
|
||||
case Intent.ACTION_MASTER_CLEAR:
|
||||
sendMsg(0);
|
||||
// sendMsg(0);
|
||||
closeConnect();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -200,13 +201,14 @@ public class SocketService extends Service implements NetworkUtils.OnNetworkStat
|
||||
public void sendMsg() {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("sn", Utils.getSerial());
|
||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
if (!pm.isScreenOn()) {
|
||||
jsonObject.addProperty("is_online", 0);
|
||||
//熄屏状态
|
||||
} else {
|
||||
jsonObject.addProperty("is_online", 1);
|
||||
}
|
||||
jsonObject.addProperty("type", "ping");
|
||||
// PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
// if (!pm.isScreenOn()) {
|
||||
// jsonObject.addProperty("is_online", 0);
|
||||
// //熄屏状态
|
||||
// } else {
|
||||
// jsonObject.addProperty("is_online", 1);
|
||||
// }
|
||||
if (null != client) {
|
||||
Log.i("JWebSocketClientService", "发送的消息:" + jsonObject.toString());
|
||||
client.send(jsonObject.toString());
|
||||
@@ -266,7 +268,9 @@ public class SocketService extends Service implements NetworkUtils.OnNetworkStat
|
||||
} else {
|
||||
//如果client已为空,重新初始化连接
|
||||
client = null;
|
||||
initSocketClient();
|
||||
if (ControlUtils.getScreenStatus(SocketService.this)) {
|
||||
initSocketClient();
|
||||
}
|
||||
}
|
||||
//每隔一定的时间,对长连接进行一次心跳检测
|
||||
if (ControlUtils.getScreenStatus(SocketService.this)) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.uiuipad.find.service.main;
|
||||
|
||||
import android.app.ActivityManagerNative;
|
||||
import android.app.IActivityManager;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
@@ -11,6 +13,7 @@ import android.content.IntentFilter;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -36,9 +39,11 @@ import com.uiuipad.find.bean.aolelearn.AoleAppInfo;
|
||||
import com.uiuipad.find.bean.jxw.JxwResponse;
|
||||
import com.uiuipad.find.comm.CommonConfig;
|
||||
import com.uiuipad.find.gson.GsonUtils;
|
||||
import com.uiuipad.find.hook.KuxinActivityController;
|
||||
import com.uiuipad.find.network.NetInterfaceManager;
|
||||
import com.uiuipad.find.util.ApkUtils;
|
||||
import com.uiuipad.find.util.AppUtil;
|
||||
import com.uiuipad.find.util.Utils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -88,7 +93,9 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
|
||||
@Override
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
mPresenter.updateSnInfo();
|
||||
if (Utils.isScreenOn(MainService.this)) {
|
||||
mPresenter.updateSnInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,7 +111,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
}
|
||||
}
|
||||
|
||||
private static KillAppListener killAppListener;
|
||||
// private static KillAppListener killAppListener;
|
||||
|
||||
public interface KillAppListener {
|
||||
void killApp(String action);
|
||||
@@ -113,12 +120,12 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
private final ObservableOnSubscribe<String> killSubscribe = new ObservableOnSubscribe<String>() {
|
||||
@Override
|
||||
public void subscribe(ObservableEmitter emitter) throws Exception {
|
||||
killAppListener = new KillAppListener() {
|
||||
@Override
|
||||
public void killApp(String action) {
|
||||
emitter.onNext(action);
|
||||
}
|
||||
};
|
||||
// killAppListener = new KillAppListener() {
|
||||
// @Override
|
||||
// public void killApp(String action) {
|
||||
// emitter.onNext(action);
|
||||
// }
|
||||
// };
|
||||
}
|
||||
};
|
||||
|
||||
@@ -136,8 +143,12 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
AppUtil.killPackage(MainService.this, "com.jxw.newyouer.video");
|
||||
AppUtil.killPackage(MainService.this, "com.jxw.question");
|
||||
AppUtil.killPackage(MainService.this, "com.jxw.launcher");
|
||||
AppUtil.killPackage(MainService.this, "com.uiui.zyappstore");
|
||||
AppUtil.killPackage(MainService.this, "com.uiui.zysn");
|
||||
AppUtil.killPackage(MainService.this, "com.uiui.sn");
|
||||
AppUtil.killPackage(MainService.this, "com.uiui.appstore");
|
||||
AppUtil.killPackage(MainService.this, "com.uiui.zy");
|
||||
AppUtil.killPackage(MainService.this, "com.uiui.zyappstore");
|
||||
AppUtil.killPackage(MainService.this, "com.sohu.inputmethod.sogou");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,10 +171,20 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
mPresenter.attachView(this);
|
||||
Aria.download(this).register();
|
||||
|
||||
Observable.create(killSubscribe)
|
||||
.throttleLast(3, TimeUnit.MINUTES)
|
||||
// .throttleLast(3, TimeUnit.SECONDS)
|
||||
.subscribe(killObserver);
|
||||
// Observable.create(killSubscribe)
|
||||
// .throttleLast(3, TimeUnit.MINUTES)
|
||||
//// .throttleLast(3, TimeUnit.SECONDS)
|
||||
// .subscribe(killObserver);
|
||||
|
||||
// IActivityManager activityManager = ActivityManagerNative.getDefault();
|
||||
// try {
|
||||
// activityManager.setActivityController(new KuxinActivityController(), true);
|
||||
// } catch (RemoteException e) {
|
||||
// Log.e(TAG, "setActivityController: " + e.getMessage());
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// IServiceManager iServiceManager = ServiceManagerNative.asInterface();
|
||||
// ServiceManager serviceManager = getSystemService()
|
||||
|
||||
registerReceivers();
|
||||
NetworkUtils.registerNetworkStatusChangedListener(this);
|
||||
@@ -281,7 +302,7 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
case Intent.ACTION_SHUTDOWN:
|
||||
case Intent.ACTION_FACTORY_RESET:
|
||||
case Intent.ACTION_MASTER_CLEAR:
|
||||
killAppListener.killApp(action);
|
||||
// killAppListener.killApp(action);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -367,7 +388,8 @@ public class MainService extends Service implements MainSContact.MainView, Netwo
|
||||
@Override
|
||||
public void getSelfAppFinish() {
|
||||
NetInterfaceManager.getInstance().updateAppInstall();
|
||||
mPresenter.getSnIsActivation();
|
||||
// TODO: 2023/11/29 暂时屏蔽
|
||||
// mPresenter.getSnIsActivation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -175,7 +175,7 @@ public class ControlUtils {
|
||||
public static void disableSystemControl(Context context) {
|
||||
setUsbState(context, 0);
|
||||
setBluetooth(context, 1);
|
||||
setDeveloperOptions(context, 0);
|
||||
setDeveloperOptions(context, 1);
|
||||
setCanReset(context, 1);
|
||||
setActionBar(context, 1);
|
||||
// setNavigationBar(context, 0);
|
||||
@@ -220,7 +220,7 @@ public class ControlUtils {
|
||||
Settings.Global.putInt(context.getContentResolver(), Settings.Global.ADB_ENABLED, status);
|
||||
}
|
||||
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, status);
|
||||
if (status == 1) {
|
||||
if (status == 0) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("qch_developeroptions_close");
|
||||
intent.setPackage("com.android.settings");
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.util.Log;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.io.File;
|
||||
@@ -15,11 +16,13 @@ import java.math.BigInteger;
|
||||
import java.security.MessageDigest;
|
||||
|
||||
public class FileUtils {
|
||||
private static final String TAG = FileUtils.class.getSimpleName();
|
||||
|
||||
public static String getDownLoadPath(Context context) {
|
||||
String path = ContextCompat.getExternalFilesDirs(context, Environment.DIRECTORY_DOWNLOADS)[0].getAbsolutePath();
|
||||
return path + File.separator;
|
||||
}
|
||||
String path = ContextCompat.getExternalFilesDirs(context, Environment.DIRECTORY_DOWNLOADS)[0].getAbsolutePath();
|
||||
return path + File.separator;
|
||||
}
|
||||
|
||||
public static String getFileNamefromURL(String url) {
|
||||
int position = url.lastIndexOf("/");
|
||||
return url.substring(position + 1);
|
||||
@@ -62,7 +65,18 @@ public class FileUtils {
|
||||
|
||||
public static void ariaDownload(Context context, String url, JsonObject jsonObject) {
|
||||
String fileName = getFileNamefromURL(url);
|
||||
String urlMD5 = jsonObject.get("app_md5").getAsString();
|
||||
JsonElement jsonElement = jsonObject.get("app_md5");
|
||||
if (jsonElement == null || jsonElement.isJsonNull()) {
|
||||
Log.e(TAG, "ariaDownload: have not app_md5");
|
||||
Aria.download(context)
|
||||
.load(url) //读取下载地址
|
||||
.setFilePath(getDownLoadPath(context) + fileName)
|
||||
.ignoreFilePathOccupy()
|
||||
.setExtendField(jsonObject.toString())
|
||||
.create(); //启动下载}
|
||||
return;
|
||||
}
|
||||
String urlMD5 = jsonElement.getAsString();
|
||||
Log.e("ariaDownload", "urlMD5=" + urlMD5);
|
||||
File file = new File(getDownLoadPath(context) + fileName);
|
||||
if (file.exists() && !file.isDirectory()) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.uiuipad.find.BuildConfig;
|
||||
import com.uiuipad.find.R;
|
||||
|
||||
public class ToastUtil {
|
||||
private static String TAG = ToastUtil.class.getSimpleName();
|
||||
private static final String TAG = ToastUtil.class.getSimpleName();
|
||||
|
||||
public static void show(final String msg) {
|
||||
ToastUtils.make()
|
||||
|
||||
13
app/src/main/res/drawable/default_botton_bg.xml
Normal file
13
app/src/main/res/drawable/default_botton_bg.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/default_blue" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="@dimen/dp_32" />
|
||||
|
||||
<padding
|
||||
android:bottom="0dp"
|
||||
android:left="@dimen/dp_16"
|
||||
android:right="@dimen/dp_16"
|
||||
android:top="0dp" />
|
||||
</shape>
|
||||
@@ -187,7 +187,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_serial"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:gravity="right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:ellipsize="end"
|
||||
@@ -198,6 +199,7 @@
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_serial1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -236,7 +238,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:gravity="right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:text="@string/unknown"
|
||||
@@ -244,6 +247,7 @@
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_app"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_app_version1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
@@ -317,7 +321,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_system_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:gravity="right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:text="@string/unknown"
|
||||
@@ -325,6 +330,7 @@
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_ota"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_system_version1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -187,7 +187,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_serial"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:gravity="right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:ellipsize="end"
|
||||
@@ -198,6 +199,7 @@
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_serial1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -236,14 +238,16 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:gravity="right"
|
||||
android:text="@string/unknown"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_app"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_app_version1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
@@ -317,7 +321,8 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_system_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:gravity="right"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:text="@string/unknown"
|
||||
@@ -325,6 +330,7 @@
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_ota"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_system_version1"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
|
||||
103
app/src/main/res/layout/activity_notice.xml
Normal file
103
app/src/main/res/layout/activity_notice.xml
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_240"
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/bg_dialog"
|
||||
android:minWidth="@dimen/dp_240"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dp_8"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="@dimen/dp_30"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:maxWidth="@dimen/dp_80"
|
||||
android:maxHeight="@dimen/dp_80"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:text="作业提醒"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textStyle="bold"
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="@dimen/dp_3"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:minHeight="@dimen/dp_50"
|
||||
android:text="您有新的作业,请查看"
|
||||
android:textColor="#9a9a9a"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.404" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/message">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/positive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/default_botton_bg"
|
||||
android:gravity="center"
|
||||
android:paddingTop="@dimen/dp_2"
|
||||
android:paddingBottom="@dimen/dp_2"
|
||||
android:singleLine="true"
|
||||
android:text="查看"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -42,4 +42,16 @@
|
||||
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||
</style>
|
||||
|
||||
<style name="FloatingWindow" parent="Theme.AppCompat.NoActionBar">
|
||||
<!--背景颜色及和透明程度-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<!--是否去除标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!--是否去除边框-->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!--是否浮现在activity之上-->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!--是否模糊-->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
9
app/src/main/res/xml/file_paths.xml
Normal file
9
app/src/main/res/xml/file_paths.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<external-path
|
||||
name="files_root"
|
||||
path="Android/data/com.herenit.webdoc/" />
|
||||
<external-path
|
||||
name="external_storage_root"
|
||||
path="." />
|
||||
</paths>
|
||||
4
app/src/main/res/xml/network.xml
Normal file
4
app/src/main/res/xml/network.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
||||
3
app/src/phone/res/values/strings.xml
Normal file
3
app/src/phone/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">时间守护</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user