zoukankan      html  css  js  c++  java
  • 签名mobileconfig 重签ipa

    .mobileconfig文件的签名

    生成Apache专用的三个证书

    双击【2331135_zgp.ink_chain.crt】可以看到它是个根证书,在mac上,双击它,导入到证书中心,然后再导出为pem格式,重命名为ca-bundle.pem

    在mac上,用以下命令签名mobileconfig文件

    openssl smime -sign -in unsigned.mobileconfig -out signed.mobileconfig -signer 2331135_zgp.ink_public.crt -inkey 2331135_zgp.ink.key -certfile ca-bundle.pem -outform der -nodetach

    安装brew

    执行以下命令即可安装brew最新版本(https://github.com/Homebrew/install)

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    安装重签工具 fastlane -> sigh

    brew install ruby
    sudo gem install sigh

    新建一个文件夹,把ipa文件和 embedded.mobileprovision (文件名必须是embedded.mobileprovision) 拷贝到里面

    命令行定位到这个文件夹里面,执行以下命令

    sigh resign

    会列出目前所有证书的二进制表达,并要求你输入你选择的证书的二进制字符串,从列表中拷贝一个进去即可,回车后

    成功重签ipa

    再贴一段url代码

     var len = connectInfo.Request.Body.Length;
                    byte[] bs = new byte[len];
                    connectInfo.Request.Body.Read(bs, 0, bs.Length);
    
                    System.Security.Cryptography.Pkcs.SignedCms cms = new System.Security.Cryptography.Pkcs.SignedCms();
                    cms.Decode(bs);
                    cms.CheckSignature(true);
                    string xml = System.Text.Encoding.UTF8.GetString(cms.ContentInfo.Content);
                    var xmldoc = new System.Xml.XmlDocument();
                    xmldoc.LoadXml(xml);
                    var node = xmldoc.SelectSingleNode("//dict");
    
                    string udid = null;
                    foreach ( System.Xml.XmlElement child in node.ChildNodes )
                    {
                        if(child.Name == "key" && child.InnerText == "UDID")
                        {
                            udid = child.NextSibling.InnerText;
                            break;
                        }
                    }
                    connectInfo.Response.StatusCode = 301;
                    connectInfo.Response.Redirect(301, "https://www.baidu.com?udid=" + udid);
  • 相关阅读:
    Go断后,Dart冲前,Google的野心
    gcc dynamic load library
    Go http server 高并发
    还是Go 为了伟大的未来
    windows go dll 框架
    Go cookie
    Go web ajax project
    hdoj 2844 Coins
    hdoj 1203 I NEED A OFFER!
    hdoj 2546 饭卡
  • 原文地址:https://www.cnblogs.com/IWings/p/10999196.html
Copyright © 2011-2022 走看看