1. 程式人生 > 其它 >位元組碼和安卓相關文章

位元組碼和安卓相關文章

Android SystemServer 中 WatchDog 機制介紹 https://www.jianshu.com/p/5e8c0cb1a58e

Android Watchdog

http://androidxref.com/6.0.1_r10/xref/frameworks/base/services/core/java/com/android/server/Watchdog.java

Android中的Watchdog
  • 在Android中,Watchdog是用來監測關鍵服務是否發生了死鎖,如果發生了死鎖就kill程序,重啟SystemServer
  • Android的Watchdog是在SystemServer中進行初始化的,所以Watchdog是執行在SystemServer程序中
  • Watchdog是執行一個單獨的執行緒中的,每次wait 30s之後就會發起一個監測行為,如果系統休眠了,那Watchdog的wait行為也會休眠,此時需要等待系統喚醒之後才會重新恢復監測
  • 想要被Watchdog監測的物件需要實現Watchdog.Monitor介面的monitor()方法,然後呼叫addMonitor()方法

一起玩轉Android專案中的位元組碼http://quinnchen.cn/2018/09/13/2018-09-13-asm-transform/

ASM https://www.jianshu.com/p/a1e6b3abd789

https://github.com/heiheiwanne/ASMDemo

Java ByteCode
https://www.jianshu.com/p/92a75a18cbc1

https://segmentfault.com/a/1190000008606277大話+圖說:Java位元組碼指令——只為讓你懂