Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小米12 澎湃os不能生效 #4

Open
Cheukfung opened this issue Feb 20, 2024 · 8 comments · Fixed by #5
Open

小米12 澎湃os不能生效 #4

Cheukfung opened this issue Feb 20, 2024 · 8 comments · Fixed by #5

Comments

@Cheukfung
Copy link

小米hyperos(安卓14),正式版和开发版都不能正常安装证书,system/etc/security/cacerts目录已经有证书了,apex下没有,系统设置没有识别证书。试了很多个模块都不行,包括这个:https://github.com/ys1231/MoveCertificate

@qiuyuyang910
Copy link
Contributor

确实,我也遇到了 k60 hyperos

@lvzhenbo
Copy link

lvzhenbo commented May 6, 2024

嗨皮os估计是魔改了什么导致bash脚本无效,不过有root的可以直接吧.0文件放到/apex/com.android.conscrypt/cacerts目录下,然后权限改成664重启手机就好了,如果有人懂bash脚本的话可以试试改一下针对hyperos的

@wanghongenpin
Copy link
Owner

是修改这个目录权限吗

嗨皮os估计是魔改了什么导致bash脚本无效,不过有root的可以直接吧.0文件放到/apex/com.android.conscrypt/cacerts目录下,然后权限改成664重启手机就好了,如果有人懂bash脚本的话可以试试改一下针对hyperos的

@lvzhenbo
Copy link

lvzhenbo commented May 6, 2024

不知道,我只是装了模块后再把上面说的操作一遍,因为我不太懂bash脚本所以也不知道是哪一步出现了问题,反正最终的结果就是脚本没有把文件放进去,自己手动放了成功可以用了

@lvzhenbo
Copy link

lvzhenbo commented May 6, 2024

是修改这个目录权限吗

嗨皮os估计是魔改了什么导致bash脚本无效,不过有root的可以直接吧.0文件放到/apex/com.android.conscrypt/cacerts目录下,然后权限改成664重启手机就好了,如果有人懂bash脚本的话可以试试改一下针对hyperos的

我发现一件事,我能够把文件放进去不是靠这个模块,而是新小黄鸟的模块,这是它的脚本

#!/system/bin/sh

exec > /data/local/tmp/CustomCACert.log
exec 2>&1

set -x

MODDIR=${0%/*}

set_context() {
    [ "$(getenforce)" = "Enforcing" ] || return 0

    default_selinux_context=u:object_r:system_file:s0
    selinux_context=$(ls -Zd $1 | awk '{print $1}')

    if [ -n "$selinux_context" ] && [ "$selinux_context" != "?" ]; then
        chcon -R $selinux_context $2
    else
        chcon -R $default_selinux_context $2
    fi
}

chown -R 0:0 ${MODDIR}/system/etc/security/cacerts
set_context /system/etc/security/cacerts ${MODDIR}/system/etc/security/cacerts

# Android 14 support
# Since Magisk ignore /apex for module file injections, use non-Magisk way
if [ -d /apex/com.android.conscrypt/cacerts ]; then
    # Clone directory into tmpfs
    rm -f /data/local/tmp/sys-ca-copy
    mkdir -p /data/local/tmp/sys-ca-copy
    mount -t tmpfs tmpfs /data/local/tmp/sys-ca-copy
    cp -f /apex/com.android.conscrypt/cacerts/* /data/local/tmp/sys-ca-copy/

    # Do the same as in Magisk module
    cp -f ${MODDIR}/system/etc/security/cacerts/* /data/local/tmp/sys-ca-copy
    chown -R 0:0 /data/local/tmp/sys-ca-copy
    set_context /apex/com.android.conscrypt/cacerts /data/local/tmp/sys-ca-copy

    # Mount directory inside APEX if it is valid, and remove temporary one.
    CERTS_NUM="$(ls -1 /data/local/tmp/sys-ca-copy | wc -l)"
    if [ "$CERTS_NUM" -gt 10 ]; then
        mount --bind /data/local/tmp/sys-ca-copy /apex/com.android.conscrypt/cacerts
        for pid in 1 $(pgrep zygote) $(pgrep zygote64); do
            nsenter --mount=/proc/${pid}/ns/mnt -- \
                mount --bind /data/local/tmp/sys-ca-copy /apex/com.android.conscrypt/cacerts
        done
    else
        echo "Cancelling replacing CA storage due to safety"
    fi
    umount /data/local/tmp/sys-ca-copy
    rmdir /data/local/tmp/sys-ca-copy
fi

@jgchgjhbkj
Copy link

怎么弄?

@qiuyuyang910
Copy link
Contributor

怎么弄?

已经修复
#5
但是作者没有合并,你可以在我fork的仓库里面下载源码直接安装就行
https://github.com/qiuyuyang910/Magisk-ProxyPinCA

wanghongenpin added a commit that referenced this issue Jun 27, 2024
fix #4 支持安卓14以下版本
@wanghongenpin
Copy link
Owner

已经合并,大家可以试下最新的好使步
https://github.com/wanghongenpin/Magisk-ProxyPinCA/releases/tag/1.1.1

@wanghongenpin wanghongenpin reopened this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants