Skip to content

Commit bdb23da

Browse files
committed
Support Android 14
1 parent 6a7e48d commit bdb23da

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Copies certificates from the user certificate store into the system store. Also
55
Note that this is a significant change from the historical use of this module. By copying, instead of moving, the Certificate Transparency problem for proxying Google Chrome has been solved. See notes and links in the changelog below for more details on this.
66

77
## Changelog
8+
v2.0.2
9+
* support Android 14
10+
811
v2.0.1
912
* Updated install messages
1013
* Fixed the release binary. I'd previously accidentally included the entire .git repository in the installer zip. Whoopsie. Down to 8KB when I had it at 80KB before.

common/post-fs-data.sh

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,37 @@ MODDIR=${0%/*}
1313
# mv -f /data/misc/user/0/cacerts-added/12abc345.0 $MODDIR/system/etc/security/cacerts
1414

1515
cp -f /data/misc/user/0/cacerts-added/* $MODDIR/system/etc/security/cacerts
16-
chown -R 0:0 $MODDIR/system/etc/security/cacerts
1716

1817
[ "$(getenforce)" = "Enforcing" ] || exit 0
18+
A14CA_PATH=/apex/com.android.conscrypt/cacerts
19+
if [ -d "$A14CA_PATH" ]; then
20+
#Support Android 14, Thanks https://weibo.com/3322982490/Ni21tFiR9
21+
CA_TMP_DIR=/data/local/tmp/cacerts
22+
rm -rf "$CA_TMP_DIR"
23+
mkdir -p -m 700 "$CA_TMP_DIR"
24+
mount -t tmpfs tmpfs "$CA_TMP_DIR"
1925

20-
default_selinux_context=u:object_r:system_file:s0
21-
selinux_context=$(ls -Zd /system/etc/security/cacerts | awk '{print $1}')
26+
cp -f $A14CA_PATH/* $CA_TMP_DIR
27+
cp -f $MODDIR/system/etc/security/cacerts/* $CA_TMP_DIR
2228

23-
if [ -n "$selinux_context" ] && [ "$selinux_context" != "?" ]; then
24-
chcon -R $selinux_context $MODDIR/system/etc/security/cacerts
25-
else
26-
chcon -R $default_selinux_context $MODDIR/system/etc/security/cacerts
29+
chown -R 0:0 "$CA_TMP_DIR"
30+
set_context "$A14CA_PATH" "$CA_TMP_DIR"
31+
CNUM="$(ls -1 $CA_TMP_DIR | wc -l)"
32+
if [ "$CNUM" -gt 10 ]; then
33+
mount -o bind "$CA_TMP_DIR" $A14CA_PATH
34+
fi
35+
umount "$TEMCA_TMP_DIRP_CA_TMP_DIRDIR"
36+
rmdir "$CA_TMP_DIR"
37+
rm -rf "$CA_TMP_DIR"
38+
else
39+
chown -R 0:0 $MODDIR/system/etc/security/cacerts
40+
default_selinux_context=u:object_r:system_file:s0
41+
selinux_context=$(ls -Zd /system/etc/security/cacerts | awk '{print $1}')
42+
if [ -n "$selinux_context" ] && [ "$selinux_context" != "?" ]; then
43+
chcon -R $selinux_context $MODDIR/system/etc/security/cacerts
44+
else
45+
chcon -R $default_selinux_context $MODDIR/system/etc/security/cacerts
46+
fi
2747
fi
48+
49+

module.prop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=movecert
22
name=Move Certificates
3-
version=v2.0.1
3+
version=v2.0.2
44
versionCode=1
5-
author=yochananmarqos (edited by Andy Acer)
5+
author=yochananmarqos (edited by Andy Ace And zhaoboy9692)
66
description=Copies certificates from the user certificate store into the system store. Removes the *Network may be monitored* warning.

0 commit comments

Comments
 (0)