From c233e91abe029f0a8380bea12ed95bff6f483649 Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Sun, 17 Jul 2022 17:17:51 -0400 Subject: [PATCH 1/9] Fix install problem and Chrome Certificate Transparency problem --- META-INF/com/google/android/update-binary | 37 ++++++++++++++++++----- common/post-fs-data.sh | 2 +- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 08bd14f..28b48e5 100644 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -1,10 +1,33 @@ #!/sbin/sh -# This is a dummy file that should be replaced with a proper installer script -# If you are creating a module locally for personal usage or testing, -# download the script in the following URL: -# https://github.com/topjohnwu/Magisk/blob/master/scripts/module_installer.sh -# And replace this script with the downloaded script +################# +# Initialization +################# -# Error, this script should always be replaced -exit 1 +umask 022 + +# echo before loading util_functions +ui_print() { echo "$1"; } + +require_new_magisk() { + ui_print "*******************************" + ui_print " Please install Magisk v20.4+! " + ui_print "*******************************" + exit 1 +} + +######################### +# Load util_functions.sh +######################### + +OUTFD=$2 +ZIPFILE=$3 + +mount /data 2>/dev/null + +[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk +. /data/adb/magisk/util_functions.sh +[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk + +install_module +exit 0 diff --git a/common/post-fs-data.sh b/common/post-fs-data.sh index 9104bc9..9e272cc 100644 --- a/common/post-fs-data.sh +++ b/common/post-fs-data.sh @@ -12,7 +12,7 @@ MODDIR=${0%/*} # mv -f /data/misc/user/0/cacerts-added/12abc345.0 $MODDIR/system/etc/security/cacerts -mv -f /data/misc/user/0/cacerts-added/* $MODDIR/system/etc/security/cacerts +cp -f /data/misc/user/0/cacerts-added/* $MODDIR/system/etc/security/cacerts chown -R 0:0 $MODDIR/system/etc/security/cacerts [ "$(getenforce)" = "Enforcing" ] || exit 0 From 2502eed6a9ebe7cb9ad819d13be976ffac6d4ffa Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Sun, 17 Jul 2022 17:31:30 -0400 Subject: [PATCH 2/9] Update version code --- module.prop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.prop b/module.prop index 89ac79a..89a3ffc 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=movecert name=Move Certificates version=v1.9 -versionCode=10 +versionCode=11 author=yochananmarqos description=Moves certificates from the user certificate store to the system store. Removes the *Network may be monitored* warning. From 9ad93acfe44045245871575f4082ca93b709c715 Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Sun, 17 Jul 2022 17:33:26 -0400 Subject: [PATCH 3/9] Update version code --- module.prop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module.prop b/module.prop index 89a3ffc..970320a 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=movecert name=Move Certificates version=v1.9 -versionCode=11 +versionCode=11A author=yochananmarqos description=Moves certificates from the user certificate store to the system store. Removes the *Network may be monitored* warning. From a87f031710b2e56a8b09f6d960b8c82512f2b4ad Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Sun, 17 Jul 2022 17:50:57 -0400 Subject: [PATCH 4/9] Update Readme to mention recent fixes --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4298aab..51a918d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ Moves certificates from the user certificate store to the system store. Also rem If you use AdGuard, you probably want to use [adguardcert](https://github.com/AdguardTeam/adguardcert) instead. ## Changelog +v1.9.11a +* Fixed install issue in Magisk, credit to [azio7](https://github.com/Magisk-Modules-Repo/movecert/pull/14) +* Fixed Chrome Certificate Transparency problem, by copying rather than moving the certificate from the User store + v1.9 * Dynamically determine correct SELinux context for cert from device itself. * AdGuard users may need to reinstall their HTTPS filtering certificate. From d0502865504b72c2bd50ad5ccf9d2c20cca4c9a2 Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Sun, 17 Jul 2022 18:06:14 -0400 Subject: [PATCH 5/9] Update version code and README --- README.md | 7 ++++--- module.prop | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 51a918d..9ec8a35 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,10 @@ Moves certificates from the user certificate store to the system store. Also rem If you use AdGuard, you probably want to use [adguardcert](https://github.com/AdguardTeam/adguardcert) instead. ## Changelog -v1.9.11a -* Fixed install issue in Magisk, credit to [azio7](https://github.com/Magisk-Modules-Repo/movecert/pull/14) -* Fixed Chrome Certificate Transparency problem, by copying rather than moving the certificate from the User store +v2.0 +* Changed behavior to copy instead of moving the certificate. + * The certificate ends up in two locations, one in the User store and one in the System store. This addresses the Chrome Certificate Transparency problem discussed [here](https://github.com/Magisk-Modules-Repo/movecert/issues/15) and [here](https://github.com/AdguardTeam/AdguardForAndroid/issues/4124#issuecomment-1066078974). Note that enabling Zygisk and adding Chrome to the DenyList is required for this to work. +* Fixed install issue in Magisk, where this module would not install correctly. Credit to [azio7](https://github.com/Magisk-Modules-Repo/movecert/pull/14). v1.9 * Dynamically determine correct SELinux context for cert from device itself. diff --git a/module.prop b/module.prop index 970320a..725e532 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=movecert name=Move Certificates -version=v1.9 -versionCode=11A +version=v2.0 +versionCode=1 author=yochananmarqos description=Moves certificates from the user certificate store to the system store. Removes the *Network may be monitored* warning. From c4cd0c23db3a3b02ef267a500704ba5ce8c6905e Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Mon, 19 Sep 2022 16:30:52 -0400 Subject: [PATCH 6/9] Updated install notes. Fixed release zip. --- README.md | 4 ++++ install.sh | 6 +++--- module.prop | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9ec8a35..0f4d900 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ Moves certificates from the user certificate store to the system store. Also rem If you use AdGuard, you probably want to use [adguardcert](https://github.com/AdguardTeam/adguardcert) instead. ## Changelog +v2.0.1 +* Updated install messages +* 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. + v2.0 * Changed behavior to copy instead of moving the certificate. * The certificate ends up in two locations, one in the User store and one in the System store. This addresses the Chrome Certificate Transparency problem discussed [here](https://github.com/Magisk-Modules-Repo/movecert/issues/15) and [here](https://github.com/AdguardTeam/AdguardForAndroid/issues/4124#issuecomment-1066078974). Note that enabling Zygisk and adding Chrome to the DenyList is required for this to work. diff --git a/install.sh b/install.sh index 27cd95c..986496f 100644 --- a/install.sh +++ b/install.sh @@ -122,10 +122,10 @@ REPLACE=" # Set what you want to display when installing your module print_modname() { - ui_print "*******************************" + ui_print "****************************************************" ui_print " Move Certificates " - ui_print " by yochananmarqos @XDA " - ui_print "*******************************" + ui_print " by yochananmarqos (edited by Andy Acer) @XDA " + ui_print "****************************************************" } # Copy/extract your module files into $MODPATH in on_install. diff --git a/module.prop b/module.prop index 725e532..a1c3a0d 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=movecert name=Move Certificates -version=v2.0 +version=v2.0.1 versionCode=1 -author=yochananmarqos -description=Moves certificates from the user certificate store to the system store. Removes the *Network may be monitored* warning. +author=yochananmarqos (edited by Andy Acer) +description=Copies certificates from the user certificate store into the system store. Removes the *Network may be monitored* warning. From 04b3d7fa669c2586a0cf3c0c2a921d3a81a12c63 Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Wed, 24 May 2023 17:02:37 -0400 Subject: [PATCH 7/9] Updated README to clarify the changes to this script. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f4d900..51318dc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # **Move Certificates** ## Description -Moves certificates from the user certificate store to the system store. Also removes the *Network may be monitored* warning. +Copies certificates from the user certificate store into the system store. Also removes the *Network may be monitored* warning. + +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. If you use AdGuard, you probably want to use [adguardcert](https://github.com/AdguardTeam/adguardcert) instead. From f6ba94b4357e2168bf636bcd7efeab76a63b3251 Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Wed, 24 May 2023 17:05:07 -0400 Subject: [PATCH 8/9] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 51318dc..f71cb29 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ Copies certificates from the user certificate store into the system store. Also 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. -If you use AdGuard, you probably want to use [adguardcert](https://github.com/AdguardTeam/adguardcert) instead. - ## Changelog v2.0.1 * Updated install messages From 6a7e48d9800029c2c6930495b8dc312827b85053 Mon Sep 17 00:00:00 2001 From: Andy Acer Date: Mon, 5 Jun 2023 14:52:59 -0400 Subject: [PATCH 9/9] Update README.md to reflect that it's copying, not moving --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f71cb29..36e2500 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# **Move Certificates** +# **Copy Certificates** ## Description Copies certificates from the user certificate store into the system store. Also removes the *Network may be monitored* warning.