码迷,mamicode.com
首页 > 移动开发 > 详细

ios 重签名

时间:2015-12-18 16:05:45      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:

http://stackoverflow.com/questions/6569120/resigning-an-application-outside-xcode

 

#!/bin/sh

 

TEMPDIR=/tmp/$RANDOM-$RANDOM-$RANDOM

RESOURCERULES=/tmp/ResourceRules-$RANDOM$RANDOM.plist

CURRENTDIR=`pwd`

 

mkdir -p "$TEMPDIR"

 

cat - > "$RESOURCERULES" <<ResourceRulesPlistDelimiter

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>rules</key>

<dict>

<key>.*</key>

<true/>

<key>Info.plist</key>

<dict>

<key>omit</key>

<true/>

<key>weight</key>

<real>10</real>

</dict>

<key>ResourceRules.plist</key>

<dict>

<key>omit</key>

<true/>

<key>weight</key>

<real>100</real>

</dict>

</dict>

</dict>

</plist>

ResourceRulesPlistDelimiter

 

unzip -q "$1" -d "$TEMPDIR" || exit 1

xattr -d -r com.apple.quarantine "$TEMPDIR"

 

for APPBUNDLE in "`find "$TEMPDIR" -name "*.app"`"; do

codesign --resource-rules="$RESOURCERULES" -f -s "iPhone Developer" "$APPBUNDLE"

codesign -dvvvv -r- "$APPBUNDLE"

done

 

cd "$TEMPDIR"

zip -qr "$TEMPDIR.zip" "Payload" && cd "$CURRENTDIR" && mv "$1" "$1.bak" && mv "$TEMPDIR.zip" "$1"

cd "$CURRENTDIR"

rm -rf "$TEMPDIR.zip"

rm -rf "$TEMPDIR"

rm -rf "$RESOURCERULES"

 

 

usage:Save the script as a text file, go into the terminal, cd into the script‘s directory, chmod +x NameOfFile.sh, and then run ./NameOfScript.sh IPAName.ipa

ios 重签名

标签:

原文地址:http://www.cnblogs.com/Keys/p/5056994.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!