- 註冊時間
 - 2014-1-9
 - 最後登錄
 - 2016-1-24
 - 帖子
 - 6819
 - 閱讀權限
 - 100
 - 積分
 - 17674
 - 精華
 - 2
  
 
 
 
   
 | 
 本帖最後由 道奇兔 於 2014-8-22 21:36 編輯  
 
首先透過反編譯神魔apk(商店/MyCard)都可以,透過關鍵字((這邊不說明關鍵字 
可以找到神魔針對root的部份的smali程式碼 註1 
 
偵測root的語言如下 
- # direct methods
 
 - .method static constructor <clinit>()V
 
 -     .locals 6
 
  
-     .prologue
 
 -     const/4 v5, 0x1
 
  
-     const/4 v4, 0x0
 
  
-     .line 21
 
 -     new-instance v0, Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;
 
  
-     const-string v1, "check_su_binary"
 
  
-     const/4 v2, 0x2
 
  
-     new-array v2, v2, [Ljava/lang/String;
 
  
-     const-string v3, "/system/xbin/which"
 
  
-     aput-object v3, v2, v4
 
  
-     const-string v3, "su"
 
  
-     aput-object v3, v2, v5
 
  
-     invoke-direct {v0, v1, v4, v2}, Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;-><init>(Ljava/lang/String;I[Ljava/lang/String;)V
 
  
-     sput-object v0, Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;->check_su_binary:Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;
 
  
-     .line 20
 
 -     new-array v0, v5, [Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;
 
  
-     sget-object v1, Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;->check_su_binary:Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;
 
  
-     aput-object v1, v0, v4
 
  
-     sput-object v0, Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;->ENUM$VALUES:[Lcom/madhead/tos/plugins/acs/ExecShell$SHELL_CMD;
 
  
-     return-void
 
 - .end method
 
  複製代碼 
這部分就是偵測/system/xbin/下面的su檔案在不在 
如果在責執行偵測是否安裝root app 
 接下來他會針對上面執行結果下去跑PackageManager的動作註2 
 
從這裡可以知道他偵測的app如下 
 "eu.chainfire.supersu" 
 
"com.noshufou.android.su" 
 
 "com.koushikdutta.superuser" 
 
"david.lahuta.superuser.free.pro" 
 
 "com.umintlab.su.ModeChanger" 
 
 "com.su.suapp" 
 
 "david.lahuta.superuser" 
 
"jp.htxa58.el.root.rootadmtool.pro" 
 
"com.umintlab.su.SettingsGeneral" 
 
 "com.noshufou.android.su.fixer" 
 
 "com.noshufou.android.su.elite" 
 
 "com.bitcubate.android.su.installer" 
 
 "com.bitcubate.superuser.pro" 
 
 "org.invisiblek.superuserlockring" 
 
"com.keramidas.TitaniumBackup" 
 
 "com.universal.unroot" 
如果眼睛很好的人會注意到,神魔把"鈦備份"也列在偵測列表內(難道刷機愛好者錯了嗎...............?) 
如果有找到對應的app那就會產生以下字串 
 
-     const-string v9, "Root Checking Apps Return"
 
  
-     const-string v10, "Root apps found!!!!!!"
 
  複製代碼 (恩......你找到root app有必要用那麼多驚嘆號嗎??????????????????????????????) 
其實下面還有一個偵測模擬器的 
- const-string v6, "genymotion" 
 
  複製代碼  沒錯!!! GM模擬器,這可是我用天天動聽的好夥伴ㄟ!! 
順帶一提.........他還偵測以下路徑的相同apk名稱喔 
- /system/app/Superuser.apk
 
  複製代碼 所以用RE管理器複製貼上改權限的人....你懂得XD 
 註1Q:什麼是smali 
A:簡單一點來說就是Dalvik虛擬機語言 
 
註2Q:什麼是PackageManager 
A:就是Android上面擷取使用者有沒有安裝某些app 
例如某些程式需要用到Google maps就會去偵測,當偵測到不存會提示你並引導你到Play Store上進行安裝 
 
  
關於偵測使用者是否root以及安裝那些app其實這部分有小爭議的說 
有些人會覺得侵犯個人隱私,以及我root又不是要開外掛............................等 
我想使用者會想root最主要原因還是 
1.刪除內建一堆一次都開不到的app(這些app都允許後台進行啟動,明明都沒用卻還吃RAM+吃電)   SAXXXNG 說的就是你!! 
2.美化系統(這就跟xposed有關係,懶的介紹+說明) 
3.開發者有其用途 
4.自己掌握app權限(這部份很多人有這需求喔!) 
5.虛擬按鍵(有實體按鍵例如:S3/S2 那種,為減少home提早往生會使用EasyTouch,然而控制工作列等....就是要root) 
6.P孩只想開外掛((BJ4... 
7.不root渾身不舒服的((強迫症.... 
 
當然你可能還有各種妳需求對應的目的才去冒著風險root,我想這部分.......................................解鈴還需繫鈴人啊 
 
 |   
 
- 
總評分: 經驗 + 24 
 查看全部評分
 
 
 
  
 |