### Install Module via Magisk Manager Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt Download the module ZIP from GitHub releases and install it through the Magisk Manager application. A device reboot is required after installation. ```bash # Download the module ZIP from GitHub releases # https://github.com/NVISOsecurity/AlwaysTrustUserCerts/releases/download/v1.3/AlwaysTrustUserCerts_v1.3.zip # Install via Magisk Manager: # 1. Open Magisk Manager # 2. Go to Modules section # 3. Tap "Install from storage" # 4. Select the downloaded ZIP file # 5. Reboot device ``` -------------------------------- ### Verify Certificate Installation Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt Check the module's log file after reboot for expected output indicating successful certificate processing. Additionally, verify the certificate's presence in the system trust store using ADB. ```bash # Check module logs after reboot ``` ```bash adb shell su -c "cat /data/adb/modules/trustusercerts/log.txt" # Expected output for conscrypt devices: # 06-05 10:30:15 MagiskTrustUserCerts - post-fs-data.sh # 06-05 10:30:15 Grabbing user certs # 06-05 10:30:15 Grabbing user cert: 9a5ba575.0 # 06-05 10:30:15 Grabbing /system certs # 06-05 10:30:20 MagiskTrustUserCerts - service.sh # 06-05 10:30:25 Grabbing apex certs # 06-05 10:30:26 Injecting into zygote (1234) # 06-05 10:30:26 Finished injecting certs # Verify certificate is in system store ``` ```bash adb shell su -c "ls -la /system/etc/security/cacerts/ | grep 9a5ba575" ``` -------------------------------- ### Install Module via ADB Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt Push the module ZIP to the device's SD card and install it using Magisk commands within an ADB root shell. A reboot is necessary to complete the installation. ```bash # Push module to device ``` ```bash adb push AlwaysTrustUserCerts_v1.3.zip /sdcard/ # Install via Magisk (requires root shell) ``` ```bash adb shell su magisk --install-module /sdcard/AlwaysTrustUserCerts_v1.3.zip reboot ``` -------------------------------- ### Install User Certificate Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt Export your proxy CA certificate, convert it to PEM format, calculate its hash for Android naming, and push it to the device. Install it via device settings and reboot for the module to detect it. ```bash # Export your proxy CA certificate (e.g., Burp Suite, mitmproxy) # Convert to Android-compatible format if needed: ``` ```bash openssl x509 -inform DER -in burp-ca.der -out burp-ca.pem # Calculate the certificate hash for Android naming ``` ```bash HASH=$(openssl x509 -inform PEM -subject_hash_old -in burp-ca.pem | head -1) cp burp-ca.pem ${HASH}.0 # Push to device and install as user certificate ``` ```bash adb push ${HASH}.0 /sdcard/ # On device: Settings > Security > Encryption & credentials > Install a certificate # Select "CA certificate" and choose the pushed file # Reboot device to activate the module ``` ```bash adb reboot ``` -------------------------------- ### Check Module Installation Status Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt Use these bash commands to verify if the module is installed and enabled on the device via ADB. ```bash # Verify module is installed and enabled adb shell su -c "ls -la /data/adb/modules/trustusercerts/" # Expected output: # drwxr-xr-x module.prop # -rwxr-xr-x post-fs-data.sh # -rwxr-xr-x service.sh # -rw-r--r-- log.txt # drwxr-xr-x system/ ``` ```bash # Check if module is disabled adb shell su -c "test -f /data/adb/modules/trustusercerts/disable && echo 'DISABLED' || echo 'ENABLED'" ``` ```bash # View detailed logs adb shell su -c "cat /data/adb/modules/trustusercerts/log.txt" ``` -------------------------------- ### service.sh - Runtime Certificate Injection Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt This script is designed for devices using mainline/conscrypt. It checks for the presence of the APEX certificate directory in a process's mount info and is intended to inject certificates into the zygote and child processes. ```bash #!/system/bin/sh # Key functions from service.sh APEX_CERT_DIR=/apex/com.android.conscrypt/cacerts SYS_CERT_DIR=/system/etc/security/cacerts # Check if our mount is present in a process has_mount() { local pid="$1" grep -q " $APEX_CERT_DIR " "/proc/$pid/mountinfo" } # Inject certificates into zygote and child processes ``` -------------------------------- ### module.prop - Module Metadata Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt This file contains metadata for the Magisk module, including its ID, name, version, author, and update information. ```properties id=trustusercerts name=Always Trust User Certificates version=v1.3 versionCode=45 author=Jeroen Beckers (NVISO.eu) description=Copy user certs to the system trust store updateJson=https://raw.githubusercontent.com/NVISOsecurity/AlwaysTrustUserCerts/master/update.json ``` -------------------------------- ### post-fs-data.sh - Early Boot Certificate Collection Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt This shell script collects user certificates from all device profiles during the post-fs-data boot stage. It cleans the target directory and copies user certificates, as well as existing system certificates, to the module's system certificate directory. ```bash #!/system/bin/sh # Key functions from post-fs-data.sh # Certificate collection from all device users # Certificates are stored in /data/misc/user/*/cacerts-added/ collect_user_certs(){ mkdir -p $MODDIR$SYS_CERT_DIR # Clean directory to handle removed certificates rm -rf $MODDIR$SYS_CERT_DIR/* # Loop over all user profiles (multi-user support) for dir in /data/misc/user/*; do if [ -d "$dir/cacerts-added" ]; then for cert in "$dir/cacerts-added"/*; do cp "$cert" $MODDIR$SYS_CERT_DIR/ done fi done } # Also copies existing system certificates cp $SYS_CERT_DIR/* $MODDIR$SYS_CERT_DIR ``` -------------------------------- ### Monitor Zygote Processes for Mount Namespace Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt This shell script monitors zygote processes and binds system certificates over apex certificates if they are not already mounted. It also injects into child processes. ```bash monitor_zygote(){ while true; do # Find all zygote processes (32-bit and 64-bit) for name in zygote zygote64; do for zp in $(pidof $name 2>/dev/null); do if ! has_mount "$zp"; then # Bind mount system certs over apex certs /system/bin/nsenter --mount=/proc/$zp/ns/mnt -- \ /bin/mount --rbind $SYS_CERT_DIR $APEX_CERT_DIR # Also inject into child processes for pid in $(ps -o pid -P $zp | grep -v PID); do /system/bin/nsenter --mount=/proc/$pid/ns/mnt -- \ /bin/mount --rbind $SYS_CERT_DIR $APEX_CERT_DIR done fi done done sleep 5 done } ``` -------------------------------- ### update.json - Automatic Updates Configuration Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt This JSON file specifies the version, download URL, and changelog for automatic updates of the module. ```json { "version": "v1.3", "versionCode": 45, "zipUrl": "https://github.com/NVISOsecurity/AlwaysTrustUserCerts/releases/download/v1.3/AlwaysTrustUserCerts_v1.3.zip", "changelog": "https://raw.githubusercontent.com/NVISOsecurity/AlwaysTrustUserCerts/master/CHANGELOG.md" } ``` -------------------------------- ### Verify Certificate Trust Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt These bash commands help verify that certificates are trusted by the system, including checks for different Android versions and specific applications. ```bash # List all system-trusted certificates adb shell su -c "ls /system/etc/security/cacerts/" ``` ```bash # On conscrypt devices, also check apex directory adb shell su -c "ls /apex/com.android.conscrypt/cacerts/" ``` ```bash # Test certificate trust with curl (if available) adb shell curl -v https://example.com 2>&1 | grep -i "ssl\|certificate" ``` ```bash # Check if specific app trusts the certificate # (Replace com.example.app with target package) adb shell su -c "run-as com.example.app cat /proc/self/mountinfo | grep cacerts" ``` -------------------------------- ### Remove User Certificate Source: https://context7.com/nvisosecurity/alwaystrustusercerts/llms.txt Remove the certificate through the device's security settings under 'Trusted credentials'. Reboot the device for the module to automatically clean the certificate from the system store. ```bash # On device: Settings > Security > Encryption & credentials > Trusted credentials # Switch to "User" tab # Select the certificate to remove # Tap "Remove" # Reboot device to apply changes ``` ```bash adb reboot # The module automatically cleans removed certificates from system store ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.