本文未经测试,初步看代码流程接近本人想法,留下作记录。
Intoduction

This code allow you to resign your own ipa assuming that you have:
1) a developer certificate issued by apple and added to your keychain
2) a mobileprovision file

This code allow you to resign your app without using xcode or if you need to add a UDID for development distribution.
This code correctly signs ipas with Frameworks (.framework folders), Plugins (.appex folders), Applications (.app folders)
This code autoincludes entitlements with binaries extracting them from the provided mobileprovision file.

Usage

This code runs on mac osx
You should already have installed OSX Command Lines Tools
The code is a shell script

Step 1
Change the following variables inside the signall.sh script:

 
1
2
3
4
5
6
signscript="/path/to/sign.sh"
ipasourcefolder="path/to/ipas/source/folder"
ipadestfolder="/path/to/ipas/destinations/folder/"
 
developer1="iPhone Developer: xxxxx (xxxxx)"
mobileprovision1="/path/to/mobile/provision"

Step 2

 
1
2
3
make sure that ipasourcefolder and ipadestfolder are writable
run signall.sh via terminal
done

In your destination folder you will have all your ipas signed.

Source and Updates

https://bitbucket.org/xgiovio/ios-ipa-resign/src

Code
signall.sh

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# !/bin/bash
signscript="/path/to/sign.sh"
ipasourcefolder="path/to/ipas/source/folder"
ipadestfolder="/path/to/ipas/destinations/folder/"
 
developer1="iPhone Developer: xxxxx (xxxxx)"
mobileprovision1="/path/to/mobile/provision"
 
 
cd $ipasourcefolder
find -d . -type f -name "*.ipa"> files.txt
while IFS='' read -r line || [[ -n "$line" ]]; do
    filename=$(basename "$line" .ipa)
    echo "Ipa: $filename"
    #_dev1_______
    output=$ipadestfolder$filename
    output+="_signed_dev1.ipa"
    "$signscript" "$line" "$developer1" "$mobileprovision1" "$output"
 
done < files.txt
rm files.txt

sign.sh

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# !/bin/bash
SOURCEIPA="$1"
DEVELOPER="$2"
MOBILEPROV="$3"
TARGET="$4"
 
unzip -qo "$SOURCEIPA" -d extracted
 
APPLICATION=$(ls extracted/Payload/)
 
cp "$MOBILEPROV" "extracted/Payload/$APPLICATION/embedded.mobileprovision"
 
echo "Resigning with certificate: $DEVELOPER" >&2
find -d extracted  \( -name "*.app" -o -name "*.appex" -o -name "*.framework" -o -name "*.dylib" \) > directories.txt
security cms -D -i "extracted/Payload/$APPLICATION/embedded.mobileprovision" > t_entitlements_full.plist
/usr/libexec/PlistBuddy -x -c 'Print:Entitlements' t_entitlements_full.plist > t_entitlements.plist
#/usr/libexec/PlistBuddy -c 'Print:application-identifier' t_entitlements.plist > t_entitlements_application-identifier   #save developer application-identifier to file
#/usr/libexec/PlistBuddy -c 'Print:com.apple.developer.team-identifier' t_entitlements.plist > t_entitlements_com.apple.developer.team-identifier  #save com.apple.developer.team-identifier application-identifier to file
while IFS='' read -r line || [[ -n "$line" ]]; do
    #/usr/bin/codesign -d --entitlements :-  "$line" > t_entitlements_original.plist    #save original entitlements from the app
    #/usr/libexec/PlistBuddy -x -c 'Import application-identifier t_entitlements_application-identifier' t_entitlements_original.plist #overwrite application-identifier
    #/usr/libexec/PlistBuddy -x -c 'Import com.apple.developer.team-identifier t_entitlements_com.apple.developer.team-identifier' t_entitlements_original.plist #overwrite com.apple.developer.team-identifier
    /usr/bin/codesign --continue -f -s "$DEVELOPER" --entitlements "t_entitlements.plist"  "$line"
done < directories.txt
 
echo "Creating the Signed IPA"
cd extracted
zip -qry ../extracted.ipa *
cd ..
mv extracted.ipa "$TARGET"
 
rm -rf "extracted"
rm directories.txt
rm t_entitlements.plist
rm t_entitlements_full.plist
#rm t_entitlements_original.plist
#rm t_entitlements_application-identifier
#rm t_entitlements_com.apple.developer.team-identifier

