Coder Social home page Coder Social logo

lcodecorex / keepalive Goto Github PK

View Code? Open in Web Editor NEW
569.0 24.0 185.0 2.41 MB

Fighting against force-stop kill process on Android with binder ioctl / Android高级保活

License: MIT License

Java 1.54% Shell 0.02% CMake 0.04% C++ 34.43% C 63.98%
android keepalive process java binder ioctl jni ndk activity am

keepalive's Introduction

KeepAlive

KeepAlive是在Leoric(通过JNI复活进程)的基础上,实现了通过ioctl复活进程,能最大程度提高复活率。

master分支是利用 libbinder.so 与 ActivityManagerService 通信的版本,ioctl分支是使用 ioctl 与 binder 驱动通信的版本。

  1. 该项目仅供学习和参考,在android4.4到android9.0的模拟器上有效,在真机上不能保证保活成功(MIUI等定制系统已封杀了这个方案)。
  2. 对于自研轻量定制的 Android系统,对一些系统应用的保活,这个方案还是很有优势的。资源占用少,用户无感知,成功率高。
  3. 不建议在C端产品上使用。
  4. 可作为学习binder框架的一个案例。

使用方法

  1. 在Application中注册KeepAlive服务
@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    KeepAliveConfigs configs = new KeepAliveConfigs(
                    new KeepAliveConfigs.Config(getPackageName() + ":resident",
                            Service1.class.getCanonicalName()));
    KeepAlive.init(base, configs);
}
  1. Service1对应的进程名是":resident",或者其它任意命名
<service
    android:name="Service1"
    android:process=":resident" />

Service需要继承KeepAliveService,否则在Android4.4上将没有保活效果。

  1. 在合适的地方,启动Service1,它将自动唤醒保活进程
startService(new Intent(MainActivity.this, Service1.class));

如果需要服务自启动,看第6条。

  1. 忽略电池优化
configs.ignoreBatteryOptimization();
  1. 防止短时间内重复启动
// 配置短时间重启限制,每次重启间隔限制是10s,最多允许3次10秒内的连续重启
configs.rebootThreshold(10*1000, 3);

注:保活和重启限制相违背,更准确的应该做崩溃重启限制。

  1. 设置应用自启执行的操作
configs.setOnBootReceivedListener(new KeepAliveConfigs.OnBootReceivedListener() {
    @Override
    public void onReceive(Context context, Intent intent) {
        // 设置服务自启
        context.startService(new Intent(context, Service1.class));
    }
});

实现原理

应对方法

下面是一种简单的方法杀死 KeepAlive:

ps -A | grep `ps -A | grep keepalive | awk '{print $1}' | head -1` | awk '{print $2}' | xargs kill -19 && am force-stop com.boolbird.keepalive

对于系统有两种思路可以选择:

  1. 加入在 force-stop 期间不允许启动新的进程的逻辑
  2. 修改 force-stop 的杀进程逻辑为:预先收集好所有进程再进行 kill(如有必要还可以先发送 SIGSTOP)

测试

项目根目录下的kill_alive.sh用于重复杀进程测试。

问题

1、怎么保活多个进程 2、避免在Application中初始化第三方库,避免在所有进程都初始化第三方库

keepalive's People

Contributors

lcodecorex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

keepalive's Issues

在华为荣耀Android8.0下的出现异常

