Skip to content

Commit

Permalink
Merge pull request #3 from tuarua/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
tuarua authored Jan 13, 2020
2 parents 6f8c92d + 056e007 commit 71f4dd3
Show file tree
Hide file tree
Showing 40 changed files with 671 additions and 36 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.2.0
- Added is Desktop example

### 1.1.0
- Added is `isSupported` property to check os and version is supported
- Refactor
Expand Down
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,86 @@ After the ipa is created unzip it and confirm there is a "Frameworks" folder in
As per iOS above.


## macOS

### The ANE + Dependencies

From the command line cd into /example-desktop and run:

```shell
bash get_dependencies.sh
```

### App Setup

As per iOS above.

### Building the App

Apple Sign In requires you to build a captive runtime release (.app) and then make some modifications.

#### Remove some AIR files

Remove the following files/folders from _Main.app/_

- Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources/__MACOSX/
- Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources/WebKit.dylib
- Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources/WebKit/
- Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources/Flash Player.plugin
- Contents/Frameworks/Adobe AIR.framework/Versions/1.0/Resources/Adobe AIR.vch

#### Update Info.plist

Add the following entries to _Contents/Info.plist_

```xml
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
```

#### Update Entitlements

Open _bin-release/Entitlements.entitlements_ and update the 2 **XXXXXXXX** with your **Apple Team Identiifer**.

```xml
<?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>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.team-identifier</key>
<string>XXXXXXXX</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
<key>com.apple.application-identifier</key>
<string>XXXXXXXX.com.tuarua.AppleSignInANE.ExampleMac</string>
</dict>
</plist>
```

#### Sign the app

Update with your Mac Developer cert signature and run in **Terminal**

```shell
codesign -f -s "[Mac Developer: Team] (XXXXXXXX)" --deep --verbose Main.app/Contents/Frameworks/*
codesign -f -s "[Mac Developer: Team] (XXXXXXXX)" --deep --verbose Main.app/Contents/Resources/*
codesign -f -s "[Mac Developer: Team] (XXXXXXXX)" --entitlements Entitlements.entitlements --verbose Main.app/Contents/MacOS/*
```

#### Run the app!

### Prerequisites

You will need:
Expand Down
81 changes: 81 additions & 0 deletions example-desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Created by https://www.gitignore.io/api/flashbuilder

### FlashBuilder ###
# Build and Release Folders
bin/
bin-debug/
bin-release/
bin-release-temp/
cache/
EntitlementsTR.entitlements

*.app

# Other files and folders
.settings/

.FlexUnitSettings
.externalToolBuilders
.model

# textures
.tps

# build files
# *.sh

# my google api keys
googlekeys.txt

# Created by https://www.gitignore.io/api/intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml

# Sensitive or high-churn files:
.idea/dataSources/
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
6 changes: 6 additions & 0 deletions example-desktop/.idea/$CACHE_FILE$

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions example-desktop/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example-desktop/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions example-desktop/.idea/flexCompiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions example-desktop/.idea/libraries/AppleSignInANE.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions example-desktop/.idea/libraries/FiraSansSemiBold.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions example-desktop/.idea/libraries/FreSwift.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions example-desktop/.idea/libraries/greensock.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions example-desktop/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions example-desktop/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions example-desktop/AppleSignInExampleMac.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="Flex" version="4">
<component name="FlexBuildConfigurationManager" active="AppleSignInExampleMac">
<configurations>
<configuration name="AppleSignInExampleMac" target-platform="Desktop" pure-as="true" main-class="Main" output-file="Main.swf" output-folder="$MODULE_DIR$/bin-release">
<dependencies target-player="32.0">
<entries>
<entry library-name="FreSwift" library-level="project">
<dependency linkage="Merged" />
</entry>
<entry library-name="AppleSignInANE" library-level="project">
<dependency linkage="Merged" />
</entry>
<entry library-name="FiraSansSemiBold" library-level="project">
<dependency linkage="Merged" />
</entry>
<entry library-name="greensock" library-level="project">
<dependency linkage="Merged" />
</entry>
</entries>
<sdk name="AIRSDK_32" />
</dependencies>
<compiler-options>
<map>
<entry key="compiler.debug.swf" value="true" />
</map>
</compiler-options>
<packaging-air-desktop use-generated-descriptor="false" custom-descriptor-path="$MODULE_DIR$/src/Main-app.xml" package-file-name="Main">
<files-to-package>
<FilePathAndPathInPackage file-path="$MODULE_DIR$/src/Assets.car" path-in-package="Assets.car" />
<FilePathAndPathInPackage file-path="$MODULE_DIR$/src/AppIcon.icns" path-in-package="AppIcon.icns" />
</files-to-package>
</packaging-air-desktop>
<packaging-android />
<packaging-ios />
</configuration>
</configurations>
<compiler-options />
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="AIRSDK_32" jdkType="Flex SDK Type (new)" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="AppleSignInANE" level="project" />
<orderEntry type="library" exported="" name="FreSwift" level="project" />
<orderEntry type="library" exported="" name="FiraSansSemiBold" level="project" />
<orderEntry type="library" exported="" name="greensock" level="project" />
</component>
</module>
7 changes: 7 additions & 0 deletions example-desktop/get_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

AneVersion="1.2.0"
FreSwiftVersion="4.2.0"

wget -O ../native_extension/ane/FreSwift.ane https://github.com/tuarua/Swift-IOS-ANE/releases/download/$FreSwiftVersion/FreSwift.ane?raw=true
wget -O ../native_extension/ane/MLANE.ane https://github.com/tuarua/Apple-Signin-ANE/releases/download/$AneVersion/AppleSignInANE.ane?raw=true
Binary file added example-desktop/libs/FiraSansSemiBold.swc
Binary file not shown.
Binary file added example-desktop/libs/greensock.swc
Binary file not shown.
Binary file added example-desktop/src/AppIcon.icns
Binary file not shown.
Binary file added example-desktop/src/Assets.car
Binary file not shown.
20 changes: 20 additions & 0 deletions example-desktop/src/Entitlements.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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>com.apple.developer.applesignin</key>
<array>
<string>Default</string>
</array>
<key>com.apple.developer.team-identifier</key>
<string>XXXXXXXX</string>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
<key>com.apple.application-identifier</key>
<string>XXXXXXXX.com.tuarua.AppleSignInANE.ExampleMac</string>
</dict>
</plist>
27 changes: 27 additions & 0 deletions example-desktop/src/Main-app.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/32.0">
<id>com.tuarua.AppleSignInANE.ExampleMac</id>
<filename>Main</filename>
<name>Main</name>
<versionNumber>1.0.0</versionNumber>

<!-- Identifies the ActionScript extensions used by an application. -->
<extensions>
<extensionID>com.tuarua.FreSwift</extensionID>
<extensionID>com.tuarua.AppleSignInANE</extensionID>
</extensions>

<!-- Settings for the application's initial window. Required. -->
<initialWindow>
<!-- The main SWF or HTML file of the application. Required. -->
<content>SWF file name is set automatically at compile time</content>
<requestedDisplayResolution>high</requestedDisplayResolution>
<depthAndStencil>true</depthAndStencil>
<renderMode>direct</renderMode>
<autoOrients>false</autoOrients>
<fullScreen>false</fullScreen>
<visible>true</visible>
</initialWindow>


</application>
Loading

0 comments on commit 71f4dd3

Please sign in to comment.