Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 4.2 dylibs are not signed correctly when packaged with AIR app #49

Closed
tuarua opened this issue Dec 27, 2018 · 1 comment
Closed

Comments

@tuarua
Copy link

tuarua commented Dec 27, 2018

Problem Description

Swift 4.2 dylibs have a slightly different structure to 4.1 and so they are not signed correctly by ADT

Actual Result:
Packaged Swift 4.2.1 dylibs are incorrectly signed (code signature invalid, Info.plist=not bound)

Expected Result:
Packaged Swift 4.2.1 dylibs are correctly signed (code signature valid)

  • Which AIR SDK did you use?
    32.0.0.89

  • Describe the affected environment:
    ANEs created for iOS in Xcode 10+ using Swift as the native language.

  • Can you reproduce it yourself, or did you get reports from other users? If so, how many users are affected (percentage)?
    Yes, affects apps built with ANEs targeting Swift 4.2

  • If applicable, link to the Starling/Feathers issues that brought you here.
    https://tracker.adobe.com/#/view/AIR-4198777

Steps to Reproduce

  1. Package AIR iOS app with Swift 4.2 dylibs (eg libswiftCore.dylib) inside Frameworks folder
  2. Confirm signed dylib with: codesign -dv --verbose=4 Payload/*.app/Frameworks/libswiftCore.dylib

Known Workarounds

Patch IPASigner.java in adt.jar with the following:

private int SWIFT_4_2 = 1000;  
private int CODE_DIR_HEADERS_4_2 = 104;  
...  
public void prepareToSignFramework(boolean isDylib, File file)  
            throws IOException, GeneralSecurityException {  
...  
if (version < this.SWIFT_4) {  
    rar.seek(finalPosition + (this.CODE_DIR_HEADERS + this.m_frameworkIdentifier.getBytes().length + 1));  
} else if (version >= this.SWIFT_4_2) {  
    rar.seek(finalPosition + (this.CODE_DIR_HEADERS_4_2 + this.m_frameworkIdentifier.getBytes().length +  
                        1) + this.TEAM_ID_OFFSET);  
} else {  
    rar.seek(finalPosition + (this.CODE_DIR_HEADERS + this.m_frameworkIdentifier.getBytes().length + 1) +  
                        this.TEAM_ID_OFFSET);  
}  
…  
}
@tuarua
Copy link
Author

tuarua commented Feb 13, 2019

I am seeing this fixed in 32.0.0.103.
Verified dylibs are signed correctly in ipa and see Adobe used my actual code in adt.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants