version:1.0.7
update: bugfixes:改为系统应用,删除无用类
This commit is contained in:
@@ -15,8 +15,8 @@ android {
|
||||
applicationId "com.xxpatx.os"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 7
|
||||
versionName "1.0.6"
|
||||
versionCode 1008
|
||||
versionName "1.0.7"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -51,12 +51,22 @@ android {
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
mtk {
|
||||
storeFile file("keystore/xueshibaoos.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "xueshibaoos"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
tuixin {
|
||||
storeFile file("keystore/tuixin.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "universal"
|
||||
keyPassword "123456"
|
||||
v2SigningEnabled false
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +81,7 @@ android {
|
||||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.tuixin
|
||||
signingConfig signingConfigs.mtk
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
if (outputFile != null) {
|
||||
@@ -91,7 +101,7 @@ android {
|
||||
//前一部分代表系统默认的android程序的混淆文件,该文件已经包含了基本的混淆声明,后一个文件是自己的定义混淆文件
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
//签名
|
||||
signingConfig signingConfigs.tuixin
|
||||
signingConfig signingConfigs.mtk
|
||||
//将release版本的包名重命名,加上版本及日期
|
||||
applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
|
||||
BIN
app/keystore/xueshibaoos.jks
Normal file
BIN
app/keystore/xueshibaoos.jks
Normal file
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.xxpatx.os">
|
||||
package="com.xxpatx.os"
|
||||
android:sharedUserId="android.uid.system">
|
||||
|
||||
<queries>
|
||||
<intent>
|
||||
@@ -124,52 +125,12 @@
|
||||
android:restoreAnyVersion="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity
|
||||
android:name=".activity.SplashActivity"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:enabled="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:resizeableActivity="true"
|
||||
android:resumeWhilePausing="true"
|
||||
android:stateNotNeeded="true"
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.HOME" />-->
|
||||
<!-- <category android:name="android.intent.category.DEFAULT" />-->
|
||||
<!-- <category android:name="android.intent.category.MONKEY" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER_APP" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.main.deprecated.OldMainActivity"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize"
|
||||
android:enabled="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:exported="true"
|
||||
android:resizeableActivity="true"
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:stateNotNeeded="true"
|
||||
android:taskAffinity=""
|
||||
android:windowSoftInputMode="adjustPan">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.HOME" />-->
|
||||
<!-- <category android:name="android.intent.category.DEFAULT" />-->
|
||||
<!-- <category android:name="android.intent.category.MONKEY" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER_APP" />-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.main.MainActivity"
|
||||
android:exported="true"
|
||||
android:excludeFromRecents="true"
|
||||
android:resizeableActivity="true"
|
||||
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
@@ -208,8 +169,8 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.dailyapp.DailyAppActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask" />
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.weather.WeatherActivity"
|
||||
android:launchMode="singleTask"
|
||||
@@ -221,8 +182,8 @@
|
||||
android:theme="@style/activity_styles" />
|
||||
<activity
|
||||
android:name=".activity.emergency.EmergencyActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask" />
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.noti.NoticeActivity"
|
||||
android:excludeFromRecents="true"
|
||||
@@ -254,13 +215,13 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.selectnumber.SelectNumberActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask" />
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.screenlock.ScreenLockActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:configChanges="keyboardHidden"
|
||||
android:launchMode="singleTask" />
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.InformationDetailsActivity"
|
||||
android:launchMode="singleTask"
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.xxpatx.os.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.main.deprecated.OldMainActivity;
|
||||
import com.xxpatx.os.activity.main.deprecated.PhoneMainActivity;
|
||||
import com.xxpatx.os.base.BaseDataBindingActivity;
|
||||
import com.xxpatx.os.utils.Utils;
|
||||
|
||||
|
||||
public class SplashActivity extends BaseDataBindingActivity {
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
DataBindingUtil.setContentView(this, R.layout.activity_splash);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化视图
|
||||
*/
|
||||
@Override
|
||||
public void initView() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Utils.isTablet(SplashActivity.this)) {
|
||||
startActivity(new Intent(SplashActivity.this, OldMainActivity.class));
|
||||
} else {
|
||||
startActivity(new Intent(SplashActivity.this, PhoneMainActivity.class));
|
||||
}
|
||||
finish();
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据
|
||||
*/
|
||||
@Override
|
||||
public void initData() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -235,8 +235,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
// | View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
// | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
;
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.xxpatx.os.activity.main.deprecated;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.main.MainActivity;
|
||||
|
||||
@Deprecated
|
||||
public class OldMainActivity extends MainActivity {
|
||||
private static final String TAG = "OldMainActivity";
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Log.e(TAG, "onCreate: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
DataBindingUtil.setContentView(this, R.layout.activity_main_old);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
Log.e(TAG, "onNewIntent: getAction = " + intent.getAction());
|
||||
Log.e(TAG, "onNewIntent: getCategories = " + intent.getCategories());
|
||||
Log.e(TAG, "onNewIntent: getFlags = " + intent.getFlags());
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.xxpatx.os.activity.main.deprecated;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.emergency.EmergencyActivity;
|
||||
import com.xxpatx.os.activity.main.MainActivity;
|
||||
import com.xxpatx.os.databinding.ActivityMainBinding;
|
||||
import com.xxpatx.os.utils.ApkUtils;
|
||||
|
||||
@Deprecated
|
||||
public class PhoneMainActivity extends MainActivity {
|
||||
private static final String TAG = "PhoneMainActivity";
|
||||
|
||||
ActivityMainBinding mBinding;
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
|
||||
|
||||
mBinding.cl0.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(Intent.ACTION_DIAL));
|
||||
}
|
||||
});
|
||||
mBinding.cl1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ApkUtils.openPackage(PhoneMainActivity.this, "com.android.mms");
|
||||
}
|
||||
});
|
||||
mBinding.cl2.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ApkUtils.openPackage(PhoneMainActivity.this, "com.mediatek.camera");
|
||||
}
|
||||
});
|
||||
mBinding.cl3.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(PhoneMainActivity.this, EmergencyActivity.class));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import com.xxpatx.os.BuildConfig;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.activity.screenlock.ScreenLockActivity;
|
||||
import com.xxpatx.os.activity.dailyapp.DailyAppActivity;
|
||||
import com.xxpatx.os.activity.main.deprecated.OldMainActivity;
|
||||
import com.xxpatx.os.base.BaseFragment;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.bean.DesktopIcon;
|
||||
@@ -362,7 +361,7 @@ public class AppListFragment extends BaseFragment {
|
||||
if (!ShortcutUtils.getInstance().deleteShortcut(shortcutPkgInfo.getId(), shortcutPkgInfo.getPackageName())) {
|
||||
Toaster.show("删除失败");
|
||||
}
|
||||
mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
// mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
shortcutDialog.dismiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.content.pm.ResolveInfo;
|
||||
import android.util.Log;
|
||||
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.activity.main.deprecated.OldMainActivity;
|
||||
import com.xxpatx.os.bean.DailyAppBean;
|
||||
import com.xxpatx.os.config.CommonConfig;
|
||||
|
||||
@@ -71,13 +70,13 @@ public class AppStatusManager {
|
||||
public void addHidedApp(String pkg) {
|
||||
this.hidedAppSet.add(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
// mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public void removeHidedApp(String pkg) {
|
||||
this.hidedAppSet.remove(pkg);
|
||||
mMMKV.encode(APP_STATUS_MANAGER_KEY, hidedAppSet);
|
||||
mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
// mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||
}
|
||||
|
||||
public List<DailyAppBean> getPackageList() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xxpatx.os.service.main;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -20,6 +21,7 @@ import com.arialyy.annotations.Download;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.task.DownloadTask;
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
import com.xxpatx.os.BuildConfig;
|
||||
@@ -41,6 +43,7 @@ import com.xxpatx.os.utils.ForegroundAppUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -600,6 +603,35 @@ public class MainService extends BaseRxService
|
||||
isBallShown = true;
|
||||
}
|
||||
|
||||
private void killBackgroundApp() {
|
||||
List<String> pkgList = ApkUtils.queryFilterAppList(this);
|
||||
for (String pkg : pkgList) {
|
||||
if (pkg.equalsIgnoreCase(BuildConfig.APPLICATION_ID)
|
||||
|| "com.xxpatx.sn".equals(pkg)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
killBackgroundProcesses(pkg);
|
||||
}
|
||||
Toaster.show(String.format(getString(R.string.clear_app_size), pkgList.size()));
|
||||
}
|
||||
|
||||
private void killBackgroundProcesses(String packageName) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + packageName);
|
||||
ActivityManager activityManager;
|
||||
try {
|
||||
activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
|
||||
activityManager.killBackgroundProcesses(packageName);
|
||||
Method forceStopPackage = activityManager.getClass()
|
||||
.getDeclaredMethod("forceStopPackage", String.class);
|
||||
forceStopPackage.setAccessible(true);
|
||||
forceStopPackage.invoke(activityManager, packageName);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "killBackgroundProcesses: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private View setUpView() {
|
||||
View view = LayoutInflater.from(this).inflate(R.layout.window_float_ball, null);
|
||||
NiceImageView iv_ball = view.findViewById(R.id.iv_ball);
|
||||
@@ -608,6 +640,7 @@ public class MainService extends BaseRxService
|
||||
public void onClick(View v) {
|
||||
Log.e("iv_ball", "onClick: ");
|
||||
// closeToolWindow();
|
||||
killBackgroundApp();
|
||||
Intent intent = new Intent(MainService.this, MainActivity.class);
|
||||
intent.setAction("android.intent.action.MAIN");
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<string name="accessibility_service_label">孝心平安通讯OS快捷服务</string>
|
||||
<string name="accessibility_service_description">孝心平安通讯OS一键拨打视频</string>
|
||||
<string name="title_activity_settings">Settings</string>
|
||||
<string name="clear_app_size">已清理%d个应用</string>
|
||||
|
||||
<!-- Preference Titles -->
|
||||
<string name="messages_header">Messages</string>
|
||||
|
||||
Reference in New Issue
Block a user