package mrkang.keeplivesample;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Build;
import android.os.PowerManager;
import android.provider.Settings;
import android.support.annotation.NonNull;
import java.util.ArrayList;
import java.util.List;
public class IntentWrapper {
//Android 7.0+ Doze 模式
protected static final int DOZE = 98;
//华为 自启管理
protected static final int HUAWEI = 99;
//华为 锁屏清理
protected static final int HUAWEI_GOD = 100;
//小米 自启动管理
protected static final int XIAOMI = 101;
//小米 神隐模式
protected static final int XIAOMI_GOD = 102;
//三星 5.0/5.1 自启动应用程序管理
protected static final int SAMSUNG_L = 103;
//魅族 自启动管理
protected static final int MEIZU = 104;
//魅族 待机耗电管理
protected static final int MEIZU_GOD = 105;
//Oppo 自启动管理
protected static final int OPPO = 106;
//三星 6.0+ 未监视的应用程序管理
protected static final int SAMSUNG_M = 107;
//Oppo 自启动管理(旧版本系统)
protected static final int OPPO_OLD = 108;
//Vivo 后台高耗电
protected static final int VIVO_GOD = 109;
//金立 应用自启
protected static final int GIONEE = 110;
//乐视 自启动管理
protected static final int LETV = 111;
//乐视 应用保护
protected static final int LETV_GOD = 112;
//酷派 自启动管理
protected static final int COOLPAD = 113;
//联想 后台管理
protected static final int LENOVO = 114;
//联想 后台耗电优化
protected static final int LENOVO_GOD = 115;
//中兴 自启管理
protected static final int ZTE = 116;
//中兴 锁屏加速受保护应用
protected static final int ZTE_GOD = 117;
protected static List<IntentWrapper> sIntentWrapperList;
public static List<IntentWrapper> getIntentWrapperList() {
if (sIntentWrapperList == null) {
if (!DaemonEnv.sInitialized) return new ArrayList<>();
sIntentWrapperList = new ArrayList<>();
//Android 7.0+ Doze 模式
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
PowerManager pm = (PowerManager) DaemonEnv.sApp.getSystemService(Context.POWER_SERVICE);
boolean ignoringBatteryOptimizations = pm.isIgnoringBatteryOptimizations(DaemonEnv.sApp.getPackageName());
if (!ignoringBatteryOptimizations) {
Intent dozeIntent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
dozeIntent.setData(Uri.parse("package:" + DaemonEnv.sApp.getPackageName()));
sIntentWrapperList.add(new IntentWrapper(dozeIntent, DOZE));
}
}
//华为 自启管理
Intent huaweiIntent = new Intent();
huaweiIntent.setAction("huawei.intent.action.HSM_BOOTAPP_MANAGER");
sIntentWrapperList.add(new IntentWrapper(huaweiIntent, HUAWEI));
//华为 锁屏清理
Intent huaweiGodIntent = new Intent();
huaweiGodIntent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity"));
sIntentWrapperList.add(new IntentWrapper(huaweiGodIntent, HUAWEI_GOD));
//小米 自启动管理
Intent xiaomiIntent = new Intent();
xiaomiIntent.setAction("miui.intent.action.OP_AUTO_START");
xiaomiIntent.addCategory(Intent.CATEGORY_DEFAULT);
sIntentWrapperList.add(new IntentWrapper(xiaomiIntent, XIAOMI));
//小米 神隐模式
Intent xiaomiGodIntent = new Intent();
xiaomiGodIntent.setComponent(new ComponentName("com.miui.powerkeeper", "com.miui.powerkeeper.ui.HiddenAppsConfigActivity"));
xiaomiGodIntent.putExtra("package_name", DaemonEnv.sApp.getPackageName());
xiaomiGodIntent.putExtra("package_label", getApplicationName());
sIntentWrapperList.add(new IntentWrapper(xiaomiGodIntent, XIAOMI_GOD));
//三星 5.0/5.1 自启动应用程序管理
Intent samsungLIntent = DaemonEnv.sApp.getPackageManager().getLaunchIntentForPackage("com.samsung.android.sm");
if (samsungLIntent != null) sIntentWrapperList.add(new IntentWrapper(samsungLIntent, SAMSUNG_L));
//三星 6.0+ 未监视的应用程序管理
Intent samsungMIntent = new Intent();
samsungMIntent.setComponent(new ComponentName("com.samsung.android.sm_cn", "com.samsung.android.sm.ui.battery.BatteryActivity"));
sIntentWrapperList.add(new IntentWrapper(samsungMIntent, SAMSUNG_M));
//魅族 自启动管理
Intent meizuIntent = new Intent("com.meizu.safe.security.SHOW_APPSEC");
meizuIntent.addCategory(Intent.CATEGORY_DEFAULT);
meizuIntent.putExtra("packageName", DaemonEnv.sApp.getPackageName());
sIntentWrapperList.add(new IntentWrapper(meizuIntent, MEIZU));
//魅族 待机耗电管理
Intent meizuGodIntent = new Intent();
meizuGodIntent.setComponent(new ComponentName("com.meizu.safe", "com.meizu.safe.powerui.PowerAppPermissionActivity"));
sIntentWrapperList.add(new IntentWrapper(meizuGodIntent, MEIZU_GOD));
//Oppo 自启动管理
Intent oppoIntent = new Intent();
oppoIntent.setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity"));
sIntentWrapperList.add(new IntentWrapper(oppoIntent, OPPO));
//Oppo 自启动管理(旧版本系统)
Intent oppoOldIntent = new Intent();
oppoOldIntent.setComponent(new ComponentName("com.color.safecenter", "com.color.safecenter.permission.startup.StartupAppListActivity"));
sIntentWrapperList.add(new IntentWrapper(oppoOldIntent, OPPO_OLD));
//Vivo 后台高耗电
Intent vivoGodIntent = new Intent();
vivoGodIntent.setComponent(new ComponentName("com.vivo.abe", "com.vivo.applicationbehaviorengine.ui.ExcessivePowerManagerActivity"));
sIntentWrapperList.add(new IntentWrapper(vivoGodIntent, VIVO_GOD));
//金立 应用自启
Intent gioneeIntent = new Intent();
gioneeIntent.setComponent(new ComponentName("com.gionee.softmanager", "com.gionee.softmanager.MainActivity"));
sIntentWrapperList.add(new IntentWrapper(gioneeIntent, GIONEE));
//乐视 自启动管理
Intent letvIntent = new Intent();
letvIntent.setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity"));
sIntentWrapperList.add(new IntentWrapper(letvIntent, LETV));
//乐视 应用保护
Intent letvGodIntent = new Intent();
letvGodIntent.setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.BackgroundAppManageActivity"));
sIntentWrapperList.add(new IntentWrapper(letvGodIntent, LETV_GOD));
//酷派 自启动管理
Intent coolpadIntent = new Intent();
coolpadIntent.setComponent(new ComponentName("com.yulong.android.security", "com.yulong.android.seccenter.tabbarmain"));
sIntentWrapperList.add(new IntentWrapper(coolpadIntent, COOLPAD));
//联想 后台管理
Intent lenovoIntent = new Intent();
lenovoInte
没有合适的资源?快使用搜索试试~ 我知道了~
安卓Android后台保活服务Demo,多厂商免杀。
共89个文件
xml:41个
java:12个
png:10个
3星 · 超过75%的资源 需积分: 5 190 下载量 67 浏览量
2018-03-05
17:19:11
上传
评论 16
收藏 405KB RAR 举报
温馨提示
安卓Android后台保活服务Demo,多厂商免杀,适配各大手机品牌的内存清理白名单。多进程互相唤醒保活。
资源推荐
资源详情
资源评论
收起资源包目录
KeepLiveSample.rar (89个子文件)
KeepLiveSample
gradlew 5KB
settings.gradle 16B
KeepLiveSample.iml 868B
.idea
libraries
com_youth_xframe_xframe_1_1_0.xml 641B
com_android_support_animated_vector_drawable_25_4_0.xml 741B
org_reactivestreams_reactive_streams_1_0_2_jar.xml 589B
com_android_support_support_vector_drawable_25_4_0.xml 737B
org_hamcrest_hamcrest_integration_1_3_jar.xml 578B
com_android_support_support_v4_25_4_0.xml 472B
com_android_support_support_fragment_25_4_0.xml 702B
com_android_support_test_espresso_espresso_core_3_0_1.xml 710B
com_google_code_findbugs_jsr305_2_0_1_jar.xml 359B
com_squareup_javawriter_2_1_1_jar.xml 538B
com_android_support_support_annotations_25_4_0_jar.xml 609B
com_android_support_support_core_ui_25_4_0.xml 697B
javax_inject_javax_inject_1_jar.xml 528B
org_hamcrest_hamcrest_core_1_3_jar.xml 543B
com_android_support_appcompat_v7_25_4_0.xml 682B
org_hamcrest_hamcrest_library_1_3_jar.xml 557B
com_android_support_test_espresso_espresso_idling_resource_3_0_1.xml 765B
net_sf_kxml_kxml2_2_3_0_jar.xml 285B
com_android_support_test_rules_1_0_1.xml 652B
com_android_support_support_core_utils_25_4_0.xml 712B
com_android_support_support_media_compat_25_4_0.xml 722B
com_android_support_support_compat_25_4_0.xml 692B
com_android_support_test_runner_1_0_1.xml 657B
junit_junit_4_12_jar.xml 487B
io_reactivex_rxjava2_rxjava_2_1_9_jar.xml 542B
com_android_support_recyclerview_v7_25_4_0.xml 697B
runConfigurations.xml 564B
misc.xml 2KB
workspace.xml 181KB
gradle.xml 626B
modules.xml 365B
vcs.xml 167B
gradle
wrapper
gradle-wrapper.properties 236B
gradle-wrapper.jar 52KB
.gradle
buildOutputCleanup
cache.properties.lock 2B
cache.properties 51B
built.bin 0B
4.1
fileChanges
last-build.bin 1B
taskHistory
taskHistory.lock 17B
fileSnapshots.bin 2.12MB
taskHistory.bin 62KB
javaCompile
javaCompile.lock 17B
fileContent
fileContent.lock 17B
fileHashes
fileHashes.bin 415KB
resourceHashesCache.bin 20KB
fileHashes.lock 17B
local.properties 500B
gradlew.bat 2KB
gradle.properties 747B
.gitignore 127B
app
src
androidTest
java
mrkang
keeplivesample
ExampleInstrumentedTest.java 769B
test
java
mrkang
keeplivesample
ExampleUnitTest.java 415B
main
AndroidManifest.xml 3KB
res
mipmap-hdpi
ic_launcher.png 3KB
ic_launcher_round.png 5KB
mipmap-xxxhdpi
ic_launcher.png 9KB
ic_launcher_round.png 15KB
mipmap-xhdpi
ic_launcher.png 4KB
ic_launcher_round.png 7KB
mipmap-anydpi-v26
ic_launcher.xml 276B
ic_launcher_round.xml 276B
mipmap-mdpi
ic_launcher.png 2KB
ic_launcher_round.png 3KB
drawable
ic_launcher_background.xml 6KB
layout
activity_main.xml 945B
drawable-v24
ic_launcher_foreground.xml 2KB
values
colors.xml 214B
strings.xml 80B
styles.xml 394B
mipmap-xxhdpi
ic_launcher.png 6KB
ic_launcher_round.png 10KB
java
mrkang
keeplivesample
WatchDogService.java 6KB
IntentWrapper.java 25KB
AbsWorkService.java 6KB
App.java 577B
WakeUpReceiver.java 2KB
DaemonEnv.java 3KB
JobSchedulerService.java 655B
MainActivity.java 1KB
Constants.java 228B
TraceServiceImpl.java 11KB
libs
app.iml 11KB
.gitignore 8B
build.gradle 1KB
proguard-rules.pro 772B
build.gradle 622B
共 89 条
- 1
资源评论
- AndroidGTR2019-03-30又是GitHub上扒下来的,来骗积分来了,垃圾!
- 天痕涛2018-09-11还没测试,下载看看源码
- qq_192977112018-10-22还有部分文件没有XEmptyUtils等,虽然看名字只是工具类
mrkang007
- 粉丝: 3
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功