ys1231 / MoveCertificate

支持Android7-14移动证书,兼容magiskv20.4+/kernelsu/APatch, Support Android7-14, compatible with magiskv20.4+/kernelsu/APatch
https://github.com/ys1231/MoveCertificate
Apache License 2.0
669 stars 77 forks source link

用户证书无法被移动到系统证书库 #31

Closed MalitsPlus closed 1 month ago

MalitsPlus commented 1 month ago

安装证书一切正常,但重启后证书仍然保留在用户证书库。

/data/adb/modules/MoveCertificate/certificates /apex/com.android.conscrypt/cacerts /apex/com.android.conscrypt@(\d{9})/cacerts

以上三个目录中均能找到安装的证书。

实际抓 HTTPS 包也会提示证书不被信任。

log

[iyue_MoveCertificate] Keep only one up-to-date log
[iyue_MoveCertificate] start move cert !
[iyue_MoveCertificate] current sdk version is 34
[iyue_MoveCertificate] Backup system certificates
[iyue_MoveCertificate] Backup user custom certificates
[iyue_MoveCertificate] Backup user custom certificates
[iyue_MoveCertificate] Backup user custom certificates status:0
[iyue_MoveCertificate] fix user permissions: /data/misc/user/0/cacerts-added/
[iyue_MoveCertificate] fix user permissions status:0
[iyue_MoveCertificate] fix permissions: /data/adb/modules/MoveCertificate/certificates
[iyue_MoveCertificate] fix permissions: 0
[iyue_MoveCertificate] find system conscrypt directory
[iyue_MoveCertificate] find conscrypt directory: /apex/com.android.conscrypt@341911010
[iyue_MoveCertificate] certificates installed
ys1231 commented 1 month ago

系统设置里面可以看到你安装的证书吗? 不要手动把用户证书删了

ys1231 commented 1 month ago

尝试找一个其他浏览器去抓包,用户证书目录和系统证书目录都要有,chrome才能抓到.

MalitsPlus commented 1 month ago

系统设置里面可以看到你安装的证书吗? 不要手动把用户证书删了

可以在 user tab 里看到,system tab 里没有

尝试找一个其他浏览器去抓包,用户证书目录和系统证书目录都要有,chrome才能抓到.

尝试了多个 app,均不被信任

ys1231 commented 1 month ago

system tab 里没有 那就是安装失败了 你把用户证书的证书文件提取出来 直接 push到 /data/local/tmp/cert 试试

MalitsPlus commented 1 month ago

是指这个方法吧?

试了一下同样只在 user 里有显示。

ys1231 commented 1 month ago

我对此也比较感兴趣 主要我也没有8Pro

MalitsPlus commented 1 month ago

试了下这个方法,能成功把证书放到系统证书库里,抓包也能被信任,或许能成为一个修改的提示。 但文章里的方法和 MoveCertificate 的方法一眼看上去似乎没什么区别。

https://github.com/ys1231/MoveCertificate/blob/e991edd3fc48ae1d629ec84e4ac5efbff0418a64/post-fs-data.sh#L115-L119

MalitsPlus commented 1 month ago

根据上面的文章尝试写了一个 module,由于 post-fs-data 阶段 Zygote 还没有启动所以放在了 late_start 阶段,但会造成 bootloop。简单调试了下是用 nsenter 对 Zygote 进行 bind mount 时造成的问题,但具体是什么问题人太菜了不会查。

感觉无解了,目前只能想到把文章里的脚本写好丢进手机,在需要的时候用 Termux 跑一下了。

ys1231 commented 1 month ago

事实上很早以前就遇到过你现在的问题,并且几乎所有Android14模块应该都是基于上面文章的原理去写的。那时候是因为上下文的问题,后面解决了,可能是启动时机或者别的原因,你或者可以试一下用kernelsu去安装测试一下,可能直接就能用了。