marswin / marsdaemon Goto Github PK
View Code? Open in Web Editor NEWA lite library, you can make your project depend it easily, and your project will be UNDEAD (contains api from 9 to 23, lol).
License: Apache License 2.0
A lite library, you can make your project depend it easily, and your project will be UNDEAD (contains api from 9 to 23, lol).
License: Apache License 2.0
有监听手机关机、解锁、网络变化
去设置 PackageUtils.setComponentDefault(context, "android.intent.action.BOOT_COMPLETED");
重启手机后台服务没有自动启动
Mx3 5.0 守护失败
我用这个写法直接没用啊 还是需要别的so库啊 还望赐教
在乐视手机上杀死一个进程,另一个进程并不会被重启,两个进程都是可以被杀掉的,所有并没有实现进程守护!
三星机型普遍不可以
测试demo发现,debug包无法force stop,但是release包可以,是不是需要配置proguard文件?
09-27 16:53:40.281 1719-1745/? E/whetstone.activity: java.lang.NoSuchMethodException: com.android.server.am.ActivityManagerService#clearDeadAppFromNative()#exact
at miui.util.ReflectionUtils.findMethodExact(ReflectionUtils.java:242)
at com.miui.whetstone.server.WhetstoneActivityManagerService.handleClearDeadAppFromNative(WhetstoneActivityManagerService.java:246)
at com.miui.whetstone.server.WhetstoneActivityManagerService.access$400(WhetstoneActivityManagerService.java:51)
at com.miui.whetstone.server.WhetstoneActivityManagerService$PromoteLevelManagerHandler.handleMessage(WhetstoneActivityManagerService.java:504)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
mulit define ....
Hey,
My app will killProcess proactively when exit app, and my Service can auto start on majority of devices. But not working for Samsung Note4.
I tried MarsDaemon, not work either. Any idea can help me? Thanks for any reply.
app混淆以后,华为荣耀6 后台进程一直提示进程终止,看了后台进程,都是0.0M一直在重启,又死掉!不知道怎么解决,proguard-rules也进行配置过了!希望作者能提供一份比较好的配置方案!谢谢
at com.marswin89.marsdaemon.nativ.NativeDaemonAPI21.doDaemon(Native method)
01-03 11:32:38.548 12822-12859/com.focustech.android.mt.parent:core A/art: art/runtime/runtime.cc:286] at com.marswin89.marsdaemon.strategy.DaemonStrategy21$1.run(DaemonStrategy21.java:51)
01-03 11:32:38.548 12822-12859/com.focustech.android.mt.parent:core A/art: art/runtime/runtime.cc:286] Pending exception java.lang.NoSuchMethodError thrown by 'void com.marswin89.marsdaemon.nativ.NativeDaemonAPI21.doDaemon(java.lang.String, java.lang.String, java.lang.String, java.lang.String):-2'
01-03 11:32:38.548 12822-12859/com.focustech.android.mt.parent:core A/art: art/runtime/runtime.cc:286] java.lang.NoSuchMethodError: no non-static method "Lcom/marswin89/marsdaemon/nativ/NativeDaemonAPI21;.onDaemonDead()V"
01-03 11:32:38.548 12822-12859/com.focustech.android.mt.parent:core A/art: art/runtime/runtime.cc:286] at void com.marswin89.marsdaemon.nativ.NativeDaemonAPI21.doDaemon(java.lang.String, java.lang.String, java.lang.String, java.lang.String) (NativeDaemonAPI21.java:-2)
01-03 11:32:38.548 12822-12859/com.focustech.android.mt.parent:core A/art: art/runtime/runtime.cc:286] at void com.marswin89.marsdaemon.strategy.DaemonStrategy21$1.run() (DaemonStrategy21.java:51)
01-03 11:32:38.548 12822-12859/com.focustech.android.mt.parent:core A/art: art/runtime/runtime.cc:286] Dumping all threads without appropriate locks held: thread list lock mutator lock
但是我有点搞不清楚美团知乎智联之类的APP怎么做到的,即使开发者服务里全部杀死,过段时间仍然重启了。
添加上该库后,应用安装后,第一次启动非常非常慢。
华为A5 6.0系统,杀死后无法启动。
尝试使用HTC安全助手和设置里面的应用管理来杀程序,发现确实杀不死,大神很棒!
据说华为有自己的进程冻结技术,QQ、微信、支付宝等都是通过加入白名单存活的。
在Android 9上,DaemonStrategy23的:
initBroadcastParcel(context, configs.DAEMON_ASSISTANT_CONFIG.RECEIVER_NAME);
sendBroadcastByAmsBinder();
会爆出 Unable to find app for caller android.app.IApplicationThread
华为荣耀6plus 运行demo后一直logcat输出如下错误
/com.marswin89.marsdaemon.demo W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=arm --instruction-set-features=smp,div,atomic_ldrd_strd --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=cortex-a15 --instruction-set-features=default --dex-file=/data/app/com.marswin89.marsdaemon.demo-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm/data@[email protected]@[email protected]) because non-0 exit status
如题
我有些逻辑在mainactivity,不能每次都重走oncreate,但是加了这个库后每次都会走,我去掉之后就正常了
华为荣耀7,5.0系统,接入后每次回调接口都报错,提示找不到64位so文件,求解决。
如题,新手机都更新了杀进程方法(我指第三方厂商),楼主主要方案都是针对原生的系统,所以,效果不好,我司的手机基本都不行
先膜拜,楼主好,我在项目中用这个库在大部分手机上都是正常的,但是在小米5 系统7.0 ,miui8.2稳定版上不仅不可能重启还造成我其他进程跨进程读取数据崩溃,希望楼主能调教下小米5……
1.reapeattimes 是我自己的变量
04-12 14:55:16.032: D/Daemon(20585): zombie process name is mars_d, and number is 0, killing...
04-12 14:55:16.072: E/Daemon(20585): Watch >>>>CHILD<<<< Dead !!!
04-12 14:55:16.082: I/Process(20585): Sending signal. PID: 20585 SIG: 9
04-12 14:55:17.752: D/dalvikvm(20716): Trying to load lib /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x424929c8
04-12 14:55:17.752: D/dalvikvm(20716): Added shared lib /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x424929c8
04-12 14:55:17.752: D/dalvikvm(20716): No JNI_OnLoad found in /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x424929c8, skipping init
04-12 14:55:17.752: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.752: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.752: V/Service1(20716): Service1 onStart
04-12 14:55:17.762: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.762: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.762: V/Service1(20716): Service1 onStart
04-12 14:55:17.762: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.762: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.762: V/Service1(20716): Service1 onStart
04-12 14:55:17.762: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.762: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.762: V/Service1(20716): Service1 onStart
04-12 14:55:17.762: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.762: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.762: V/Service1(20716): Service1 onStart
04-12 14:55:17.772: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.772: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.772: V/Service1(20716): Service1 onStart
04-12 14:55:17.772: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.772: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.772: V/Service1(20716): Service1 onStart
04-12 14:55:17.772: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.772: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.772: V/Service1(20716): Service1 onStart
04-12 14:55:17.772: D/Daemon(20716): zombie process name is mars_d, and number is 0, killing...
04-12 14:55:17.792: V/Service1(20716): Service1 onStartCommand
04-12 14:55:17.792: I/Service1(20716): reapeattimes = 0
04-12 14:55:17.792: V/Service1(20716): Service1 onStart
04-12 14:55:17.822: E/Daemon(20716): Watch >>>>CHILD<<<< Dead !!!
04-12 14:55:17.822: I/Process(20716): Sending signal. PID: 20716 SIG: 9
04-12 14:55:18.182: D/dalvikvm(20760): Trying to load lib /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x4248a1d0
04-12 14:55:18.182: D/dalvikvm(20760): Added shared lib /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x4248a1d0
04-12 14:55:18.182: D/dalvikvm(20760): No JNI_OnLoad found in /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x4248a1d0, skipping init
04-12 14:55:18.182: V/Service1(20760): Service1 onStartCommand
04-12 14:55:18.182: I/Service1(20760): reapeattimes = 0
04-12 14:55:18.182: V/Service1(20760): Service1 onStart
04-12 14:55:18.202: D/Daemon(20760): zombie process name is mars_d, and number is 0, killing...
04-12 14:55:18.232: V/Service1(20760): Service1 onStartCommand
04-12 14:55:18.232: I/Service1(20760): reapeattimes = 0
04-12 14:55:18.232: V/Service1(20760): Service1 onStart
04-12 14:55:18.252: E/Daemon(20760): Watch >>>>CHILD<<<< Dead !!!
04-12 14:55:18.252: I/Process(20760): Sending signal. PID: 20760 SIG: 9
04-12 14:55:19.712: D/Daemon(20890): zombie process name is mars_d, and number is 0, killing...
04-12 14:55:19.742: V/Service1(20890): Service1 onStartCommand
04-12 14:55:19.742: I/Service1(20890): reapeattimes = 0
04-12 14:55:19.742: V/Service1(20890): Service1 onStart
04-12 14:55:19.752: E/Daemon(20890): Watch >>>>CHILD<<<< Dead !!!
04-12 14:55:19.762: I/Process(20890): Sending signal. PID: 20890 SIG: 9
04-12 14:55:21.122: D/dalvikvm(21028): Trying to load lib /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x42490e20
04-12 14:55:21.132: V/Service1(21028): Service1 onStartCommand
04-12 14:55:21.132: I/Service1(21028): reapeattimes = 0
04-12 14:55:21.132: V/Service1(21028): Service1 onStart
04-12 14:55:21.132: D/dalvikvm(21028): Added shared lib /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x42490e20
04-12 14:55:21.132: D/dalvikvm(21028): No JNI_OnLoad found in /data/app-lib/com.marswin89.marsdaemon.demo-1/libdaemon_api20.so 0x42490e20, skipping init
04-12 14:55:21.172: D/Daemon(21028): zombie process name is mars_d, and number is 0, killing...
04-12 14:55:21.212: V/Service1(21028): Service1 onStartCommand
04-12 14:55:21.212: I/Service1(21028): reapeattimes = 0
04-12 14:55:21.212: V/Service1(21028): Service1 onStart
04-12 14:55:21.242: E/Daemon(21028): Watch >>>>CHILD<<<< Dead !!!
rt。这样导入很方便啊!
实测,华为P9,Android7.0无效,清理内存或者强杀后都无法重新启动,是不兼容7.0吗?
启动MarsDaemon之后,如果想主动结束程序进程(包括守护进程),怎样实现?
虽然文章和项目都非常精彩,不过还是有国产神机在,很多都不管用,我也在想,现在的360怎么做的呢……
lib源码里看到有很多不同版本的.so文件,是根据手机版本还是根据编译版本来确定加载哪个so文件呢?
我测试在7.0的nexus 6p 上,在设置中强制停止后,是起不来了的。
在NativeDaemonAPI21和NativeDaemonAPI20中android studio提示:
Error:(26, 24) Cannot resolve corresponding JNI function Java_com_marswin89_marsdaemon_nativ_NativeDaemonAPI20_doDaemon
这行 public native void doDaemon(String pkgName, String svcName, String daemonPath);
service1的onCreate都不走 因为什么?
那个application 经常重复走onCreate(),好奇怪啊;
08-23 11:48:07.140 20425-20425/com.alarmdemo E/TAG: MyApplication---onCreate()
08-23 11:48:07.630 20503-20503/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:08.330 20586-20586/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:09.140 20663-20663/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:10.220 20770-20770/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:10.750 20927-20927/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:11.490 20984-20984/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:12.130 21082-21082/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:12.670 21138-21138/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:13.440 21191-21191/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:14.010 21244-21244/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:14.560 21280-21280/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:15.220 21309-21309/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:15.740 21344-21344/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:16.210 21371-21371/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:16.650 21405-21405/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:17.200 21434-21434/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:17.720 21467-21467/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:18.200 21496-21496/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:18.920 21529-21529/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:19.420 21559-21559/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:20.000 21592-21592/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:20.450 21621-21621/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:21.050 21654-21654/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:21.510 21683-21683/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:22.080 21716-21716/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:22.630 21744-21744/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:23.190 21776-21776/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:23.630 21805-21805/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:24.180 21836-21836/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:24.660 21866-21866/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:25.300 21895-21895/? E/TAG: MyApplication---onCreate()
08-23 11:48:25.780 21924-21924/? E/TAG: MyApplication---onCreate()
08-23 11:48:26.350 21957-21957/com.alarmdemo:process1 E/TAG: MyApplication---onCreate()
08-23 11:48:26.850 21987-21987/com.alarmdemo:process2 E/TAG: MyApplication---onCreate()
08-23 11:48:27.380 22020-22020/? E/TAG: MyApplication---onCreate()
08-23 11:48:27.870 22054-22054/? E/TAG: MyApplication---onCreate()
你们也是这样吗?
Process: cn.mark.frame:process2, PID: 6072
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.mark.frame-1/base.apk"],nativeLibraryDirectories=[/data/app/cn.mark.frame-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libdaemon_api21.so"
Process: cn.mark.frame:process1, PID: 6053
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/cn.mark.frame-1/base.apk"],nativeLibraryDirectories=[/data/app/cn.mark.frame-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libdaemon_api21.so"
大神,请问是否可以提供arm64-v8a的so库
大神 您好!
我在使用你的库,请问在 attachBaseContext 方法里面拆分dex ,是应该先于 守护进程调用么?
eg:
@OverRide
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
DaemonUtils.start(base);
MultiDex.install(this);
}
魅族4,Android 5.1 API22 直接使用系统的一键清理无法守护,但是在设置里杀死进程却可以守护
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.