--------- beginning of system
2020-05-11 01:29:49.245 1145-1640/? I/ActivityManager: Force stopping com.boolbird.keepalive appid=10016 user=0: from pid 14714by app
2020-05-11 01:29:49.246 1145-1640/? I/ActivityManager: Killing 14536:android.process.daemon/u0a16 (adj 500): stop com.boolbird.keepalivefrom pid 14714by app
2020-05-11 01:29:49.249 1145-1640/? D/ActivityManager: cleanUpApplicationRecord app: ProcessRecord{a99c3c1 14536:android.process.daemon/u0a16}, app.bad: false, restarting: false, allowRestart: true
2020-05-11 01:29:49.255 1145-1640/? W/ActivityManager: Scheduling restart of crashed service com.boolbird.keepalive/.KeepAliveService in 1000ms
2020-05-11 01:29:49.262 14542-14542/? D/KeepAlive: lock file success >> /data/user/0/com.boolbird.keepalive/app_indicators/indicator_d-c <<
2020-05-11 01:29:49.262 14542-14542/? E/KeepAlive: Watch >>>>DAEMON<<<<< Daed !!
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: initState Setting data size of 0x7df1e59850 to 0
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: initState Setting data pos of 0x7df1e59850 to 0
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: continueWrite Setting data size of 0x7df1e59850 to 0
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: continueWrite Setting data pos of 0x7df1e59850 to 0
2020-05-11 01:29:49.262 14542-14542/? D/KeepAlive: errorCheck 0
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: finishWrite Setting data pos of 0x7df1e59850 to 4
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: finishWrite Setting data size of 0x7df1e59850 to 4
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: finishWrite Setting data pos of 0x7df1e59850 to 68
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: finishWrite Setting data size of 0x7df1e59850 to 68
2020-05-11 01:29:49.262 14542-14542/? D/KeepAlive: writeTransactionData 340 68
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: initState Setting data size of 0x7df1e598c0 to 0
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: initState Setting data pos of 0x7df1e598c0 to 0
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: continueWrite Setting data size of 0x7df1e598c0 to 0
2020-05-11 01:29:49.262 14542-14542/? I/KeepAlive: continueWrite Setting data pos of 0x7df1e598c0 to 0
2020-05-11 01:29:49.262 14542-14542/? D/KeepAlive: waitForResponse 68 0
2020-05-11 01:29:49.262 14542-14542/? D/KeepAlive: BR_TRANSACTION_COMPLETE 29190
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_DEAD_REPLY 29189
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_FAILED_REPLY 29201
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_ACQUIRE_RESULT -2147192316
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_REPLY -2143260157
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_ERROR -2147192320
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_OK 29185
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_TRANSACTION -2143260158
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_INCREFS -2146405881
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_NOOP 29196
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_SPAWN_LOOPER 29197
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_FINISHED 29198
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_DEAD_BINDER -2146930161
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_CLEAR_DEATH_NOTIFICATION_DONE -2146930160
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_FAILED_REPLY 29201
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: talkWithDriver1 68 0
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: talkWithDriver1 outAvail 68 0
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: "Finished read/write, write size = 68 ret=0
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: Our err: 0, write consumed: 68 (of 68), read consumed: 8
2020-05-11 01:29:49.263 1583-1641/? E/HsmCoreServiceImpl: onTransact in code is: 102
2020-05-11 01:29:49.263 14542-14542/? I/KeepAlive: continueWrite Setting data size of 0x7df1e59850 to 0
2020-05-11 01:29:49.263 14542-14542/? I/KeepAlive: continueWrite Setting data pos of 0x7df1e59850 to 0
2020-05-11 01:29:49.263 14542-14542/? I/KeepAlive: setDataSize Setting data size of 0x7df1e59850 to 0
2020-05-11 01:29:49.263 14542-14542/? I/KeepAlive: setDataSize Setting data size of 0x7df1e598c0 to 8
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: Remaining data size: 0
2020-05-11 01:29:49.263 1583-1641/? I/MediaProcessHandler: processOp opType: 1, uid: 10016, pid: 14536
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: Processing waitForResponse Command: 29196 8
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_NOOP
2020-05-11 01:29:49.263 1583-1641/? W/MediaProcessHandler: remove target not exist, maybe the UI process: uid: 10016, pid: 14536
2020-05-11 01:29:49.263 14542-14542/? E/KeepAlive: executeCommand err=0
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: talkWithDriver1 inAvail 0 8
2020-05-11 01:29:49.263 1583-1641/? I/MediaProcessHandler: executedCallBack opType: 1 mMediaStatusObservers.size=0
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: Processing waitForResponse Command: 29190 8
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: BR_TRANSACTION_COMPLETE
2020-05-11 01:29:49.263 14542-14542/? D/KeepAlive: writeService result is 0
2020-05-11 01:29:49.264 14542-14542/? E/KeepAlive: waitpid error
2020-05-11 01:29:49.264 14542-14542/? D/KeepAlive: do_daemon pid=14542 ppid=1
2020-05-11 01:29:49.264 14542-14542/? D/KeepAlive: start try to lock file >> /data/user/0/com.boolbird.keepalive/app_indicators/indicator_p <<
2020-05-11 01:29:49.264 1145-1273/? W/AwareLog: SchedLevelBoost: onProcessDied config not set!
2020-05-11 01:29:49.267 1145-1640/? I/ActivityManager: Killing 14510:com.boolbird.keepalive/u0a16 (adj 0): stop com.boolbird.keepalivefrom pid 14714by app
2020-05-11 01:29:49.269 1145-1640/? D/ActivityManager: cleanUpApplicationRecord app: ProcessRecord{8e3dccb 14510:com.boolbird.keepalive/u0a16}, app.bad: false, restarting: false, allowRestart: true
2020-05-11 01:29:49.270 1583-1641/? E/HsmCoreServiceImpl: onTransact in code is: 102
2020-05-11 01:29:49.271 1583-1641/? I/MediaProcessHandler: processOp opType: 1, uid: 10016, pid: 14510
2020-05-11 01:29:49.271 1583-1641/? W/MediaProcessHandler: remove target not exist, maybe the UI process: uid: 10016, pid: 14510
2020-05-11 01:29:49.271 1583-1641/? I/MediaProcessHandler: executedCallBack opType: 1 mMediaStatusObservers.size=0
2020-05-11 01:29:49.272 1145-1273/? W/AwareLog: SchedLevelBoost: onProcessDied config not set!
2020-05-11 01:29:49.276 1145-1640/? I/ActivityManager: Killing 14563:com.boolbird.keepalive:resident/u0a16 (adj 0): stop com.boolbird.keepalivefrom pid 14714by app
2020-05-11 01:29:49.278 1145-1640/? D/ActivityManager: cleanUpApplicationRecord app: ProcessRecord{91229f9 14563:com.boolbird.keepalive:resident/u0a16}, app.bad: false, restarting: false, allowRestart: true
2020-05-11 01:29:49.279 1145-1640/? W/ActivityManager: Scheduling restart of crashed service com.boolbird.keepalive/.demo.Service1 in 1000ms
2020-05-11 01:29:49.288 1145-1640/? I/ActivityManager: Force finishing activity ActivityRecord{838a0bc u0 com.boolbird.keepalive/.demo.MainActivity t853}
2020-05-11 01:29:49.295 1145-1640/? I/ActivityManager: Force finishing activity ActivityRecord{838a0bc u0 com.boolbird.keepalive/.demo.MainActivity t853 f}
2020-05-11 01:29:49.295 1145-1640/? W/ActivityManager: Duplicate finish request for ActivityRecord{838a0bc u0 com.boolbird.keepalive/.demo.MainActivity t853 f}
2020-05-11 01:29:49.300 1145-1722/? E/ActivityManager: Activity Manager Crash. UID:10016 PID:0 TRANS:26
java.lang.IllegalArgumentException: Unknown URI type: -1
at android.net.Uri$1.createFromParcel(Uri.java:1793)
at android.net.Uri$1.createFromParcel(Uri.java:1783)
at android.content.Intent.readFromParcel(Intent.java:9696)
at android.content.Intent.(Intent.java:9691)
at android.content.Intent.readFromParcel(Intent.java:9724)
at android.content.Intent.(Intent.java:9691)
at android.content.Intent$1.createFromParcel(Intent.java:9682)
at android.content.Intent$1.createFromParcel(Intent.java:9681)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:515)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3285)
at com.android.server.am.HwActivityManagerService.onTransact(HwActivityManagerService.java:837)
at android.os.Binder.execTransact(Binder.java:675)
2020-05-11 01:29:49.301 1145-1722/? W/Binder: Binder call failed.
java.lang.IllegalArgumentException: Unknown URI type: -1
at android.net.Uri$1.createFromParcel(Uri.java:1793)
at android.net.Uri$1.createFromParcel(Uri.java:1783)
at android.content.Intent.readFromParcel(Intent.java:9696)
at android.content.Intent.(Intent.java:9691)
at android.content.Intent.readFromParcel(Intent.java:9724)
at android.content.Intent.(Intent.java:9691)
at android.content.Intent$1.createFromParcel(Intent.java:9682)
at android.content.Intent$1.createFromParcel(Intent.java:9681)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:515)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3285)
at com.android.server.am.HwActivityManagerService.onTransact(HwActivityManagerService.java:837)
at android.os.Binder.execTransact(Binder.java:675)
2020-05-11 01:29:49.302 1583-1641/? E/HsmCoreServiceImpl: onTransact in code is: 102
2020-05-11 01:29:49.303 1583-1641/? I/MediaProcessHandler: processOp opType: 1, uid: 10016, pid: 14563
2020-05-11 01:29:49.303 1583-1641/? W/MediaProcessHandler: remove target not exist, maybe the UI process: uid: 10016, pid: 14563
2020-05-11 01:29:49.303 1583-1641/? I/MediaProcessHandler: executedCallBack opType: 1 mMediaStatusObservers.size=0
2020-05-11 01:29:49.303 1145-1273/? W/AwareLog: SchedLevelBoost: onProcessDied config not set!
2020-05-11 01:29:49.303 1145-5259/? W/System.err: java.lang.SecurityException: Unable to find app for caller android.app.IApplicationThread$Stub$Proxy@5385b97 (pid=14563) when binding service Intent { cmp=com.boolbird.keepalive/.KeepAliveService }
2020-05-11 01:29:49.303 1145-5259/? W/System.err: at com.android.server.am.ActiveServices.bindServiceLocked(ActiveServices.java:1343)
2020-05-11 01:29:49.303 1145-5259/? W/System.err: at com.android.server.am.ActivityManagerService.bindService(ActivityManagerService.java:19674)
2020-05-11 01:29:49.303 1145-5259/? W/System.err: at com.android.server.am.HwActivityManagerService.bindService(HwActivityManagerService.java:4247)
2020-05-11 01:29:49.303 1145-5259/? W/System.err: at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:584)
2020-05-11 01:29:49.303 1145-5259/? W/System.err: at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3285)
2020-05-11 01:29:49.303 1145-5259/? W/System.err: at com.android.server.am.HwActivityManagerService.onTransact(HwActivityManagerService.java:837)
2020-05-11 01:29:49.303 1145-1161/? E/HwActivityManagerServiceEx: invalid ActivityRecord, error.
2020-05-11 01:29:49.304 1145-1161/? E/HwActivityManagerServiceEx: parse activity info error.
2020-05-11 01:29:49.304 1145-5259/? W/System.err: at android.os.Binder.execTransact(Binder.java:675)
2020-05-11 01:29:49.304 1145-1161/? V/WindowManager: removeAppToken: AppWindowToken{2bf1b9a token=Token{e7de845 ActivityRecord{838a0bc u0 com.boolbird.keepalive/.demo.MainActivity t853}}} delayed=false Callers=com.android.server.wm.DisplayContent.removeAppToken:994 com.android.server.wm.AppWindowContainerController.removeContainer:355 com.android.server.am.ActivityRecord.removeWindowContainer:1041 com.android.server.am.ActivityStack.removeActivityFromHistoryLocked:4486
2020-05-11 01:29:49.305 1145-1161/? V/WindowManager: removeIfPossible: Window{1ac8c0 u0 com.boolbird.keepalive/com.boolbird.keepalive.demo.MainActivity} callers=com.android.server.wm.WindowState.removeIfPossible:1914 com.android.server.wm.WindowToken.removeAllWindowsIfPossible:139 com.android.server.wm.AppWindowToken.removeIfPossible:549 com.android.server.wm.AppWindowToken.onRemovedFromDisplay:616 com.android.server.wm.DisplayContent.removeAppToken:994
2020-05-11 01:29:49.305 1145-1161/? V/WindowManager: postWindowRemoveCleanupLocked: Window{1ac8c0 u0 com.boolbird.keepalive/com.boolbird.keepalive.demo.MainActivity}
2020-05-11 01:29:49.306 1145-1161/? V/WindowManager: Removing Window{1ac8c0 u0 com.boolbird.keepalive/com.boolbird.keepalive.demo.MainActivity} from AppWindowToken{2bf1b9a token=Token{e7de845 ActivityRecord{838a0bc u0 com.boolbird.keepalive/.demo.MainActivity t853}}}
2020-05-11 01:29:49.340 1145-1145/? V/AlarmManager: UninstallReceiver onReceive action:android.intent.action.PACKAGE_RESTARTED
2020-05-11 01:29:49.341 1145-1145/? D/HwBastetService: BroadcastReceiver android.intent.action.PACKAGE_RESTARTED
2020-05-11 01:29:49.342 1583-1583/? I/HwCoreAppHelperService: LocalReceiver receives:android.intent.action.PACKAGE_RESTARTED,pkg:com.boolbird.keepalive,uid:10016
2020-05-11 01:29:49.344 1145-1162/? D/HwGameAssistantController: pid=1736, uid=10054, foreground=true
2020-05-11 01:29:49.345 1145-1145/? D/HwGpsPowerTracker: LocalReceiver receives:android.intent.action.PACKAGE_RESTARTED
2020-05-11 01:29:49.347 1145-1273/? W/AwareLog: SchedLevelBoost: onFgActivitiesChanged config not set!
2020-05-11 01:29:49.350 1705-1705/? D/CarrierSvcBindHelper: No carrier app for: 0
2020-05-11 01:29:49.351 1145-5259/? I/HwNetworkPolicy: onTransact, code = 203
2020-05-11 01:29:49.351 1563-1983/? I/HwNetworkPolicyManager: getHwUidPolicy uid = 10054 policy = 0
2020-05-11 01:29:49.352 1705-1705/? D/CarrierSvcBindHelper: No carrier app for: 1
2020-05-11 01:29:49.358 1145-1722/? I/HwAudioService: now type = -1,reportForegroundAppType = 301,systemload = -1
2020-05-11 01:29:49.359 1145-1722/? W/libc: Set property "sys.iaware.type" to "301"
2020-05-11 01:29:49.390 1418-1796/? D/HwRecentsLockUtils: Search
2020-05-11 01:29:49.390 1583-1641/? E/HsmCoreServiceImpl: onTransact in code is: 103
2020-05-11 01:29:49.390 1583-1641/? I/MediaProcessHandler: playingUids: 10154|10156|10157|10225|
2020-05-11 01:29:49.391 1145-1722/? D/ActivityManager: Skipping, home or recents stack task: TaskRecord{7ae703 #1 A=com.huawei.android.launcher U=0 StackId=0 sz=1}
2020-05-11 01:29:49.391 1145-1722/? D/ActivityManager: Skipping intent:flg=0x10804000 cmp=com.android.systemui/.recents.RecentsActivity bnds=[48,1194][1032,2436]
2020-05-11 01:29:49.392 1145-1722/? D/ActivityManager: Skipping intent:flg=0x10800000 cmp=com.android.systemui/.usb.HwUsbDebuggingActivity
2020-05-11 01:29:49.392 1145-1722/? D/ActivityManager: Skipping intent:act=com.huawei.action.VOICE_ASSISTANT flg=0x10800000 cmp=com.huawei.vassistant/.ui.main.VAssistantActivity
2020-05-11 01:29:49.429 14602-14602/? D/KeepAlive: lock file success >> /data/user/0/com.boolbird.keepalive/app_indicators/indicator_p-c <<
2020-05-11 01:29:49.429 1145-1170/? W/ActivityManager: setHasOverlayUi called on unknown pid: 14510
2020-05-11 01:29:49.750 644-999/? I/audio_hw_primary: usb_ext_get_parameters: check show hires (false)
2020-05-11 01:29:49.751 701-12063/? I/hash_map_utils: key: 'typec_need_show_hires' value: ''
2020-05-11 01:29:49.752 1145-1145/? I/HwAudioService: check HiRes Icon false
2020-05-11 01:29:49.753 1145-1145/? W/ActivityManager: Sending non-protected broadcast huawei.intent.action.hideHiResIcon from system uid 1000 pkg null
2020-05-11 01:29:49.754 1145-1145/? I/HwAudioService: broadcastHiresIntent : false
2020-05-11 01:29:49.756 1418-1418/? D/StatusBarIconController: setIconVisibility icon is null or visibility not change visibility=false
2020-05-11 01:29:49.771 644-999/? I/audio_hw_primary: usb_ext_get_parameters: check show hires (false)
2020-05-11 01:29:49.771 701-12063/? I/hash_map_utils: key: 'typec_need_show_hires' value: ''
2020-05-11 01:29:49.772 1145-1145/? I/HwAudioService: check HiRes Icon false
2020-05-11 01:29:49.773 1145-1145/? W/ActivityManager: Sending non-protected broadcast huawei.intent.action.hideHiResIcon from system uid 1000 pkg null
2020-05-11 01:29:49.774 1145-1145/? I/HwAudioService: broadcastHiresIntent : false
2020-05-11 01:29:49.774 1145-1145/? W/ActivityManager: Sending non-protected broadcast huawei.intent.action.hideHiResIcon from system uid 1000 pkg null
2020-05-11 01:29:49.775 1418-1418/? D/StatusBarIconController: setIconVisibility icon is null or visibility not change visibility=false
2020-05-11 01:29:49.779 644-999/? I/audio_hw_primary: usb_ext_get_parameters: check show hires (false)
2020-05-11 01:29:49.779 701-12063/? I/hash_map_utils: key: 'typec_need_show_hires' value: ''
2020-05-11 01:29:49.780 1145-1145/? I/HwAudioService: check HiRes Icon false
2020-05-11 01:29:49.781 1145-1145/? W/ActivityManager: Sending non-protected broadcast huawei.intent.action.hideHiResIcon from system uid 1000 pkg null
2020-05-11 01:29:49.781 1145-1145/? I/HwAudioService: broadcastHiresIntent : false
2020-05-11 01:29:49.781 1145-1145/? W/ActivityManager: Sending non-protected broadcast huawei.intent.action.hideHiResIcon from system uid 1000 pkg null
2020-05-11 01:29:49.783 1418-1418/? D/StatusBarIconController: setIconVisibility icon is null or visibility not change visibility=false
2020-05-11 01:29:49.956 14724-14724/? I/appproc: CLASSPATH=/system/framework/pm.jar
2020-05-11 01:29:49.956 14724-14724/? I/appproc: Command=app_process /system/bin com.android.commands.pm.Pm list packages --uid
2020-05-11 01:29:49.956 14724-14724/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
2020-05-11 01:29:49.960 14724-14724/? I/AndroidRuntime: readDownloadBoosterConfig: 'false'
2020-05-11 01:29:49.960 14724-14724/? I/cutils-trace: atrace_init_once, trace_marker_path = /sys/kernel/debug/tracing/trace_marker
2020-05-11 01:29:50.079 14724-14724/? I/app_process: Reinit property: dalvik.vm.checkjni= false
2020-05-11 01:29:50.087 14724-14724/? V/HwFrameworkFactory: : successes to get AllImpl object and return....
2020-05-11 01:29:50.101 14724-14724/? I/HWSERVICES: hwnative_get_component_register:libdrmbitmap,JNI
2020-05-11 01:29:50.121 14724-14724/? E/Zygote: register_com_android_internal_os_Zygote num = 0
2020-05-11 01:29:50.133 14724-14724/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
2020-05-11 01:29:50.145 14724-14724/? I/app_process: System.exit called, status: 0
2020-05-11 01:29:50.145 14724-14724/? I/AndroidRuntime: VM exiting with result code 0.

NativeKeepAlive_test 函数调用后,不能启动Service2

   你好:
       我使用了keepAlive-ioctrl分支的代码,将doDaemon函数注释掉了,单独测试了Java_com_boolbird_keepalive_NativeKeepAlive_test函数,writeService函数的sdk version号也修改正确了,但是我发现Service2服务并没有启动。是服务要一定要启动一个新进程吗?可能是哪里的问题?

缺少一些头文件和SO

tag设置了29需要把so文件放到libs目录下 放了之后缺少arm64/libbacktrace.so 从官方下载的img 解压出来libbacktrace.so 放进去之后 又提示找不到头文件 现在脑子有点大了 作者可以帮忙搞一下吗?

libbinder.so通信方式的分支编译失败

在../../tools/android-sdk-mac_86/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/bits/fortify/string.h

#if ANDROID_API >= ANDROID_API_J_MR1
return __builtin___strcat_chk(dst, src, __bos(dst));

undefined reference to '__strcat_chk'

library "libbinder.so" not found

2020-09-19 16:19:50.260 23215-23241/com.boolbird.keepalive E/AndroidRuntime: FATAL EXCEPTION: Thread-2
Process: com.boolbird.keepalive:resident, PID: 23215
java.lang.UnsatisfiedLinkError: dlopen failed: library "libbinder.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1657)
at com.boolbird.keepalive.NativeKeepAlive.(NativeKeepAlive.java:7)
at com.boolbird.keepalive.KeepAliveProcessImpl$1.run(KeepAliveProcessImpl.java:82)

一直是这个错误 ndk版本为16 请问有什么解决的方法吗###

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.