Android AndFix修複方式的限制

來源:互聯網
上載者:User

標籤:

這裡閱覽了很多網上關於修複的資料,一一貼在這裡便於查看:

https://github.com/alibaba/AndFix  這是官方處  要瞭解使用,一定得看看這裡。

http://www.jianshu.com/p/479b8c7ec3e3 如果你看不懂官方的,就看看這裡。

http://blog.csdn.net/lpftobetheone/article/details/50435371  適合初步瞭解使用,一個簡單的Demo(這篇文章裡面有對補丁只能載入一次問題的解決)

http://www.cnblogs.com/common1140/p/5287040.html  這一篇更貼近於我們的實際開發,如何使用修複- 產生 - 上傳補丁 -下載補丁

https://mp.weixin.qq.com/s?__biz=MzI1MTA1MzM2Nw==&mid=400118620&idx=1&sn=b4fdd5055731290eef12ad0d17f39d4a&scene=1&srcid=1106Imu9ZgwybID13e7y2nEi#wechat_redirect 這裡是尋找原理的地方

下面說一下修複的幾種方式:

AndFix修複:

① 不支援YunOS
② 無法添加新類和新的欄位
③ 需要使用加固前的apk製作補丁,但是補丁檔案很容易被反編譯,也就是修改過的類源碼容易泄露。
④ 使用加固平台可能會使熱補丁功能失效(看到有人在360加固提了這個問題,自己還未驗證)。

⑤ andfix不支援布局資源等的修改

⑥ 官網:AndFix supports Android version from 2.3 to 7.0, both ARM and X86 architecture, both Dalvik and ART runtime, both 32bit and 64bit.

⑦ 應用patch不需要重啟。但由於從實現上直接跳過了類初始化,設定為初始化完畢,所以像是靜態函數、靜態成員、建構函式都會出現問題,複雜點的類Class.forname很可能直接就會掛掉。

⑧ AndFix的一個潛在問題:

    載入一次補丁後,out.apatch檔案會copy到getFilesDir目錄下的/apatch檔案夾中,在下次補丁更新時,會檢測補丁是否已經添加在apatch檔案夾下,已存在就不會複製載入sdcard的out.apatch。

源碼:

public void addPatch(String path) throws IOException { File src = new File(path);    File dest = new File(mPatchDir, src.getName());    if(!src.exists()){ 
    throw new FileNotFoundException(path); }
   if (dest.exists()) {
     Log.d(TAG, "patch [" + path + "] has be loaded."); return; }
   FileUtil.copyFile(src, dest);// copy to patch‘s directory Patch patch = addPatch(dest); if (patch != null) {
    loadPatch(patch); }
}

 

Android AndFix修複方式的限制

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.