tiann / Leoric

PoC of fighting against force-stop kill process on Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on samsung note 9 android 10.

mianharisali opened this issue · comments

commented

2020-04-27 05:06:29.079 5265-5265/me.weishu.leoric E/AndroidRuntime: FATAL EXCEPTION: main Process: me.weishu.leoric, PID: 5265 android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{ccd4247 u0 me.weishu.leoric/.demo.Service1} at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2068) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:7811) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)

commented

mServiceData.writeInt(context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O ? 1 : 0);

强制使用了前台服务,但Service并没有调用startForeground()

It is just a PoC, please port it by yourself.