• 签名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);
  • 相关阅读:
    240. Search a 2D Matrix II
    442. Find All Duplicates in an Array
    4. Median of Two Sorted Arrays
    3. Longest Substring Without Repeating Characters
    poj 3616
    cf 337 div2 c
    poj 2385
    poj 2229
    uvalive 3231
    Entity Framework 学习初级篇7--基本操作:增加、更新、删除、事务
  • 原文地址:https://www.cnblogs.com/IWings/p/10999196.html
Copyright © 2020-2023  润新知