IPA 재 서명 (iPhone)
현재 xcodebuild를 사용하고 xcrun을 사용하여 hudson으로 모든 응용 프로그램을 문제없이 빌드합니다.
다른 사람들로부터 회사 계정 대신 (앱 스토어 또는 임시 배포 용) 엔터프라이즈 계정으로 다시 서명하고 싶은 IPA 파일 몇 개를 받았습니다.
내 문제는 앱을 사임하려고 할 때 내 장치에 설치되지 않으며 엔터프라이즈 빌드이므로 설치해야한다는 것입니다. 오류 메시지는 iTunes가 아닌 장치에 있으며 단순히 앱을 설치할 수 없음을 나타냅니다. 더 이상 정보가 제공되지 않습니다.
일부 정보를 찾았습니다 ( http://www.ketzler.de/2011/01/resign-an-iphone-app-insert-new-bundle-id-and-send-to-xcode-organizer-for- 업로드 / )
그리고 이것은 가능할 것입니다. 내가 직면하고있는 문제는 일반적인 빌드 (xcrun 사용)에서와 같이 모바일 프로비저닝 프로파일을 포함하지 않는 것이 공동 디자인 도구로 제어 할 수 있거나 xcrun으로 다시 서명 할 수 있다는 것입니다 ?
내 사임 스크립트를 사용하여 현재
- app.ipa의 압축을 풉니 다
- appname = $ (ls 페이로드)
- xcrun -sdk iphoneos PackageApplication -s "$ provisioning_profile" "$ project_dir / Payload / $ appname"-o "$ project_dir / app-resigned.ipa"--sign "$ provisioning_profile"--embed "$ mobileprovision"
결과 ipa 파일을 살펴본 결과 원래 앱과 매우 유사한 것으로 보입니다. 여기서 어떤 파일을 변경해야합니까? 처음에는 _CodeSignature / CodeResources가 변경 될 것이라고 생각했지만 내용은 거의 동일하게 보입니다.
포인터는 매우 높이 평가됩니다.
마침내이 일을했습니다!
프로비저닝 프로파일에 장치가 추가되지 않은 앱 스토어 제출을 위해 cert1로 서명 된 IPA로 테스트되었습니다. 사내 구축을 위해 엔터프라이즈 계정 및 모바일 프로비저닝 프로파일로 서명 된 새 IPA가 생성됩니다 (모바일 프로비저닝 프로파일이 IPA에 임베드 됨).
해결책:
IPA 압축 해제
unzip Application.ipa
오래된 CodeSignature 제거
rm -r "Payload/Application.app/_CodeSignature" "Payload/Application.app/CodeResources" 2> /dev/null | true
임베디드 모바일 프로비저닝 프로파일 교체
cp "MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision"
재 서명
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --resource-rules "Payload/Application.app/ResourceRules.plist" "Payload/Application.app"
재 포장
zip -qr "Application.resigned.ipa" Payload
편집 : Entitlement 부분을 제거했습니다 (골목, 감사 참조)
이 질문에 대한 답변은 약간 오래되었고 잠재적으로 중요한 단계가 누락되었으므로 외부 개발자로부터 앱을 설치하기위한 업데이트 된 안내서입니다.
----- iOS 앱을 사임하는 방법 -----
하자 당신이 다른 개발자의 응용 프로그램 (예 : MyApp.ipa)를 수신라고, 당신은 설치할 수 싶어 (사용하여 장치에서 실행 ideviceinstaller를 예를 들어).
새로운 서명 자산 준비
첫 번째 단계는 설치 및 실행하려는 모든 장치가 포함 된 프로비저닝 프로파일 을 얻는 것 입니다. 프로파일에 키 체인 액세스에 설치 한 인증서가 포함되어 있는지 확인하십시오 (예 : iPhone 개발자 : 일부 본문 (XXXXXXXXXX)). 앱에 포함 된 프로파일을 바꿀 수 있도록 프로파일 (MyProfile.mobileprovision)을 다운로드하십시오.
다음으로 서명에 포함 할 자격 파일을 준비하겠습니다. 터미널을 열고 다음을 실행하십시오.
$ security cms -D -i path/to/MyProfile.mobileprovision > provision.plist
프로비져닝 프로필을 설명하는 xml 파일이 생성됩니다 . 다음으로 인 타이틀먼트를 파일로 추출하려고합니다.
$ /usr/libexec/PlistBuddy -x -c 'Print :Entitlements' provision.plist > entitlements.plist
프로비저닝 프로파일 교체 및 앱 사임
.ipa 파일 로 작업하는 경우 먼저 앱의 압축을 풉니 다 ( .app 가있는 경우이 단계를 건너 뛸 수 있음).
$ unzip MyApp.ipa
귀하의 작업 디렉토리는 이제 포함 Payload/
하고 Payload/MyApp.app/
. 그런 다음 이전 코드 서명 파일을 제거하십시오.
$ rm -rf Payload/MyApp.app/_CodeSignature
기존 프로비저닝 프로파일 (예 : embedded.mobileprovision)을 자신의 프로파일로 바꿉니다.
$ cp path/to/MyProfile.mobileprovision Payload/MyApp.app/embedded.mobileprovision
이제 프로비저닝 프로파일에 포함 된 인증서와 이전에 작성한 entitlements.plist로 앱에 서명하십시오.
$ /usr/bin/codesign -f -s "iPhone Developer: Some Body (XXXXXXXXXX)" --entitlements entitlements.plist Payload/MyApp.app
IMPORTANT: You must also resign all frameworks included in the app. You will find these in Payload/MyApp.app/Frameworks
. If the app is written in Swift or if it includes any additional frameworks these must be resigned or the app will install but not run.
$ /usr/bin/codesign -f -s "iPhone Developer: Some Body (XXXXXXXXXX)" --entitlements entitlements.plist Payload/MyApp.app/Frameworks/*
You can now rezip the app.
$ zip -qr MyApp-resigned.ipa Payload
Done
You may now remove the Payload
directory since you have your original app (MyApp.ipa) and your resigned version (MyApp-resigned.ipa). You can now install MyApp-resigned.ipa on any device included in your provisioning profile.
I successfully followed this answer, but since entitlements have changed, I simply removed the --entitlements "Payload/Application.app/Entitlements.plist"
part of the second to last statement, and it worked like a charm.
Checked with Mac OS High Sierra and Xcode 10
You can simply implement the same using the application iResign.
Give path of 1).ipa
2) New provision profile
3) Entitlement file (Optional, add only if you have entitlement)
4) Bundle id
5) Distribution Certificate
You can see output .ipa file saved after re-sign
Simple and powerful tool
None of these resigning approaches were working for me, so I had to work out something else.
In my case, I had an IPA with an expired certificate. I could have rebuilt the app, but because we wanted to ensure we were distributing exactly the same version (just with a new certificate), we did not want to rebuild it.
Instead of the ways of resigning mentioned in the other answers, I turned to Xcode’s method of creating an IPA, which starts with an .xcarchive from a build.
I duplicated an existing .xcarchive and started replacing the contents. (I ignored the .dSYM file.)
I extracted the old app from the old IPA file (via unzipping; the app is the only thing in the Payload folder)
I moved this app into the new .xcarchive, under
Products/Applications
replacing the app that was there.I edited
Info.plist
, editingApplicationProperties/ApplicationPath
ApplicationProperties/CFBundleIdentifier
ApplicationProperties/CFBundleShortVersionString
ApplicationProperties/CFBundleVersion
Name
I moved the .xcarchive into Xcode’s archive folder, usually
/Users/xxxx/Library/Developer/Xcode/Archives
.In Xcode, I opened the Organiser window, picked this new archive and did a regular (in this case Enterprise) export.
The result was a good IPA that works.
With Fastlane sigh's resign option you can do this very easily.
sigh resign -p <path-to-profile-with-mobileprovision-ext> -i <code-sighning-identity-of-your-app>
You can download the profile using sigh also, just before the command.
I think the easiest is to use Fastlane:
sudo gem install fastlane -NV
hash -r # for bash
rehash # for zsh
fastlane sigh resign ./path/app.ipa --signing_identity "iPhone Distribution: Felix Krause" -p "my.mobileprovision"
Thank you, Erik, for posting this. This worked for me. I'd like to add a note about an extra step I needed. Within "Payload/Application.app/" there was a directory named "CACertChains" that contained a file named "cacert.pem". I had to remove the directory and the .pem to complete these steps. Thanks again! –
If you have an app with extensions and/or a watch app and you have multiple provisioning profiles for each extension/watch app then you should use this script to re-sign the ipa file.
Here is an example of how to use this script:
./resign.sh YourApp.ipa "iPhone Distribution: YourCompanyOrDeveloperName" -p <path_to_provisioning_profile_for_app>.mobileprovision -p <path_to_provisioning_profile_for_watchkitextension>.mobileprovision -p <path_to_provisioning_profile_for_watchkitapp>.mobileprovision -p <path_to_provisioning_profile_for_todayextension>.mobileprovision resignedYourApp.ipa
You can include other extension provisioning profiles too by adding it with yet another -p option.
For me - all the provisioning profiles were signed by the same certificate/signing identity.
참고URL : https://stackoverflow.com/questions/6896029/re-sign-ipa-iphone
'development' 카테고리의 다른 글
JavaScript 프로토 타입을 사용하는 호출 방법 (0) | 2020.07.05 |
---|---|
객체의 총 항목 수를 반환하는 가장 좋은 RESTful 방법은 무엇입니까? (0) | 2020.07.05 |
Amazon S3 CORS (Cross-Origin Resource Sharing) 및 Firefox 도메인 간 글꼴로드 (0) | 2020.07.05 |
Django 컨텐츠 유형은 정확히 어떻게 작동합니까? (0) | 2020.07.05 |
Android에서 logcat 버퍼를 비우는 방법 (복제) (0) | 2020.07.05 |