重新签名IOS .ipa文件 (包含第三方框架和插件)的更多相关文章

  1. iOS开发之常用第三方框架(下载地址,使用方法,总结)

    iOS开发之常用第三方框架(下载地址,使用方法,总结) 说句实话,自学了这么久iOS,如果说我不知道的但是又基本上都摸遍了iOS相关知识,但是每次做项目的时候,遇到难一点的地方或者没试过的东西就闷了. ...

  2. iOS开发常用的第三方框架

    1. AFNetworking 在众多iOS开源项目中,AFNetworking可以称得上是最受开发者欢迎的库项目.AFNetworking是一个轻量级的iOS.Mac OS X网络通信类库,现在是G ...

  3. iOS:网络编程的第三方框架:AFNetworking、SDWebImage

    网络编程第三方框架:AFNetworking.SDWebImage 介绍:这些框架是开源的,经过前人的封装.改进,成为使用次数很多的一个性能好的源代码框架,只需要将它导入项目中,就可以使用.因此,在做 ...

  4. IOS一些高效的第三方框架库

    MBProgressHUD ——进展指示符库 苹果的应用程序一般都会用一种优雅的,半透明的进度显示效果,不过这个API是不公开的,因此你要是用了,很可能被清除出AppStore.而 MBProgres ...

  5. 提高iOS开发效率的第三方框架等--不断更新中。。。

    1. Mantle Mantle 让我们能简化 Cocoa 和 Cocoa Touch 应用的 model 层.简单点说,程序中经常要进行网络请求,请求到得一般是 json 字符串,我们一般会建一个 ...

  6. IOS 极光推送(第三方框架)

    下载极光推送文件,将以下两个文件导入项目中 APService.h libpushSDK.a #import "HMAppDelegate.h" #import "APS ...

  7. 提高iOS开发效率的第三方框架等

    http://zhangmingwei.iteye.com/blog/2208783 http://www.kuqin.com/shuoit/20150703/346900.html

  8. iOS 如何通过CocoaPods添加第三方框架

    一  先安装Ruby环境: http://ruby-china.org/wiki/install_ruby_guide 在安装的时候,若是出现: 1.You don't have write perm ...

  9. iOS包重签名工具,ipa文件重签名,快速签名,SignTool签名工具,好用的签名工具,App重签名

    新工具 ProjectTool 已上线 这是一款快速写白包工具,秒级别写H5游戏壳包,可视化操作,极易使用,支持Swift.Objecive-C双语言 QQ交流群:811715780 进入 Proje ...

随机推荐

  1. Unreal发展史

    Unreal发展史 引子 四年前的一个深夜,或者说是一个早晨,Unreal的传奇开始了.它发生在马里兰州一个不起眼的市镇Rockvill,在一套公寓大楼里回响起一支墨西哥流浪乐队的曲子,那里住着Epi ...

  2. Phpcms v9 实现首页|列表页|内容页调用点击量的代码

    很多朋友经常问Phpcms v9的首页.列表页.内容页点击量如何调用.今天给大家分享phpcms V9如何分别在首页.列表页.内容页调用点击量代码 1,Phpcms v9首页调用点击量 {pc:con ...

  3. oop思维意识,类 模块命名空间,类扩展之继承 、组合、mixin三种模式

    python的书都是讲怎么创建类怎么实例化对象,一般会用使用了,但还不具备这种编程意识.这是从python学习手册第四版节选出来的,书中说oop不仅是一种技术,更是一种经验.学习大神的看法,为什么需要 ...

  4. python打造线程池

    # coding=utf-8 import threading import Queue import time import traceback class ThreadPoolExecutor(o ...

  5. [mysql] Incorrect string value: '\xE4\xBC\x9A\xE5\x91\x98' for column 'name' at row 1

    数据库字符集错误, 修改为UTF8/utf8mb4字符集即可.

  6. ios开发之--使用AFN上传3.1.0上传视频,不走成功回调原因及解决方法

    在测试接口的时候,发现接口称走走了,但是success的回调不走,检查了下代码,发现没有初始化下面两个方法: manage.responseSerializer = [AFHTTPResponseSe ...

  7. Bypass ngx_lua_waf SQL注入防御(多姿势)

    0x00 前言 ​ ngx_lua_waf是一款基于ngx_lua的web应用防火墙,使用简单,高性能.轻量级.默认防御规则在wafconf目录中,摘录几条核心的SQL注入防御规则: select.+ ...

  8. linux 下的爆破工具hydra

    http://www.cnblogs.com/mchina/archive/2013/01/01/2840815.html 安装手册 http://www.aldeid.com/wiki/Thc-hy ...

  9. Python 网络爬虫

    爬虫介绍 爬取图片 爬取文本 爬虫相关模块:re 爬虫相关模块:urllib 爬虫相关模块:urllib2 爬虫相关模块:cookielib 爬虫相关模块:requests 爬取需要登录的页面

  10. Mock

    转移到  这里 像测试对象提供一套和测试资源完全相同 的接口和方法,不关心过程,只关心结果(比如模拟拿到服务器的code)