Tag Archives

13 Articles

Solve Xposed module list become empty on Android 6.0 Marshmallow

0   7946 轉為簡體

中文版本

Recently I found module list in Xposed become empty after I upgrade my Nexus5 to 6.0.1 (M4B30Z, Dec 2016). And all the modules are not activating. So I open logcat and see the following:

Rovo89 said on a xda post that this file should be created if any module is activated. But somehow it didn’t do so on my Nexus5. So I create one myself and set correct permission (0644) and uid (you can run the Xposed Installer app and check the uid through ps |grep xposed). Then I reboot and check logcat again:

Looks like it’s still not working.

Then I realise that Android started to set SELinux to enforce from Lollipop (5.0) so this should be the problem. (We can use dmesg|grep audit to check if the problem really related to SELinux. ) I compared a random file under /data/data to the file we just created:

So all we need to do is to change this conf/modules.list to u:object_r:app_data_file:s0:c512,c768 as well

restorecon is a applet shipped with toybox, we can also use chcon to manually set SELinux context.

解決Android 6.0 Marshmallow中Xposed的模塊列表為空

4   20147 轉為簡體

English Version

升級Nexus5 到6.0.1 (M4B30Z, Dec 2016)之後,Xposed的模塊列表變成空的了,所有的模塊也都失效了。沒有xposed,怎麼種莊稼。於是我打開logcat看了一眼。

rovo89在xda的QA帖中說一般情況下這個文件會在啟用任意一個模塊後創建。然而現在它並沒有被創建。於是我去建了一個,然後chmod 644以及chown到應用到uid(可以通過啟動應用之後ps|grep xposed查看uid,形如u0_a??),重啟了一下,再瞄了一眼logcat。

好像哪裡不對

想起來Android從蘿莉棒開始SELinux就是enforce了,所以大概是這個問題。(我們可以通過dmesg|grep audit來查看被SELinux過濾的各種奇怪操作。)於是看了一下默認的文件context和我們剛創建的文件的context:

那麼我們把這個conf/modules.list也改成u:object_r:app_data_file:s0:c512,c768這個context好了

restorecon是toybox中帶的一個applet,我們也可以用chcon來手動更改context。

Nexus5手動ota升級Android [更新5.1]

10   17155 轉為簡體

我知道你們一定和我一樣在system分區幹了奇怪的事情

然後驗證通不過了吧

啊哈哈哈哈哈除了fastboot刷system鏡像之外,你還可以這樣修復。

首先我們先理解一下OTA包的原理

實際上解包以後可以發現其實是一大堆差量補丁。

這就是說,修改/system分區下原有的文件時會死的,往裡面寫新的文件時不會死的。 Read More

讓QPython自帶的終端支持UTF-8

0   8654 轉為簡體

QPython是一個好東西,是SL4A項目的繼承人,唯一蛋疼的是它自帶的終端不支持UTF-8編碼,東南亞人民都表示很憤怒

而且在play上提了建議到現在還沒改╮(╯-╰)╭ ,所以只能自己改了

smali它的dex。其實這個終端是從jackpal.androidterm這裡改出來了,發現各種關於utf-8編解碼的代碼都在,只是QPython把配置activity全部換了,於是Default to UTF-8那個配置就點不到了orz

然後就改了這些地方

Class TerminalEmulator

Class TerminalSession

重新打包簽名運行,ls /sdcard,測試成功

這裡是修改過的apk,版本是0.9.6.2 度娘雲

你也可以選擇自己編譯,這裡是修改好的smali 度娘雲