Skip to content

Commit 6e3b1d6

Browse files
committed
rollback
1 parent 800d4b2 commit 6e3b1d6

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

module/module.prop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=adguardcert
22
name=AdGuard Certificate
3-
version=v2.0-beta3
4-
versionCode=32
3+
version=v2.0-beta4
4+
versionCode=33
55
author=AdGuard
66
description=Moves AdGuard's root CA certificate from the user certificate store to the system certificate store.

module/post-fs-data.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,22 @@ MODDIR=${0%/*}
33

44
# Android hashes the subject to get the filename, field order is significant.
55
# (`openssl x509 -in ... -noout -hash`)
6-
# AdGuard's primary certificate is "/C=EN/O=AdGuard/CN=AdGuard Personal CA".
7-
# AdGuard's intermediate certificate is "/C=EN/O=AdGuard/CN=AdGuard Personal Intermediate".
6+
# AdGuard's certificate is "/C=EN/O=AdGuard/CN=AdGuard Personal CA".
87
# The filename is then <hash>.<n> where <n> is an integer to disambiguate
98
# different certs with the same hash (e.g. when the same cert is installed repeatedly).
109
#
1110
# Due to https://github.com/AdguardTeam/AdguardForAndroid/issues/2108
12-
# 1. Retrieve the most recent primary and intermediate certificates with our hash from the user store.
13-
# It is assumed that the last installed AdGuard's certs are the correct ones.
14-
# 2. Check the existence of AdGuard's intermediate certificate. If the certificate is not present,
15-
# the steps 3 and 4 will be skipped.
16-
# 3. Copy the primary AdGuard certificate to the system store under the name "<hash>.0".
11+
# 1. Retrieve the most recent certificate with our hash from the user store.
12+
# It is assumed that the last installed AdGuard's cert is the correct one.
13+
# 2. Copy the AdGuard certificate to the system store under the name "<hash>.0".
1714
# Note that some apps may ignore other certs.
18-
# 4. Remove all certs with our hash from the `cacerts-removed` directory.
15+
# 3. Remove all certs with our hash from the `cacerts-removed` directory.
1916
# They get there if a certificate is "disabled" in the security settings.
2017
# Apps will reject certs that are in the `cacerts-removed`.
2118
AG_CERT_HASH=0f4ed297
22-
AG_INTERMEDIATE_CERT_HASH=47ec1af8
2319
AG_CERT_FILE=$(ls /data/misc/user/*/cacerts-added/${AG_CERT_HASH}.* | (IFS=.; while read -r left right; do echo $right $left.$right; done) | sort -nr | (read -r left right; echo $right))
24-
AG_INTERMEDIATE_CERT_FILE=$(ls /data/misc/user/*/cacerts-added/${AG_INTERMEDIATE_CERT_HASH}.* | (IFS=.; while read -r left right; do echo $right $left.$right; done) | sort -nr | (read -r left right; echo $right))
2520
26-
if [ -e "${AG_CERT_FILE}" ] && [ -e "${AG_INTERMEDIATE_CERT_FILE}" ]; then
21+
if [ -e "${AG_CERT_FILE}" ]; then
2722
cp -f ${AG_CERT_FILE} ${MODDIR}/system/etc/security/cacerts/${AG_CERT_HASH}.0
2823
rm -f /data/misc/user/*/cacerts-removed/${AG_CERT_HASH}.*
2924
fi

0 commit comments

Comments
 (0)