diff --git a/module/module.prop b/module/module.prop index d73ed25..e1a62db 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,6 +1,6 @@ id=adguardcert name=AdGuard Certificate -version=v2.0 +version=v2.1-beta1 versionCode=35 author=AdGuard description=Moves AdGuard's root CA certificate from the user certificate store to the system certificate store. diff --git a/module/post-fs-data.sh b/module/post-fs-data.sh index 3492e0f..29c270b 100644 --- a/module/post-fs-data.sh +++ b/module/post-fs-data.sh @@ -57,7 +57,7 @@ if [ -d /apex/com.android.conscrypt/cacerts ]; then cp -f /apex/com.android.conscrypt/cacerts/* /data/local/tmp/adg-ca-copy/ # Do the same as in Magisk module - cp -f ${AG_CERT_FILE} /data/local/tmp/adg-ca-copy + cp -f ${AG_CERT_FILE} /data/local/tmp/adg-ca-copy/${AG_CERT_HASH}.0 chown -R 0:0 /data/local/tmp/adg-ca-copy set_context /apex/com.android.conscrypt/cacerts /data/local/tmp/adg-ca-copy @@ -65,6 +65,10 @@ if [ -d /apex/com.android.conscrypt/cacerts ]; then CERTS_NUM="$(ls -1 /data/local/tmp/adg-ca-copy | wc -l)" if [ "$CERTS_NUM" -gt 10 ]; then mount --bind /data/local/tmp/adg-ca-copy /apex/com.android.conscrypt/cacerts + for pid in 1 $(pgrep zygote) $(pgrep zygote64); do + nsenter --mount=/proc/${pid}/ns/mnt -- \ + /bin/mount --bind /data/local/tmp/adg-ca-copy /apex/com.android.conscrypt/cacerts + done else echo "Cancelling replacing CA storage due to safety" fi