Skip to content

Commit 225923a

Browse files
committed
Update
1 parent 5de94bf commit 225923a

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
# Copy Certificates
22

3-
Based on [Move Certificates](https://github.com/Magisk-Modules-Repo/movecert). Copies certificates
4-
from the user certificate store to the system store, while also forcing Chrome on the Zygisk
5-
denylist. This way Chrome still sees the custom certificates in the user store, while other apps see
6-
them in the system store. Useful since Chrome started requiring CT logs for all certs in the system
7-
store.
3+
Based on [Move Certificates](https://github.com/Magisk-Modules-Repo/movecert).
4+
5+
Chrome recently started requiring CT logs for CA certs found in the system store.
6+
This module copies AdGuard's CA certificate from the user store to the system store.
7+
It also contains a Zygisk module that "hides" any modifications done by Magisk from
8+
Chrome's processes. This way Chrome only finds AdGuard's certificate in the user store
9+
and doesn't complain about the missing CT log, while other apps continue to use the
10+
same certificate from the system store.
11+
12+
# Usage
13+
1. Enable HTTPS filtering and save/install AdGuard's certificate to the user store.
14+
2. Enable Magisk->Settings->Zygisk.
15+
3. Download the zip file from releases.
16+
4. Go to Magisk->Modules->Install from storage and select the downloaded zip file.
17+
5. Reboot.
818

919
# Building
1020

1121
Update git modules:
12-
```
22+
```shell
1323
git submodule init && git submodule update
1424
```
1525

16-
You'll need Android SDK with NDK v23.1.7779620. Run:
26+
You'll need an Android SDK with NDK version 23.1.7779620. Run:
1727

1828
```shell
1929
ANDROID_SDK=<path-to-android-sdk> ./dist.sh
2030
```
2131

2232
If you prefer to manage your Zygisk denylist yourself, simply remove the Zygisk part of the module:
2333
```shell
24-
zip CopyCert-v1.0.zip -d "zygisk/*"
34+
zip adguardcert-v1.0.zip -d "zygisk/*"
2535
```

dist.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ curl "${UPDATE_BINARY_URL}" > ./module/META-INF/com/google/android/update-binary
3030
echo "#MAGISK" > ./module/META-INF/com/google/android/updater-script
3131

3232
VERSION=$(sed -ne "s/version=\(.*\)/\1/gp" ./module/module.prop)
33+
NAME=$(sed -ne "s/id=\(.*\)/\1/gp" ./module/module.prop)
3334

34-
rm -f CopyCert-${VERSION}.zip
35+
rm -f ${NAME}-${VERSION}.zip
3536
(
3637
cd ./module
37-
zip ../CopyCert-${VERSION}.zip -r * -x ".*" "*/.*"
38+
zip ../${NAME}-${VERSION}.zip -r * -x ".*" "*/.*"
3839
)

module/module.prop

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
id=copycert
2-
name=Copy Certificates
1+
id=adguardcert
2+
name=AdGuard Certificate
33
version=v1.0
44
versionCode=1
55
author=AdGuard
6-
description=Copies certificates from the user certificate store to the system store and forces Chrome on the Zygisk denylist.
6+
description=Copies AdGuard's CA certificate from the user certificate store to the system store and forces Zygisk unmount procedures for Chrome.

module/post-fs-data.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/system/bin/sh
22
MODDIR=${0%/*}
33

4-
cp -f /data/misc/user/*/cacerts-added/* $MODDIR/system/etc/security/cacerts
4+
# Android hashes the subject to get the filename, field order is significant
5+
# AdGuard certificate is /C=EN/O=AdGuard/CN=AdGuard Personal CA
6+
# The filename is then <hash>.<n> where <n> is an integer
7+
AG_CERT_HASH=0f4ed297
8+
cp -f /data/misc/user/*/cacerts-added/${AG_CERT_HASH}.* $MODDIR/system/etc/security/cacerts
59
chown -R 0:0 $MODDIR/system/etc/security/cacerts
610

711
[ "$(getenforce)" = "Enforcing" ] || exit 0

0 commit comments

Comments
 (0)