重签名(Resign)

上篇讲到, 将ipa文件和配置文件放到一个文件夹,cd到这个文件夹,简单一行命令就可以实现重签名:

fastlane sigh resign

appstore上的应用是经过加壳的,不能直接进行重签名。

为了简单,这里从pp助手下载一个简单的越狱应用进行重签名。

20170626711081.png

多target应用

这里再尝试对斗鱼tv的越狱包重签名:

[15:07:43]: Signing Identity: 12E2894A64337A985227E191F515BAB9EDE7BBF8
/Users/tyrad/.rvm/gems/ruby-2.2.5/gems/fastlane-2.41.0/sigh/lib/assets/resign.sh /Users/tyrad/Desktop/snapshot-fastlane/fastlaneResignDemo/oo.ipa 12E2894A64337A985227E191F515BAB9EDE7BBF8 -p /Users/tyrad/Desktop/snapshot-fastlane/fastlaneResignDemo/InHouse_com.tyrad.fastlaneResignDemo.mobileprovision          /Users/tyrad/Desktop/snapshot-fastlane/fastlaneResignDemo/oo.ipa
security: SecPolicySetValue: One or more parameters passed to a function were not valid.
No provisioning profile for nested application: '_floatsignTemp/Payload/DYZB.app/PlugIns/DYReplayKitExt.appex' with bundle identifier 'tv.douyu.live.DYReplayKitLiveExt'
Use the -p option (example: -p com.example.app=xxxx.mobileprovision)

报错: No provisioning profile for nested application: ….DYReplayKitExt.appex

原因是这个应用是多target应用。这个问题官方文档已经给出答案了:

https://docs.fastlane.tools/actions/#resign https://github.com/fastlane/fastlane/issues/7783

resign(
  ipa: "path/to/ipa", # can omit if using the `ipa` action
  signing_identity: "iPhone Distribution: Luka Mirosevic (0123456789)",
  provisioning_profile: {
    "com.example.awesome-app" => "App.mobileprovision",
    "com.example.awesome-app.app-extension" => "Extension.mobileprovision"
  }
)

重签名方法:

增加了两个appid,并把他们放到一个app group里。 20170626228442.png

编辑fastfile:

fastlane_version "2.41.0"
default_platform :ios
platform :ios do
  desc "测试重签名"
  lane :resignDemo do
  	resign(
   	 ipa: "./bb.ipa", # can omit if using the `ipa` action
 	 signing_identity: "D711135202520B8C69693B8DFAFFAS55A884",
   	 provisioning_profile: {      
    	"tv.douyu.live" => "./1.mobileprovision",
    	"tv.douyu.live.DYReplayKitLiveExt" => "./2.mobileprovision",
        "tv.douyu.live.DYReplayKitExtUI" => "./3.mobileprovision"
  	})
  end 
end

运行:

fastlane 

签名成功。