diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml new file mode 100644 index 00000000..86a8aca4 --- /dev/null +++ b/.github/workflows/ios.yml @@ -0,0 +1,75 @@ +name: App build +on: + push: + branches: + - master + - main + workflow_dispatch: + +jobs: + build_with_signing: + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Java + uses: actions/setup-java@v1 + with: + java-version: '12.x' + + - name: Install Flutter + uses: subosito/flutter-action@v1 + with: + channel: 'stable' # 'dev', 'alpha', default to: 'stable' + + - name: Install the Apple certificate and provisioning profile + env: + SIGNING_CERTIFICATE_P12_DATA: ${{ secrets.SIGNING_CERTIFICATE_P12_DATA }} + SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }} + BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + run: | + # create variables + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + + # import certificate and provisioning profile from secrets + echo -n "$SIGNING_CERTIFICATE_P12_DATA" | base64 --decode --output $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH + + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + + # import certificate to keychain + security import $CERTIFICATE_PATH -P $SIGNING_CERTIFICATE_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles + ls ~/Library/MobileDevice/Provisioning\ Profiles/ + cat $CERTIFICATE_PATH | base64 + flutter pub get + flutter build ipa + brew install tree + cd /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/archive/ + tree + ls -al + # xcodebuild -exportArchive -archivePath ./Runner.xcarchive -exportOptionsPlist /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/ios/exportOptions.plist -exportPath "./" -allowProvisioningUpdates + cd .. + tar -zcvf archive/ios.tar.gz archive + + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/archive/* + tag: ${{ github.ref }} + overwrite: true + file_glob: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e12a71d1..ca3d547b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: - repo_token: ${{ secrets.GITHUBTOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} file: build/app/outputs/flutter-apk/* tag: ${{ github.ref }} overwrite: true @@ -55,7 +55,7 @@ jobs: - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 with: - repo_token: ${{ secrets.GITHUBTOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} file: /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/iphoneos/* tag: ${{ github.ref }} overwrite: true diff --git a/android/app/build.gradle b/android/app/build.gradle index 36dc0073..f6c0db20 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -34,7 +34,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "io.treehouses.remoteii" + applicationId "treehouses.remoteii" minSdkVersion 19 targetSdkVersion 31 versionCode flutterVersionCode.toInteger() diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 76477ca1..7493bab2 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -51,11 +51,11 @@ SPEC CHECKSUMS: Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a flutter_blue: eeb381dc4727a0954dede73515f683865494b370 package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 - path_provider: d1e9807085df1f9cc9318206cd649dc0b76be3de + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7 - shared_preferences: 5033afbb22d372e15aff8ff766df9021b845f273 - url_launcher: b6e016d912f04be9f5bf6e8e82dc599b7ba59649 + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d + url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef PODFILE CHECKSUM: d4807ef77006891d298ba2f893031d4f0cd35075 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 460486fa..ddafca69 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -155,7 +155,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -354,7 +354,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = M62639WUL7; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -362,8 +365,9 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = io.treehouses.remoteii; + PRODUCT_BUNDLE_IDENTIFIER = treehouses.remoteii; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -483,7 +487,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = M62639WUL7; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -491,8 +498,9 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = io.treehouses.remoteii; + PRODUCT_BUNDLE_IDENTIFIER = treehouses.remoteii; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -506,7 +514,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = M62639WUL7; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -514,8 +525,9 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = io.treehouses.remoteii; + PRODUCT_BUNDLE_IDENTIFIER = treehouses.remoteii; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cf..3db53b6e 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 3f85da46..debc9f36 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -22,6 +22,16 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + NSBluetoothAlwaysUsageDescription + Need BLE permission + NSBluetoothPeripheralUsageDescription + Need BLE permission + NSLocationAlwaysAndWhenInUseUsageDescription + Need Location permission + NSLocationAlwaysUsageDescription + Need Location permission + NSLocationWhenInUseUsageDescription + Need Location permission UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,15 +51,5 @@ UIViewControllerBasedStatusBarAppearance - NSBluetoothAlwaysUsageDescription - Need BLE permission - NSBluetoothPeripheralUsageDescription - Need BLE permission - NSLocationAlwaysAndWhenInUseUsageDescription - Need Location permission - NSLocationAlwaysUsageDescription - Need Location permission - NSLocationWhenInUseUsageDescription - Need Location permission diff --git a/ios/exportOptions.plist b/ios/exportOptions.plist new file mode 100644 index 00000000..60d8cdcd --- /dev/null +++ b/ios/exportOptions.plist @@ -0,0 +1,10 @@ + + + + + method + ad-hoc + teamID + M62639WUL7 + + \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 3cf39dfb..f76fd69e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.1" + version: "2.8.2" bloc: dependency: "direct main" description: @@ -42,7 +42,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: @@ -195,14 +195,14 @@ packages: name: freezed_annotation url: "https://pub.dartlang.org" source: hosted - version: "0.14.3" + version: "0.14.2" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.4" + version: "0.13.3" http_parser: dependency: transitive description: @@ -237,7 +237,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.3.0" + version: "4.0.1" logger: dependency: "direct main" description: @@ -251,7 +251,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" meta: dependency: transitive description: @@ -300,7 +300,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.4" path_provider_linux: dependency: transitive description: @@ -342,7 +342,7 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.2.6" + version: "8.3.0" permission_handler_platform_interface: dependency: transitive description: @@ -356,7 +356,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "4.1.0" platform: dependency: transitive description: @@ -377,7 +377,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.4" + version: "4.2.3" protobuf: dependency: transitive description: @@ -405,7 +405,7 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.7" shared_preferences_linux: dependency: transitive description: @@ -487,7 +487,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.3" typed_data: dependency: transitive description: @@ -501,7 +501,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.12" + version: "6.0.10" url_launcher_linux: dependency: transitive description: @@ -543,14 +543,14 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.2.10" xdg_directories: dependency: transitive description: @@ -564,7 +564,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.1.2" yaml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index df559445..fbf8ee45 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: flutter: sdk: flutter flutter_blue: ^0.8.0 - permission_handler: ^8.1.6 + permission_handler: ^8.2.6 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons.