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

0   90 轉為簡體

Solve Xposed module list become empty on Android 6.0 Marshmallow

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。


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.

一個使用Cloudflare API v4的動態DNS腳本

0   1556 轉為簡體

分享一個使用Cloudflare API v4的動態dns腳本(Gist地址本地下載)。

因為11月Cloudflare就要下線v1版本的API了,而Openwrt里的ddns-scripts並沒有支持新版[攤手],所以自己寫了一個。

僅依賴curl(可以改成wget)。支持v4和v6。會請求ip.yooooo.us得到公網IP地址,怕隱私泄露的可以自己搭一個

 

This is a DDNS script using Cloudflare APIv4 written in bash (Gist or Download directly).

I wrote this because Cloudflare is going to remove support for the old API on Nov. this year. And the ddns-scripts package in Openwrt is not yet supporting the new API [攤手].

This script only depends on curl (can be modified to use wget). It will use ip.yooooo.us to query IPv4 and IPv6. You can use this link to set up your own query server.

deluge各種問題導致狀態機抽風

6   1579 轉為簡體

遇到一個問題,設置了deluge分享率和做種時間到一定時間之後自動刪除種子。之前一直很好使的,最近發現到了指定的分享率或者做種時間之後,種子狀態變成了一直Paused或者一直Seeding。發現有這麼幾種問題導致deluge抽風:

狀態存檔的權限不對

是deluged沒有對狀態存檔~/.config/deluge/session.state和~/.config/deluge/state/*的寫權限導致的。

因為自身需求使用

#  start-stop-daemon -S -c user:www-data -k 000 -x /usr/bin/deluged — -d

啟動deluged,deluged具有user的euid和www-data的egid,而~是user:user的。所以就掛了233

直接添加種子下載地址導致一直Paused

deluge可以直接添加種子的http下載地址,取得種子之後自動開始下載,但是這樣有一定幾率產生萬年Paused。

解決辦法是自己下載種子之後返回磁力鏈添加到deluge。