EdXposed icon indicating copy to clipboard operation
EdXposed copied to clipboard

DNSCrypt-Proxy 2

Open bonbonboi opened this issue 7 years ago • 11 comments

I've DNSCrypt-Proxy 2 Magisk Module installed, I've a strange issue which is whenever "Riru - EdXposed (YAHFA / SandHook) installed/activated, the DNSCrypt-Proxy 2 don't start after boot, when I uninstall/deactivate "Riru - EdXposed (YAHFA/SandHook)" module, the DNSCrypt-Proxy 2 back to start after boot normally.

Setup: Magisk: 20.1 (20100) Activated Modules: Riru - Core v19.5 Riru - EdXposed v0.4.5.1_beta(4463) (YAHFA)

Others: EdXposed Manager v4.5.2

bonbonboi avatar Nov 20 '19 12:11 bonbonboi

I don't know if it is your case, but EdXposed is known to break Magisk boot scripts. (bug of EdXposed? Magisk? Both? I really don't know, but this does happen since long time on lots of devices)

This is specially true for service.d scripts. And then any (all!) Magisk modules that depends on service.d will misbehave or fail completely when EdXposed is installed (even with no Xposed modules).

I'd suggest you to check if DNSCrypt module have some critical service.d scripts.

radio070201 avatar Nov 25 '19 00:11 radio070201

Make sure your module's script properly go into background.When some module's script stuck at at foreground,EdXp will take the prior and magisk will kill the stucked script.

eebssk1 avatar Nov 25 '19 06:11 eebssk1

I don't know if it is your case, but EdXposed is known to break Magisk boot scripts. (bug of EdXposed? Magisk? Both? I really don't know, but this does happen since long time on lots of devices)

This is specially true for service.d scripts. And then any (all!) Magisk modules that depends on service.d will misbehave or fail completely when EdXposed is installed (even with no Xposed modules).

I'd suggest you to check if DNSCrypt module have some critical service.d scripts.

The startup script is located at /data/adb/modules/dnscrypt-proxy-android/service.sh I have no idea why EdXsposed stops that script on boot.

bonbonboi avatar Nov 27 '19 13:11 bonbonboi

Make sure your module's script properly go into background.When some module's script stuck at at foreground,EdXp will take the prior and magisk will kill the stucked script.

How?

bonbonboi avatar Nov 27 '19 13:11 bonbonboi

Make sure your module's script properly go into background.When some module's script stuck at at foreground,EdXp will take the prior and magisk will kill the stucked script.

How?

if your binaries support logging,try redirect them to a file,or write the pid out when starting in background.Then check the files.If files present,it means your binaries are running but they got killed either not go into background(not apply to service.d but better force go into background to avoid most problems) or magisk bugged(happened to me). if not present ,this means other or your own modules/scripts are using magic syscalls which breaks magisk and mess up booting(happend to me again).

eebssk1 avatar Nov 27 '19 13:11 eebssk1

Also do you have the full magisk logs?

eebssk1 avatar Nov 27 '19 13:11 eebssk1

Make sure your module's script properly go into background.When some module's script stuck at at foreground,EdXp will take the prior and magisk will kill the stucked script.

How?

if your binaries support logging,try redirect them to a file,or write the pid out when starting in background.Then check the files.If files present,it means your binaries are running but they got killed either not go into background(not apply to service.d but better force go into background to avoid most problems) or magisk bugged(happened to me). if not present ,this means other or your own modules/scripts are using magic syscalls which breaks magisk and mess up booting(happend to me again).

man, I'm not that expert with Magisk/EdXposed internals, you want me to do things which are out of my scope, so if you want to help, please test it by yourself, like install DNSCrypt-Proxy 2 Magisk Module, see the issue yourself, and test your theories against it.

But in case you're unfamiliar with dnscrypt package, then I tell you here about it. It has "dnscrypt-proxy" as binary executable file. it reads its config via another file, which is name dnscrypt-proxy.toml.

Regarding to Magisk file structure: /data/adb/modules/dnscrypt-proxy-android/service.sh This is the contents of service.sh script:

#!/system/bin/sh MODDIR=${0%/*} while ! [ pgrep -x dnscrypt-proxy ] ; do $MODDIR/system/bin/dnscrypt-proxy -config /data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml && sleep 15; done

/data/adb/modules/dnscrypt-proxy-android/system/bin/dnscrypt-proxy That is the binary file

Again, the issue is after installing EdXposed, the /data/adb/modules/dnscrypt-proxy-android/service.sh Script doesn't get executed on boot.

bonbonboi avatar Dec 02 '19 17:12 bonbonboi

No progress on this issue!

bonbonboi avatar Jan 08 '20 16:01 bonbonboi

确保模块的脚本正确进入后台。当某个模块的脚本卡在前台时,EdXp将优先执行,而magisk将杀死该卡的脚本。

怎么样?

如果您的二进制文件支持日志记录,请尝试将其重定向到文件,或在后台启动时将其写出。然后检查文件。如果文件存在,则表明您的二进制文件正在运行,但是它们被杀死了,或者没有进入后台(不适用)到service.d,但最好用武力进入后台以避免大多数问题)或magisk bug(发生在我身上)。 如果不存在,则意味着其他或您自己的模块/脚本使用了不可思议的syscall,它破坏了magisk并弄乱了启动过程(再次发生在我面前)。

伙计,我不是Magisk / EdXposed内部构件的专家,您想让我做超出我的范围的事情,因此,如果您想提供帮助,请自己进行测试,例如安装DNSCrypt-Proxy 2 Magisk模块,请参见自己发行,并根据它检验您的理论。

但是,如果您不熟悉dnscrypt软件包,那么我在这里告诉您。 它具有“ dnscrypt-proxy”作为二进制可执行文件。它通过另一个文件dnscrypt-proxy.toml读取其配置。

关于Magisk文件结构: /data/adb/modules/dnscrypt-proxy-android/service.sh 这是service.sh脚本的内容:

#!/system/bin/sh MODDIR = $ {0%/ *} while ! [pgrep -x dnscrypt-proxy ] ; do $ MODDIR / system / bin / dnscrypt-proxy -config /data/media/0/dnscrypt-proxy/dnscrypt-proxy.toml && sleep 15; done

/ data / adb / modules / dnscrypt-proxy-android / system / bin / dnscrypt-proxy 这是二进制文件

同样,问题是在安装EdXposed之后,/ data / adb / modules / dnscrypt-proxy-android / service.sh脚本无法在启动时执行。

add a line to service.sh to test?

such as "echo test>/data/local/test.txt"

MlgmXyysd avatar Jan 08 '20 16:01 MlgmXyysd

According to topjohnwu, in latest magisk, service.sh runs independently in the background and should not be blocked and killed

MlgmXyysd avatar Jan 08 '20 16:01 MlgmXyysd

I tested on Android 8.1 r4 x86 with Magisk 20.4 Riru-Core 19.8 EdXposed YAHFA 0.4.6.1 and DNSCrypt-Proxy start and works without issue. @MlgmXyysd I think this issue can be closed.

ghost avatar Apr 05 '20 12:04 ghost