|
| 1 | +Android 14 Root Certificate Installation Bypass |
| 2 | +============= |
| 3 | + |
| 4 | +Language/[日本語](Readme-ja.md) |
| 5 | + |
| 6 | +## Overview |
| 7 | + |
| 8 | +Android 14 or later has difficulty installing to trusted Root certificates. |
| 9 | + |
| 10 | +- https://httptoolkit.com/blog/android-14-breaks-system-certificate-installation/ |
| 11 | + |
| 12 | +Show how to bypass restrictions. |
| 13 | + |
| 14 | +## bypass point |
| 15 | + |
| 16 | +API-34 has been reading certificates from "/apex/com.android.conscrypt/cacerts" in the process of reading system certificates. |
| 17 | +However, when the system property is set to "system.certs.enabled", the code is to retrieve certificates from "/system/etc/security/cacerts/". |
| 18 | + |
| 19 | +- https://android-review.googlesource.com/c/platform/prebuilts/fullsdk/sources/+/2704396/1/android-34/android/security/net/config/SystemCertificateSource.java |
| 20 | + |
| 21 | +````java |
| 22 | +private static File getDirectory() { |
| 23 | + if ((System.getProperty("system.certs.enabled") != null) |
| 24 | + && (System.getProperty("system.certs.enabled")).equals("true")) { |
| 25 | + return new File(System.getenv("ANDROID_ROOT") + "/etc/security/cacerts"); |
| 26 | + } |
| 27 | + File updatable_dir = new File("/apex/com.android.conscrypt/cacerts"); |
| 28 | + if (updatable_dir.exists() |
| 29 | + && !(updatable_dir.list().length == 0)) { |
| 30 | + return updatable_dir; |
| 31 | + } |
| 32 | + return new File(System.getenv("ANDROID_ROOT") + "/etc/security/cacerts"); |
| 33 | +} |
| 34 | +```` |
| 35 | + |
| 36 | +Use this specification for bypass processing. |
| 37 | + |
| 38 | +## concept |
| 39 | + |
| 40 | +We created an Android XposedModule as a way to rewrite the "system.certs.enabled" system property. |
| 41 | + |
| 42 | +The XposedModule app created in the "OverrideSysPropModule/app/release" folder is placed in the "OverrideSysPropModule/app/release" folder. |
| 43 | + |
| 44 | +## procedure (Emulator) |
| 45 | + |
| 46 | +### Install Magisk |
| 47 | +For emulators, install Magisk according to the following procedure. |
| 48 | + |
| 49 | +1. https://github.com/newbit1/rootAVD Perform git clone from |
| 50 | + |
| 51 | +``` |
| 52 | +git clone https://github.com/newbit1/rootAVD.git |
| 53 | +``` |
| 54 | + |
| 55 | +2. Start the emulator. |
| 56 | + |
| 57 | +3. Execute the following command from PowerShell on the administration screen to confirm the ADV to be installed. |
| 58 | + |
| 59 | +```sh |
| 60 | +.\rootAVD.bat ListAllAVDs |
| 61 | + |
| 62 | +... |
| 63 | + |
| 64 | +Command Examples: |
| 65 | +rootAVD.bat |
| 66 | +rootAVD.bat ListAllAVDs |
| 67 | +rootAVD.bat InstallApps |
| 68 | + |
| 69 | +rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img |
| 70 | +rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img FAKEBOOTIMG |
| 71 | +rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img DEBUG PATCHFSTAB GetUSBHPmodZ |
| 72 | +rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img restore |
| 73 | +rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img InstallKernelModules |
| 74 | +rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules |
| 75 | +rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img InstallPrebuiltKernelModules GetUSBHPmodZ PATCHFSTAB DEBUG |
| 76 | +``` |
| 77 | + |
| 78 | +4. Download the latest Magsisk |
| 79 | + |
| 80 | +- https://github.com/topjohnwu/Magisk/releases |
| 81 | + |
| 82 | +5. copy the downloaded Magisk application to the folder "rootAVD/Apps" |
| 83 | +6. install Magisk including the latest |
| 84 | + |
| 85 | +```sh |
| 86 | +.\rootAVD.bat system-images\android-34\google_apis_playstore\x86_64\ramdisk.img |
| 87 | +``` |
| 88 | + |
| 89 | +### Install Magisk Module |
| 90 | + |
| 91 | +1. Install Magisk Module. |
| 92 | + |
| 93 | +- https://github.com/NVISOsecurity/MagiskTrustUserCerts/releases |
| 94 | +- https://github.com/LSPosed/LSPosed/releases (Install zygisk version) |
| 95 | + |
| 96 | +Install as needed |
| 97 | + |
| 98 | +- https://github.com/LSPosed/LSPosed.github.io/releases |
| 99 | + |
| 100 | +### Install XposedModule Module |
| 101 | + |
| 102 | +1. Install XposedModule in the "OverrideSysPropModule" folder. |
| 103 | + |
| 104 | +```` |
| 105 | +cd OverrideSysPropModule\app\release |
| 106 | +adb install app-release.apk |
| 107 | +```` |
| 108 | + |
| 109 | +2. Install a Root certificate such as Burp for user certificates. |
| 110 | + |
| 111 | +3. Enable the Module for the application to which you want to apply it. |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | +TIP: After enabling XposedModule, it may not be recognized properly unless the Android device is rebooted. |
0 commit comments