Compare commits
356 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
febfbc3cc8 | ||
|
|
5ea848b62e | ||
|
|
96118a98b1 | ||
|
|
d25f3a2d4e | ||
|
|
c0600746b6 | ||
|
|
24cb34408b | ||
|
|
f90ae87017 | ||
|
|
273a71e759 | ||
|
|
d5c6a8f7f1 | ||
|
|
b6bb2c37a1 | ||
|
|
3ea1184bab | ||
|
|
a45e5c4874 | ||
|
|
d5926f1d5c | ||
|
|
c08ac5468a | ||
|
|
32ad152079 | ||
|
|
94372918ac | ||
|
|
3ce364a5be | ||
|
|
e4105ea248 | ||
|
|
604a8b6bd6 | ||
|
|
fc82a62af3 | ||
|
|
67aeb3e257 | ||
|
|
d371ec6d6e | ||
|
|
01509eaae9 | ||
|
|
b0df25241a | ||
|
|
56447743b2 | ||
|
|
301dc39648 | ||
|
|
3195568399 | ||
|
|
200b13c97f | ||
|
|
47173f6dbd | ||
|
|
83bf1fe047 | ||
|
|
aa8310905d | ||
|
|
a67a82d638 | ||
|
|
65b0807903 | ||
|
|
ca4702a684 | ||
|
|
a89ffc7ffd | ||
|
|
4e75270e49 | ||
|
|
e08a1dc183 | ||
|
|
8fa31968c0 | ||
|
|
27e25978f2 | ||
|
|
5a0761ef1a | ||
|
|
52c40e6f5c | ||
|
|
be7a18384c | ||
|
|
b4693229d2 | ||
|
|
dc28be0657 | ||
|
|
ce6f33522f | ||
|
|
200ac9d81e | ||
|
|
078398daba | ||
|
|
9ac73ec6fc | ||
|
|
a469134d2f | ||
|
|
57690808dd | ||
|
|
4edc8ef10c | ||
|
|
576e66c60c | ||
|
|
0e53f225d0 | ||
|
|
5d656913a8 | ||
|
|
49cea5f45d | ||
|
|
255435e419 | ||
|
|
1657338640 | ||
|
|
eb66731784 | ||
|
|
07c9abc87b | ||
|
|
f5e8bad1ae | ||
|
|
38e9533bfa | ||
|
|
2cd0273382 | ||
|
|
d62d572387 | ||
|
|
b65fe57c68 | ||
|
|
0e5f6ef2dd | ||
|
|
45112ccfcf | ||
|
|
d26e937066 | ||
|
|
bb1bb42214 | ||
|
|
07c16dcbe2 | ||
|
|
1b4f5613ac | ||
|
|
3315bcd73e | ||
|
|
87f33b9a15 | ||
|
|
c06d364344 | ||
|
|
cbab56c17b | ||
|
|
585c78c232 | ||
|
|
e569b20b9f | ||
|
|
590e18ee43 | ||
|
|
a8edd09eae | ||
|
|
f3dae6fb48 | ||
|
|
b4672c7f39 | ||
|
|
e60a7b61a8 | ||
|
|
e443e5ab0d | ||
|
|
29f773d212 | ||
|
|
86d09450b0 | ||
|
|
c081da9545 | ||
|
|
4d0f447b25 | ||
|
|
9cc7c1b123 | ||
|
|
354742a545 | ||
|
|
b64fbfb6e4 | ||
|
|
3a2ff5c8d2 | ||
|
|
a5a4d9e0c2 | ||
|
|
cfeef1621a | ||
|
|
2e25b09bdf | ||
|
|
5ba70376e6 | ||
|
|
7c07d6ecf8 | ||
|
|
2788ecc32e | ||
|
|
26dc9e93b3 | ||
|
|
14bf6c9ac3 | ||
|
|
1db9669ed2 | ||
|
|
c466e6dfa3 | ||
|
|
1c00921ee1 | ||
|
|
df432542b5 | ||
|
|
fe989750e7 | ||
|
|
e008dea61e | ||
|
|
7a8c7c963b | ||
|
|
0ecf285a95 | ||
|
|
b14500351f | ||
|
|
97693e25b8 | ||
|
|
12d573bc55 | ||
|
|
68562aaec9 | ||
|
|
2c7e714856 | ||
|
|
a7183cc519 | ||
|
|
bfffb2856d | ||
|
|
d2be747fc1 | ||
|
|
7fb44d2782 | ||
|
|
d7b46205fa | ||
|
|
0e0835c2f7 | ||
|
|
e81d6cb86f | ||
|
|
8eef01437c | ||
|
|
0d446ee293 | ||
|
|
c0afe1792e | ||
|
|
11fdcad57d | ||
|
|
2ac94907e8 | ||
|
|
f7669b2bbc | ||
|
|
89d200243b | ||
|
|
013b078a44 | ||
|
|
06aefdedc2 | ||
|
|
4071a12c11 | ||
|
|
83cdb6efd7 | ||
|
|
040c0d3027 | ||
|
|
a44d4d62d0 | ||
|
|
f51d588510 | ||
|
|
54b2f73384 | ||
|
|
dc63f693f0 | ||
|
|
455db754d8 | ||
|
|
cbef8fc044 | ||
|
|
d8e45f849a | ||
|
|
f83defb37b | ||
|
|
5c8db11536 | ||
|
|
30aa5b33a3 | ||
|
|
ca41e69a17 | ||
|
|
af4d8ab183 | ||
|
|
c1a24cfbd1 | ||
|
|
86b406e2a4 | ||
|
|
1ec93330b0 | ||
|
|
4ed3c5fefe | ||
|
|
54d106ff4e | ||
|
|
996669ec44 | ||
|
|
1d38ff521a | ||
|
|
f0c1409da4 | ||
|
|
9617198db7 | ||
|
|
e4863b1ebd | ||
|
|
d51a4cc29d | ||
|
|
dcbb225355 | ||
|
|
cba449b493 | ||
|
|
559fe1232b | ||
|
|
a7f9ca489e | ||
|
|
74bf75a82e | ||
|
|
747629cebf | ||
|
|
aca6e9272b | ||
|
|
18e6f9a1b5 | ||
|
|
c3532d5c35 | ||
|
|
1a88f45c93 | ||
|
|
b49eda7fc7 | ||
|
|
f0b3bc70b2 | ||
|
|
08700edc22 | ||
|
|
d698c9bbea | ||
|
|
eea1b8eb40 | ||
|
|
0118c5a87c | ||
|
|
65a3374d9c | ||
|
|
536225bf12 | ||
|
|
e858d35617 | ||
|
|
6d87e85353 | ||
|
|
d1fed35c3e | ||
|
|
d9297bd40e | ||
|
|
a1926dfc00 | ||
|
|
d55ba039af | ||
|
|
c9ebc5a9f6 | ||
|
|
be0c2d97ba | ||
|
|
a03cc76eaa | ||
|
|
504c71d5c4 | ||
|
|
d0291c68d7 | ||
|
|
33e5e41eff | ||
|
|
221d5a0b8d | ||
|
|
b899487ee9 | ||
|
|
ff0b724a73 | ||
|
|
647c20a6a3 | ||
|
|
c36e63aa8d | ||
|
|
cb523ea656 | ||
|
|
22b99f4f6d | ||
|
|
05e681b59a | ||
|
|
07ee91c17a | ||
|
|
323a344c3a | ||
|
|
0172b1cf90 | ||
|
|
5a5e4066f6 | ||
|
|
3256f5aa15 | ||
|
|
476a9a337f | ||
|
|
1f1ce58bd9 | ||
|
|
bbb3dd3397 | ||
|
|
d7cee77c8b | ||
|
|
e2ac975c75 | ||
|
|
5e9352316c | ||
|
|
c73adb7c0d | ||
|
|
c3b41f56d4 | ||
|
|
6fe841af58 | ||
|
|
d97307de6f | ||
|
|
826dc2327f | ||
|
|
3466e504e3 | ||
|
|
ebd7f80947 | ||
|
|
43e827d8f5 | ||
|
|
5d5dc2e152 | ||
|
|
c0d2eaa897 | ||
|
|
13c70fc445 | ||
|
|
1e11d28765 | ||
|
|
7ee9bc43a0 | ||
|
|
372085ec0e | ||
|
|
e758b35837 | ||
|
|
dee7b86120 | ||
|
|
b3ec7e7a3a | ||
|
|
bbd01d023a | ||
|
|
36282c9fa9 | ||
|
|
daea07c409 | ||
|
|
49d7445d0e | ||
|
|
9bb0e5616a | ||
|
|
7e98f595ee | ||
|
|
a9fdc4b16e | ||
|
|
c06819b502 | ||
|
|
969faca658 | ||
|
|
61fbb099e2 | ||
|
|
fbd6356be0 | ||
|
|
1c40455bf3 | ||
|
|
15129634a6 | ||
|
|
89d35d7734 | ||
|
|
d959bfb4c9 | ||
|
|
9bc25514ae | ||
|
|
25210b57ba | ||
|
|
c9317e369c | ||
|
|
2195c19ed9 | ||
|
|
d13a9d72c9 | ||
|
|
55d230e41c | ||
|
|
ffa604f921 | ||
|
|
93bdfeeaa7 | ||
|
|
336c64e5a9 | ||
|
|
20a706d93d | ||
|
|
21cb8844fc | ||
|
|
4bc1a3b1d0 | ||
|
|
9df1f7cfa6 | ||
|
|
72cdf86802 | ||
|
|
9a53d5fdab | ||
|
|
458e6333a0 | ||
|
|
f42e483260 | ||
|
|
dda2135129 | ||
|
|
bc2831c17e | ||
|
|
310313c3b2 | ||
|
|
2122568461 | ||
|
|
144fd5b740 | ||
|
|
5f7a1a8203 | ||
|
|
258b396444 | ||
|
|
5861533793 | ||
|
|
3106bd09e8 | ||
|
|
a3475a02d2 | ||
|
|
fb1a1f35ad | ||
|
|
71aadde901 | ||
|
|
f7bfd8c206 | ||
|
|
ff83e5271b | ||
|
|
ec6edb2864 | ||
|
|
4f4a6f60c5 | ||
|
|
354e13678b | ||
|
|
f1b8822e20 | ||
|
|
6bf83b1034 | ||
|
|
7b1e4ede2a | ||
|
|
a554820115 | ||
|
|
cb9f9ea5b3 | ||
|
|
4051553a56 | ||
|
|
01a213354b | ||
|
|
962abfb38e | ||
|
|
ada4cf0dfd | ||
|
|
aff1137c3d | ||
|
|
7f24c27201 | ||
|
|
51c5e34220 | ||
|
|
10c2cc64a2 | ||
|
|
a14d21f8e4 | ||
|
|
8de715a153 | ||
|
|
e9ebe832de | ||
|
|
2c8feccea1 | ||
|
|
36083e654f | ||
|
|
8790b1938a | ||
|
|
7cd48ce3c4 | ||
|
|
4300f1005d | ||
|
|
9dec9c370c | ||
|
|
e9f460279a | ||
|
|
06b322e575 | ||
|
|
80d8d8c0cd | ||
|
|
4450db3be9 | ||
|
|
b875489ad3 | ||
|
|
ece3f3822f | ||
|
|
0780cdc80b | ||
|
|
1c0e027abb | ||
|
|
0dcb666bbd | ||
|
|
00ebca7a01 | ||
|
|
f9c8820303 | ||
|
|
3d414edda9 | ||
|
|
0e3f6f1d5e | ||
|
|
c4b0ef38c0 | ||
|
|
2e800bb2de | ||
|
|
505b970497 | ||
|
|
986bfd481c | ||
|
|
ab8d480a01 | ||
|
|
7e19b76403 | ||
|
|
cbc2f103ac | ||
|
|
6a7922cf17 | ||
|
|
8e23de2718 | ||
|
|
11aec5fba1 | ||
|
|
c98f213e2e | ||
|
|
8c11cfcad6 | ||
|
|
5fe88ffc6a | ||
|
|
7a8c7a4ee1 | ||
|
|
3343325195 | ||
|
|
edda16dc06 | ||
|
|
7a3d120123 | ||
|
|
92419c9182 | ||
|
|
68bb5bf371 | ||
|
|
b0d8bfcadd | ||
|
|
a58ad1daf6 | ||
|
|
657c6056c4 | ||
|
|
84daba8902 | ||
|
|
3e37f8a269 | ||
|
|
28d178c4be | ||
|
|
f560cd5930 | ||
|
|
dbf24c6cd3 | ||
|
|
0a4989ca47 | ||
|
|
507dbf5d0f | ||
|
|
536f36f4e7 | ||
|
|
c523ba2287 | ||
|
|
a3f1cbb3b1 | ||
|
|
561bb2f0f4 | ||
|
|
dbbd1b5f2c | ||
|
|
7f6ec2f732 | ||
|
|
e8649203cf | ||
|
|
765b0c3d6d | ||
|
|
248c40731c | ||
|
|
cde01a4863 | ||
|
|
1ee8a0188b | ||
|
|
32e8fc9bf5 | ||
|
|
3c87d895c5 | ||
|
|
82dd8a9b48 | ||
|
|
0996506fd1 | ||
|
|
3ee38ee1e2 | ||
|
|
cf9401d81c | ||
|
|
dbed5cc247 | ||
|
|
625a77fd74 | ||
|
|
3e56c32376 | ||
|
|
56ecad07cd | ||
|
|
de8ef5f10b | ||
|
|
022df97b89 | ||
|
|
662480ef4c |
3
.github/FUNDING.yml
vendored
@@ -1,3 +1,2 @@
|
||||
github: [jonasbark]
|
||||
open_collective: jonas-bark1
|
||||
custom: ["https://paypal.me/boni"]
|
||||
custom: ["https://paypal.me/boni", "https://donate.stripe.com/9B6aEX0muajY8bZ1Kl6J200"]
|
||||
|
||||
233
.github/workflows/build.yml
vendored
@@ -1,9 +1,32 @@
|
||||
name: "Build"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
build_mac:
|
||||
description: 'Build for macOS'
|
||||
required: false
|
||||
default: 'true'
|
||||
build_windows:
|
||||
description: 'Build for Windows'
|
||||
required: false
|
||||
default: 'true'
|
||||
build_android:
|
||||
description: 'Build for Android'
|
||||
required: false
|
||||
default: 'true'
|
||||
build_ios:
|
||||
description: 'Build for iOS'
|
||||
required: false
|
||||
default: 'true'
|
||||
build_web:
|
||||
description: 'Build for Web'
|
||||
required: false
|
||||
default: 'true'
|
||||
|
||||
env:
|
||||
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
|
||||
FLUTTER_VERSION: 3.35.5
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -21,17 +44,30 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install certificates
|
||||
if: github.event.inputs.build_mac == 'true' || github.event.inputs.build_ios == 'true'
|
||||
env:
|
||||
DEVELOPER_ID_APPLICATION_P12_BASE64_MAC: ${{ secrets.DEVELOPER_ID_APPLICATION_P12_BASE64_MAC }}
|
||||
DEVELOPER_ID_INSTALLER_P12_BASE64_MAC: ${{ secrets.DEVELOPER_ID_INSTALLER_P12_BASE64_MAC }}
|
||||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
APPSTORE_PROFILE_IOS_BASE64: ${{ secrets.APPSTORE_PROFILE_IOS_BASE64 }}
|
||||
APPSTORE_PROFILE_MACOS_BASE64: ${{ secrets.APPSTORE_PROFILE_MACOS_BASE64 }}
|
||||
APPSTORE_PROFILE_DEV_IOS_BASE64: ${{ secrets.APPSTORE_PROFILE_DEV_IOS_BASE64 }}
|
||||
run: |
|
||||
# create variables
|
||||
DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH=$RUNNER_TEMP/build_developerID_application_certificate.p12
|
||||
DEVELOPER_ID_INSTALLER_CERTIFICATE_PATH=$RUNNER_TEMP/build_developerID_installer_certificate.p12
|
||||
PP_PATH_IOS=$RUNNER_TEMP/build_pp_ios.mobileprovision
|
||||
PP_PATH_IOS_DEV=$RUNNER_TEMP/build_pp_ios_dev.mobileprovision
|
||||
PP_PATH_MACOS=$RUNNER_TEMP/build_pp_macos.provisionprofile
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/pg-signing.keychain-db
|
||||
|
||||
# import certificate and provisioning profile from secrets
|
||||
echo -n "$DEVELOPER_ID_APPLICATION_P12_BASE64_MAC" | base64 --decode --output $DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH
|
||||
echo -n "$DEVELOPER_ID_INSTALLER_P12_BASE64_MAC" | base64 --decode --output $DEVELOPER_ID_INSTALLER_CERTIFICATE_PATH
|
||||
echo -n "$APPSTORE_PROFILE_IOS_BASE64" | base64 --decode -o $PP_PATH_IOS
|
||||
echo -n "$APPSTORE_PROFILE_DEV_IOS_BASE64" | base64 --decode -o $PP_PATH_IOS_DEV
|
||||
echo -n "$APPSTORE_PROFILE_MACOS_BASE64" | base64 --decode -o $PP_PATH_MACOS
|
||||
|
||||
# create temporary keychain
|
||||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
@@ -41,56 +77,146 @@ jobs:
|
||||
|
||||
# import certificate to keychain
|
||||
security import $DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security import $DEVELOPER_ID_INSTALLER_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
|
||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH_IOS ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH_IOS_DEV ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH_MACOS ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
|
||||
#2 Setup Java
|
||||
- name: Set Up Java
|
||||
uses: actions/setup-java@v3.12.0
|
||||
- name: 🐦 Setup Shorebird
|
||||
uses: shorebirdtech/setup-shorebird@v1
|
||||
with:
|
||||
distribution: 'oracle'
|
||||
java-version: '17'
|
||||
cache: true
|
||||
|
||||
- name: 🚀 Shorebird Release macOS
|
||||
if: github.event.inputs.build_mac == 'true'
|
||||
uses: shorebirdtech/shorebird-release@v1
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
platform: macos
|
||||
|
||||
- name: Decode Keystore
|
||||
if: github.event.inputs.build_android == 'true'
|
||||
run: |
|
||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/android.keystore;
|
||||
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > android/keystore.properties;
|
||||
|
||||
- name: 🚀 Shorebird Release Android
|
||||
if: github.event.inputs.build_android == 'true'
|
||||
uses: shorebirdtech/shorebird-release@v1
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
platform: android
|
||||
args: "--artifact=apk"
|
||||
|
||||
#3 Setup Flutter
|
||||
- name: Set Up Flutter
|
||||
if: github.event.inputs.build_web == 'true'
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
|
||||
#4 Install Dependencies
|
||||
- name: Install Dependencies
|
||||
run: flutter pub get
|
||||
- name: Build Web
|
||||
if: github.event.inputs.build_web == 'true'
|
||||
run: flutter build web --release --base-href "/swiftcontrol/"
|
||||
|
||||
#8 Build app ( macos Build )
|
||||
- name: Build App
|
||||
run: flutter build macos --release
|
||||
- name: Upload static files as artifact
|
||||
if: github.event.inputs.build_web == 'true'
|
||||
id: deployment
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: build/web
|
||||
|
||||
- name: Code Signing
|
||||
run: /usr/bin/codesign --deep --force -s "$DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY" --options runtime SwiftControl.app -v
|
||||
- name: Web Deploy
|
||||
if: github.event.inputs.build_web == 'true'
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
- name: Extract latest changelog
|
||||
id: changelog
|
||||
run: |
|
||||
chmod +x scripts/get_latest_changelog.sh
|
||||
mkdir -p whatsnew
|
||||
./scripts/get_latest_changelog.sh | head -c 500 > whatsnew/whatsnew-en-US
|
||||
|
||||
- name: 🚀 Shorebird Release iOS
|
||||
if: github.event.inputs.build_ios == 'true'
|
||||
uses: shorebirdtech/shorebird-release@v1
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
platform: ios
|
||||
args: "--export-options-plist ios/ExportOptions.plist"
|
||||
|
||||
- name: Prepare App Store authentication key
|
||||
if: github.event.inputs.build_ios == 'true' || github.event.inputs.build_mac == 'true'
|
||||
env:
|
||||
API_KEY_BASE64: ${{ secrets.APPSTORE_API_KEY_FILE_BASE64 }}
|
||||
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
|
||||
run: |
|
||||
mkdir -p ./private_keys;
|
||||
printf %s "$API_KEY_BASE64" | base64 -D > "./private_keys/AuthKey_${APPSTORE_API_KEY}.p8";
|
||||
|
||||
- name: Upload to Play Store
|
||||
if: github.event.inputs.build_android == 'true'
|
||||
uses: r0adkll/upload-google-play@v1
|
||||
with:
|
||||
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
|
||||
packageName: de.jonasbark.swiftcontrol
|
||||
releaseFiles: build/app/outputs/bundle/release/app-release.aab
|
||||
track: production
|
||||
whatsNewDirectory: whatsnew
|
||||
|
||||
- name: Upload to macOS App Store
|
||||
if: github.event.inputs.build_mac == 'true'
|
||||
env:
|
||||
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
|
||||
APPSTORE_API_ISSUER_ID: ${{ secrets.APPSTORE_API_ISSUER_ID }}
|
||||
run: |
|
||||
productbuild --component "build/macos/Build/Products/Release/SwiftControl.app" /Applications "SwiftControl.pkg" --sign "3rd Party Mac Developer Installer: JONAS TASSILO BARK (UZRHKPVWN9)";
|
||||
xcrun altool --upload-app -f SwiftControl.pkg -t osx --apiKey "$APPSTORE_API_KEY" --apiIssuer "$APPSTORE_API_ISSUER_ID";
|
||||
|
||||
- name: Upload to iOS App Store
|
||||
if: github.event.inputs.build_ios == 'true'
|
||||
env:
|
||||
APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }}
|
||||
APPSTORE_API_ISSUER_ID: ${{ secrets.APPSTORE_API_ISSUER_ID }}
|
||||
run: |
|
||||
xcrun altool --upload-app -f build/ios/ipa/swift_play.ipa -t ios --apiKey "$APPSTORE_API_KEY" --apiIssuer "$APPSTORE_API_ISSUER_ID";
|
||||
|
||||
- name: Handle Android archives
|
||||
if: github.event.inputs.build_android == 'true'
|
||||
run: |
|
||||
cp build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/SwiftControl.android.apk
|
||||
|
||||
- name: Code Signing of macOS app
|
||||
if: github.event.inputs.build_mac == 'true'
|
||||
run: /usr/bin/codesign --deep --force -s "$DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY" --entitlements ../../../../../macos/Runner/Release.entitlements --options runtime SwiftControl.app -v
|
||||
working-directory: build/macos/Build/Products/Release
|
||||
env:
|
||||
DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY: ${{ secrets.DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY }}
|
||||
|
||||
#6 Building APK
|
||||
- name: Build APK
|
||||
run: flutter build apk --release
|
||||
|
||||
- name: Build Web
|
||||
run: flutter build web --release --base-href "/swiftcontrol/"
|
||||
|
||||
- name: Handle archives
|
||||
- name: Handle macOS archives
|
||||
if: github.event.inputs.build_mac == 'true'
|
||||
run: |
|
||||
cp build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/SwiftControl.android.apk
|
||||
cd build/macos/Build/Products/Release/
|
||||
zip -r SwiftControl.macos.zip SwiftControl.app/
|
||||
|
||||
#9 Upload Artifacts
|
||||
- name: Upload Artifacts
|
||||
- name: Upload Android Artifacts
|
||||
if: github.event.inputs.build_android == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Releases
|
||||
path: |
|
||||
build/app/outputs/flutter-apk/SwiftControl.android.apk
|
||||
|
||||
- name: Upload macOS Artifacts
|
||||
if: github.event.inputs.build_mac == 'true'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Releases
|
||||
path: |
|
||||
build/macos/Build/Products/Release/SwiftControl.macos.zip
|
||||
|
||||
#10 Extract Version
|
||||
@@ -123,20 +249,15 @@ jobs:
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "build/app/outputs/flutter-apk/SwiftControl.android.apk,build/macos/Build/Products/Release/SwiftControl.macos.zip"
|
||||
allowUpdates: true
|
||||
prerelease: ${{ endsWith(env.VERSION, '1337') }}
|
||||
bodyFile: scripts/RELEASE_NOTES.md
|
||||
tag: v${{ env.VERSION }}
|
||||
token: ${{ secrets.TOKEN }}
|
||||
|
||||
- name: Upload static files as artifact
|
||||
id: deployment
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: build/web
|
||||
|
||||
- name: Web Deploy
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
windows:
|
||||
needs: build
|
||||
if: github.event.inputs.build_windows == 'true'
|
||||
name: Build & Release on Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
@@ -152,22 +273,39 @@ jobs:
|
||||
distribution: 'oracle'
|
||||
java-version: '17'
|
||||
|
||||
#3 Setup Flutter
|
||||
- name: Set Up Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
- name: 🐦 Setup Shorebird
|
||||
uses: shorebirdtech/setup-shorebird@v1
|
||||
with:
|
||||
channel: 'stable'
|
||||
cache: true
|
||||
|
||||
#4 Install Dependencies
|
||||
- name: Install Dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build App
|
||||
run: flutter build windows
|
||||
- name: 🚀 Shorebird Release Windows
|
||||
uses: shorebirdtech/shorebird-release@v1
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
platform: windows
|
||||
|
||||
- name: Zip directory (Windows)
|
||||
shell: pwsh
|
||||
run: |
|
||||
|
||||
$source = "C:\Windows\System32"
|
||||
$destination = "build\windows\x64\runner\Release"
|
||||
|
||||
# List of required DLLs
|
||||
$dlls = @("msvcp140.dll", "vcruntime140.dll", "vcruntime140_1.dll")
|
||||
|
||||
# Copy each file
|
||||
foreach ($dll in $dlls) {
|
||||
$srcPath = Join-Path $source $dll
|
||||
$destPath = Join-Path $destination $dll
|
||||
|
||||
if (Test-Path $srcPath) {
|
||||
Copy-Item -Path $srcPath -Destination $destPath -Force
|
||||
Write-Output "Copied $dll to $destination"
|
||||
} else {
|
||||
Write-Warning "$dll not found in $source"
|
||||
}
|
||||
}
|
||||
Compress-Archive -Path "build/windows/x64/runner/Release/*" -DestinationPath "build/windows/x64/runner/Release/SwiftControl.windows.zip"
|
||||
|
||||
#9 Upload Artifacts
|
||||
@@ -195,5 +333,6 @@ jobs:
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: "build/windows/x64/runner/Release/SwiftControl.windows.zip"
|
||||
bodyFile: scripts/RELEASE_NOTES.md
|
||||
tag: v${{ env.VERSION }}
|
||||
token: ${{ secrets.TOKEN }}
|
||||
|
||||
161
.github/workflows/patch.yml
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
name: "Patch"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
SHOREBIRD_TOKEN: ${{ secrets.SHOREBIRD_TOKEN }}
|
||||
FLUTTER_VERSION: 3.35.5
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Patch iOS, Android & macOS
|
||||
runs-on: macos-latest
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
pages: write
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
#1 Checkout Repository
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 🐦 Setup Shorebird
|
||||
uses: shorebirdtech/setup-shorebird@v1
|
||||
with:
|
||||
cache: true
|
||||
|
||||
- name: Install certificates
|
||||
env:
|
||||
DEVELOPER_ID_APPLICATION_P12_BASE64_MAC: ${{ secrets.DEVELOPER_ID_APPLICATION_P12_BASE64_MAC }}
|
||||
DEVELOPER_ID_INSTALLER_P12_BASE64_MAC: ${{ secrets.DEVELOPER_ID_INSTALLER_P12_BASE64_MAC }}
|
||||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
APPSTORE_PROFILE_IOS_BASE64: ${{ secrets.APPSTORE_PROFILE_IOS_BASE64 }}
|
||||
APPSTORE_PROFILE_MACOS_BASE64: ${{ secrets.APPSTORE_PROFILE_MACOS_BASE64 }}
|
||||
APPSTORE_PROFILE_DEV_IOS_BASE64: ${{ secrets.APPSTORE_PROFILE_DEV_IOS_BASE64 }}
|
||||
run: |
|
||||
# create variables
|
||||
DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH=$RUNNER_TEMP/build_developerID_application_certificate.p12
|
||||
DEVELOPER_ID_INSTALLER_CERTIFICATE_PATH=$RUNNER_TEMP/build_developerID_installer_certificate.p12
|
||||
PP_PATH_IOS=$RUNNER_TEMP/build_pp_ios.mobileprovision
|
||||
PP_PATH_IOS_DEV=$RUNNER_TEMP/build_pp_ios_dev.mobileprovision
|
||||
PP_PATH_MACOS=$RUNNER_TEMP/build_pp_macos.provisionprofile
|
||||
KEYCHAIN_PATH=$RUNNER_TEMP/pg-signing.keychain-db
|
||||
|
||||
# import certificate and provisioning profile from secrets
|
||||
echo -n "$DEVELOPER_ID_APPLICATION_P12_BASE64_MAC" | base64 --decode --output $DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH
|
||||
echo -n "$DEVELOPER_ID_INSTALLER_P12_BASE64_MAC" | base64 --decode --output $DEVELOPER_ID_INSTALLER_CERTIFICATE_PATH
|
||||
echo -n "$APPSTORE_PROFILE_IOS_BASE64" | base64 --decode -o $PP_PATH_IOS
|
||||
echo -n "$APPSTORE_PROFILE_DEV_IOS_BASE64" | base64 --decode -o $PP_PATH_IOS_DEV
|
||||
echo -n "$APPSTORE_PROFILE_MACOS_BASE64" | base64 --decode -o $PP_PATH_MACOS
|
||||
|
||||
# create temporary keychain
|
||||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
# security default-keychain -s $KEYCHAIN_PATH
|
||||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
|
||||
# import certificate to keychain
|
||||
security import $DEVELOPER_ID_APPLICATION_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security import $DEVELOPER_ID_INSTALLER_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||
|
||||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH_IOS ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH_IOS_DEV ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
cp $PP_PATH_MACOS ~/Library/MobileDevice/Provisioning\ Profiles
|
||||
|
||||
- name: Decode Keystore
|
||||
run: |
|
||||
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/android.keystore;
|
||||
echo "${{ secrets.KEYSTORE_PROPERTIES }}" > android/keystore.properties;
|
||||
|
||||
- name: 🚀 Shorebird Patch macOS
|
||||
uses: shorebirdtech/shorebird-patch@v1
|
||||
with:
|
||||
platform: macos
|
||||
release-version: latest
|
||||
args: '--allow-asset-diffs'
|
||||
|
||||
- name: 🚀 Shorebird Patch Android
|
||||
uses: shorebirdtech/shorebird-patch@v1
|
||||
with:
|
||||
platform: android
|
||||
release-version: latest
|
||||
args: '--allow-asset-diffs'
|
||||
|
||||
- name: 🚀 Shorebird Patch iOS
|
||||
uses: shorebirdtech/shorebird-patch@v1
|
||||
with:
|
||||
platform: ios
|
||||
release-version: latest
|
||||
args: '--allow-asset-diffs'
|
||||
|
||||
- name: Set Up Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
|
||||
# shorebird struggles with the app from GitHub
|
||||
- name: Build macOS
|
||||
env:
|
||||
DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY: ${{ secrets.DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY }}
|
||||
run: |
|
||||
flutter build macos --release;
|
||||
cd build/macos/Build/Products/Release/;
|
||||
zip -r SwiftControl.macos.zip SwiftControl.app/;
|
||||
version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r');
|
||||
echo "VERSION=$version" >> $GITHUB_ENV;
|
||||
/usr/bin/codesign --deep --force -s "$DEVELOPER_ID_APPLICATION_SIGNING_IDENTITY" --entitlements ../../../../../macos/Runner/Release.entitlements --options runtime SwiftControl.app -v;
|
||||
|
||||
#9 Upload Artifacts
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
overwrite: true
|
||||
name: Releases
|
||||
path: |
|
||||
build/macos/Build/Products/Release/SwiftControl.macos.zip
|
||||
|
||||
# add artifact to release
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts: "build/macos/Build/Products/Release/SwiftControl.macos.zip"
|
||||
bodyFile: scripts/RELEASE_NOTES.md
|
||||
tag: v${{ env.VERSION }}
|
||||
token: ${{ secrets.TOKEN }}
|
||||
|
||||
windows:
|
||||
name: Patch Windows
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
#1 Checkout Repository
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
#2 Setup Java
|
||||
- name: Set Up Java
|
||||
uses: actions/setup-java@v3.12.0
|
||||
with:
|
||||
distribution: 'oracle'
|
||||
java-version: '17'
|
||||
|
||||
- name: 🐦 Setup Shorebird
|
||||
uses: shorebirdtech/setup-shorebird@v1
|
||||
with:
|
||||
cache: true
|
||||
|
||||
- name: 🚀 Shorebird Patch Windows
|
||||
uses: shorebirdtech/shorebird-patch@v1
|
||||
with:
|
||||
platform: windows
|
||||
release-version: latest
|
||||
args: '--allow-asset-diffs'
|
||||
51
.github/workflows/web.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: "Build"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- web
|
||||
- wahoo_kickr_bike_shift
|
||||
- main
|
||||
paths:
|
||||
- '.github/workflows/web.yml'
|
||||
- 'lib/**'
|
||||
- 'accessibility/**'
|
||||
- 'keypress_simulator/**'
|
||||
- 'pubspec.yaml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Web
|
||||
runs-on: macos-latest
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
pages: write
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
#1 Checkout Repository
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
#3 Setup Flutter
|
||||
- name: Set Up Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
|
||||
#4 Install Dependencies
|
||||
- name: Install Dependencies
|
||||
run: flutter pub get
|
||||
|
||||
- name: Build Web
|
||||
run: flutter build web --release --base-href "/swiftcontrol/"
|
||||
|
||||
- name: Upload static files as artifact
|
||||
id: deployment
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: build/web
|
||||
|
||||
- name: Web Deploy
|
||||
uses: actions/deploy-pages@v4
|
||||
4
.gitignore
vendored
@@ -12,6 +12,8 @@
|
||||
.swiftpm/
|
||||
migrate_working_dir/
|
||||
|
||||
android/keystore.properties
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
@@ -43,3 +45,5 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
service-account.json
|
||||
|
||||
23
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"name": "swiftcontrol",
|
||||
"request": "launch",
|
||||
"type": "dart"
|
||||
},
|
||||
{
|
||||
"name": "swiftcontrol (profile mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "profile"
|
||||
},
|
||||
{
|
||||
"name": "swiftcontrol (release mode)",
|
||||
"request": "launch",
|
||||
"type": "dart",
|
||||
"flutterMode": "release"
|
||||
}
|
||||
]
|
||||
}
|
||||
138
CHANGELOG.md
Normal file
@@ -0,0 +1,138 @@
|
||||
### 3.0.4 (not released yet)
|
||||
- adjusted MyWhoosh keyboard navigation mapping (thanks @bin101)
|
||||
- initial support for Wahook Kickr Bike Shift (thanks @MattW2)
|
||||
- initial support for Elite Square Smart Frame
|
||||
|
||||
### 3.0.3 (2025-10-12)
|
||||
- SwiftControl now supports iOS!
|
||||
- Note that you can't run SwiftControl and your trainer app on the same iPhone due to iOS limitations but...:
|
||||
- You can now use SwiftControl as "remote control" for other devices, such as an iPad. Example scenario:
|
||||
- your phone (Android/iOS) runs SwiftControl and connects to your Click devices
|
||||
- your iPad or other tablet runs e.g. MyWhoosh (does not need to have SwiftControl installed)
|
||||
- after pairing SwiftControl to your iPad / tablet via Bluetooth your phone will send the button presses to your iPad / tablet
|
||||
- Ride: analog paddles are now supported thanks to contributor @jmoro
|
||||
- you can now zoom in and out in the Keymap customization screen
|
||||
|
||||
### 2.6.3 (2025-10-01)
|
||||
- fix a few issues with the new touch placement feature
|
||||
- add a workaround for Zwift Click V2 which resets the device when button events are no longer sent
|
||||
- fix issue on Android and Desktop where only a "touch down" was sent, but no "touch up"
|
||||
- improve UI when handling custom keymaps around the edges of the screen
|
||||
|
||||
### 2.6.0 (2025-09-30)
|
||||
- refactor touch placements: show touches on screen, fix misplaced coordinates - should fix #64
|
||||
- show firmware version of connected device
|
||||
- Fix crashes on some Android devices
|
||||
- warn the user how to make Zwift Click V2 work properly
|
||||
- many UI improvements
|
||||
- add setting to enable or disable vibration on button press for Zwift Ride and Zwift Play controllers
|
||||
|
||||
### 2.5.0 (2025-09-25)
|
||||
- Improve usability
|
||||
- SwiftControl is now available via the Play Store: https://play.google.com/store/apps/details?id=de.jonasbark.swiftcontrol
|
||||
- SwiftControl will continue to be available to download for free on GitHub
|
||||
- contact me if you already donated and I'll get a voucher for you :)
|
||||
|
||||
### 2.4.0+1 (2025-09-17)
|
||||
- Windows: fix mouse clicks at wrong location due to display scaling (fixes #64)
|
||||
|
||||
### 2.4.0 (2025-09-16)
|
||||
- Show an overview of the keymap bindings
|
||||
- Allow customizing an existing keymap
|
||||
- Add more donation options
|
||||
|
||||
### 2.3.0 (2025-09-11)
|
||||
- Add support for latest Zwift Click v2
|
||||
|
||||
### 2.2.0 (2025-09-08)
|
||||
- Add Long Press Mode option for custom keymaps - buttons can now send sustained key presses instead of repeated taps, perfect for movement controls in games (fixes #61)
|
||||
- Windows: adjust key sending method to improve compatibility with more apps (fixes #62)
|
||||
|
||||
### 2.1.0 (2025-07-03)
|
||||
- Windows: automatically focus compatible training apps (MyWhoosh, IndieVelo, Biketerra) when sending keystrokes, enabling seamless multi-window usage
|
||||
|
||||
### 2.0.9 (2025-05-04)
|
||||
- you can now assign Escape and arrow down key to your custom keymap (#18)
|
||||
|
||||
### 2.0.8 (2025-05-02)
|
||||
- only use the light theme for the app
|
||||
- more troubleshooting information
|
||||
|
||||
### 2.0.7 (2025-04-18)
|
||||
- add Biketerra.com keymap
|
||||
- some UX improvements
|
||||
|
||||
### 2.0.6 (2025-04-15)
|
||||
- fix MyWhoosh up / downshift button assignment (I key vs K key)
|
||||
|
||||
### 2.0.5 (2025-04-13)
|
||||
- fix Zwift Click button assignment (#12)
|
||||
|
||||
### 2.0.4 (2025-04-10)
|
||||
- vibrate Zwift Play / Zwift Ride controller on gear shift (thanks @cagnulein, closes #16)
|
||||
|
||||
### 2.0.3 (2025-04-08)
|
||||
- adjust TrainingPeaks Virtual key mapping (#12)
|
||||
- attempt to reconnect device if connection is lost
|
||||
- Android: detect freeform windows for MyWhoosh + TrainingPeaks Virtual keymaps
|
||||
|
||||
### 2.0.2 (2025-04-07)
|
||||
- fix bluetooth scan issues on older Android devices by asking for location permission
|
||||
|
||||
### 2.0.1 (2025-04-06)
|
||||
- long pressing a button will trigger the action again every 250ms
|
||||
|
||||
### 2.0.0 (2025-04-06)
|
||||
- You can now customize the actions (touches, mouse clicks or keyboard keys) for all buttons on all supported Zwift devices
|
||||
- now shows the battery level of the connected devices
|
||||
- add more troubleshooting information
|
||||
|
||||
### 1.1.10 (2025-04-03)
|
||||
- Add more troubleshooting during connection
|
||||
|
||||
### 1.1.8 (2025-04-02)
|
||||
- Android: make sure the touch reassignment page is fullscreen
|
||||
|
||||
### 1.1.7 (2025-04-01)
|
||||
- Zwift Ride: fix connection issues by connecting only to the left controller
|
||||
- Windows: connect sequentially to fix (finally?) fix connection issues
|
||||
- Windows: change the way keyboard is simulated, should fix glitches
|
||||
|
||||
### 1.1.6 (2025-03-31)
|
||||
- Zwift Ride: add buttonPowerDown to shift gears
|
||||
- Zwift Play: Fix buttonShift assignment
|
||||
- Android: fix action to go to next song
|
||||
- App now checks if you run the latest available version
|
||||
|
||||
### 1.1.5 (2025-03-30)
|
||||
- fix bluetooth connection #6, also add missing entitlement on macOS
|
||||
|
||||
### 1.1.3 (2025-03-30)
|
||||
- Windows: fix custom keyboard profile recreation after restart, also warn when choosing MyWhoosh profile (may fix #7)
|
||||
- Zwift Ride: button map adjustments to prevent double shifting
|
||||
- potential fix for #6
|
||||
|
||||
### 1.1.1 (2025-03-30)
|
||||
- potential fix for Bluetooth device detection
|
||||
|
||||
### 1.1.0 (2025-03-30)
|
||||
- Windows & macOS: allow setting custom keymap and store the setting
|
||||
- Android: allow customizing the touch area, so it can work with any device without guesswork where the buttons are (#4)
|
||||
- Zwift Ride: update Zwift Ride decoding based on Feedback from @JayyajGH (#3)
|
||||
|
||||
### 1.0.6 (2025-03-29)
|
||||
- Another potential keyboard fix for Windows
|
||||
- Zwift Play: actually also use the dedicated shift buttons
|
||||
|
||||
### 1.0.5 (2025-03-29)
|
||||
- Zwift Ride: remap the shifter buttons to the correct values
|
||||
|
||||
### 1.0.0+4 (2025-03-29)
|
||||
- Zwift Ride: attempt to fix button parsing
|
||||
- Android: fix missing permissions
|
||||
- Windows: potential fix for key press issues
|
||||
|
||||
### 1.0.0+3 (2025-03-29)
|
||||
|
||||
- Windows: fix connection by using a different Bluetooth stack (issue #1)
|
||||
- Android: fix non-working touch propagation (issue #2)
|
||||
71
README.md
@@ -4,7 +4,12 @@
|
||||
|
||||
## Description
|
||||
|
||||
With SwiftControl you can control your favorite trainer app using your Zwift Click, Zwift Ride or Zwift Play devices. Primarily useful to perform virtual gear shifting.
|
||||
With SwiftControl you can **control your favorite trainer app** using your Zwift Click, Zwift Ride or Zwift Play devices. Here's what you can do with it, depending on your configuration:
|
||||
- Virtual Gear shifting
|
||||
- Steering / turning
|
||||
- adjust workout intensity
|
||||
- control music on your device
|
||||
- more? If you can do it via keyboard, mouse or touch, you can do it with SwiftControl
|
||||
|
||||
|
||||
https://github.com/user-attachments/assets/1f81b674-1628-4763-ad66-5f3ed7a3f159
|
||||
@@ -13,36 +18,66 @@ https://github.com/user-attachments/assets/1f81b674-1628-4763-ad66-5f3ed7a3f159
|
||||
|
||||
|
||||
## Downloads
|
||||
Get the latest version here: https://github.com/jonasbark/swiftcontrol/releases
|
||||
Check the compatibility matrix below!
|
||||
|
||||
<a href="https://play.google.com/store/apps/details?id=de.jonasbark.swiftcontrol"><img width="270" height="80" alt="GetItOnGooglePlay_Badge_Web_color_English" src="https://github.com/user-attachments/assets/a059d5a1-2efb-4f65-8117-ef6a99823b21" /></a>
|
||||
<a href="https://apps.apple.com/us/app/swiftcontrol/id6753721284?platform=iphone"><img width="270" height="80" alt="App Store" src="https://github.com/user-attachments/assets/c23f977a-48f6-4951-811e-ae530dbfa014" /></a>
|
||||
<a href="https://apps.apple.com/us/app/swiftcontrol/id6753721284?platform=mac"><img width="270" height="80" alt="Mac App Store" src="https://github.com/user-attachments/assets/b3552436-409c-43b0-ba7d-b6a72ae30ff1" /></a>
|
||||
|
||||
|
||||
Get the latest version for Windows here: https://github.com/jonasbark/swiftcontrol/releases
|
||||
|
||||
## Supported Apps
|
||||
- MyWhoosh
|
||||
- indieVelo / Training Peaks
|
||||
- let me know if you know others that can benefit
|
||||
- TrainingPeaks Virtual / indieVelo
|
||||
- Biketerra.com (they do offer native integration already - check it out)
|
||||
- Rouvy (most Zwift devices are already supported by Rouvy)
|
||||
- any other! You can add custom mapping and adjust touch points or keyboard shortcuts to your liking
|
||||
|
||||
## Supported Devices
|
||||
- Zwift Click
|
||||
- Zwift Click v2 (mostly, see issue #68)
|
||||
- Zwift Ride
|
||||
- Zwift Play
|
||||
- Elite Square Smart Frame (beta)
|
||||
- Wahoo Kickr Bike Shift (beta)
|
||||
|
||||
## Supported Platforms
|
||||
- Android
|
||||
- macOS
|
||||
- Windows
|
||||
- [Web](https://jonasbark.github.io/swiftcontrol/) (you won't be able to do much)
|
||||
|
||||
| Platform you want to run your Trainer app, e.g. MyWhoosh on | Possible | Link | Information |
|
||||
|-------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Android | ✅ | <a href="https://play.google.com/store/apps/details?id=de.jonasbark.swiftcontrol"><img width="270" height="80" alt="GetItOnGooglePlay_Badge_Web_color_English" src="https://github.com/user-attachments/assets/a059d5a1-2efb-4f65-8117-ef6a99823b21" /></a> | |
|
||||
| iPad (and possibly Apple TV) | ✅ | <a href="https://apps.apple.com/us/app/swiftcontrol/id6753721284?platform=iphone"><img width="270" height="80" alt="App Store" src="https://github.com/user-attachments/assets/c23f977a-48f6-4951-811e-ae530dbfa014" /></a> | You will need to use SwiftControl as a "remote" to control the trainer app on your iPad. Typically you would use an iPhone or an Android phone for that. |
|
||||
| Windows | ✅ | [Get it here](https://github.com/jonasbark/swiftcontrol/releases) | - Windows may flag the app as virus. It likely does so because the app controls the mouse and keyboard.<br>- Bluetooth connection unstable? You may need to use an [external Bluetooth adapter](https://github.com/jonasbark/swiftcontrol/issues/14#issuecomment-3193839509).<br>- Make sure your Zwift device is not paired with Windows Bluetooth settings: [more information](https://github.com/jonasbark/swiftcontrol/issues/70). |
|
||||
| macOS | ✅ | <a href="https://apps.apple.com/us/app/swiftcontrol/id6753721284?platform=mac"><img width="270" height="80" alt="Mac App Store" src="https://github.com/user-attachments/assets/b3552436-409c-43b0-ba7d-b6a72ae30ff1" /></a> | |
|
||||
| iPhone | ❌ | | Note that you can't run SwiftControl and your trainer app on the same iPhone due to iOS limitations, but you can use it to remotely control MyWhoosh and similar on e.g. an iPad. |
|
||||
|
||||
|
||||
For testing purposes you can also run it on [Web](https://jonasbark.github.io/swiftcontrol/) but this is just a tech demo - you won't be able to control other apps.
|
||||
|
||||
## Troubleshooting
|
||||
Check the troubleshooting guide [here](TROUBLESHOOTING.md).
|
||||
|
||||
## How does it work?
|
||||
The app connects to your Zwift device automatically.
|
||||
The app connects to your Zwift devices automatically. It does not connect to your trainer itself.
|
||||
|
||||
- When using Android a "click" on a certain part of the screen is simulated to trigger the action.
|
||||
- When using macOS or Windows a keyboard click is used to trigger the action. Typically + and - keys are used to shift gears, while MyWhoosh uses K and I keys.
|
||||
- **Android**: SwiftControl uses the AccessibilityService API to simulate touch gestures on specific parts of your screen to trigger actions in training apps. The service monitors which training app window is currently active to ensure gestures are sent to the correct app.
|
||||
- **iOS**: use SwiftControl as "remote control" for other devices, such as an iPad. Example scenario:
|
||||
- your phone (Android/iOS) runs SwiftControl and connects to your Zwift devices
|
||||
- your iPad or other tablet runs e.g. MyWhoosh (does not need to have SwiftControl installed)
|
||||
- after pairing SwiftControl to your iPad / tablet via Bluetooth your phone will send the button presses to your iPad / tablet
|
||||
- **macOS** / **Windows** a keyboard or mouse click is used to trigger the action.
|
||||
- there are predefined Keymaps for MyWhoosh, indieVelo / Training Peaks, and others
|
||||
- you can also create your own Keymaps for any other app
|
||||
- you can also use the mouse to click on a certain part of the screen, or use keyboard shortcuts
|
||||
</details>
|
||||
|
||||
## Alternatives
|
||||
- [qdomyos-zwift](https://www.qzfitness.com/) directly controls the trainer (as opposed to controlling the trainer app). This can be useful if your trainer app does not support virtual shifting.
|
||||
|
||||
## Donate
|
||||
Please consider donating to support the development of this app.
|
||||
Please consider donating to support the development of this app :)
|
||||
|
||||
[](https://paypal.me/boni)
|
||||
|
||||
## TODO
|
||||
- test Zwift Ride
|
||||
- confirm that Windows release works
|
||||
- implement more actions for Play + Ride
|
||||
- [via PayPal](https://paypal.me/boni)
|
||||
- [via Credit Card, Google Pay, Apple Pay, etc (USD)](https://donate.stripe.com/8x24gzc5c4ZE3VJdt36J201)
|
||||
- [via Credit Card, Google Pay, Apple Pay, etc (EUR)](https://donate.stripe.com/9B6aEX0muajY8bZ1Kl6J200)
|
||||
|
||||
28
TROUBLESHOOTING.md
Normal file
@@ -0,0 +1,28 @@
|
||||
## Click device cannot be found
|
||||
You may need to update the firmware in Zwift Companion app.
|
||||
|
||||
## Click device does not send any data
|
||||
You may need to update the firmware in Zwift Companion app.
|
||||
|
||||
## My Click v2 disconnects after a minute
|
||||
Check [this](https://github.com/jonasbark/swiftcontrol/issues/68) discussion.
|
||||
|
||||
To make your Click V2 work best you should connect it in the Zwift app once each day.
|
||||
If you don't do that SwiftControl will need to reconnect every minute.
|
||||
|
||||
1. Open Zwift app (not the Companion)
|
||||
2. Log in (subscription not required) and open the device connection screen
|
||||
3. Connect your Trainer, then connect the Click V2
|
||||
4. Close the Zwift app again and connect again in SwiftControl
|
||||
|
||||
## Remote control is not working - nothing happens
|
||||
- Try to unpair it from your phone / computer Bluetooth settings, then re-pair it.
|
||||
- Try restarting the pairing process in SwiftControl
|
||||
- try restarting Bluetooth on your phone and on the device you want to control
|
||||
- If your other device is an iOS device, go to Settings > Accessibility > Touch > AssistiveTouch > Pointer Devices > Devices and pair your device. Make sure AssistiveTouch is enabled.
|
||||
- it is very important that both devices (e.g. iPhone and iPad) receive the "pairing dialog" after initial connection. If you miss it, unpair and try again. It may take a few seconds for the dialog to appear. Afterwards you may need to click on "Reconnect" in SwiftControl / restart SwiftControl.
|
||||
|
||||
## Remote control only clicks on a single coordinate on my iPad
|
||||
iOS seems to be buggy here - try this in the iOS settings:
|
||||
AssistiveTouch settings > Pointer Devices > Devices > Connected Devices > iPhone (or SwiftControl iOS) > Button 1
|
||||
switch the setting to None, then back to Single-Tap and it should work again
|
||||
@@ -61,23 +61,29 @@ enum class MediaAction(val raw: Int) {
|
||||
/** Generated class from Pigeon that represents data sent in messages. */
|
||||
data class WindowEvent (
|
||||
val packageName: String,
|
||||
val windowHeight: Long,
|
||||
val windowWidth: Long
|
||||
val top: Long,
|
||||
val bottom: Long,
|
||||
val right: Long,
|
||||
val left: Long
|
||||
)
|
||||
{
|
||||
companion object {
|
||||
fun fromList(pigeonVar_list: List<Any?>): WindowEvent {
|
||||
val packageName = pigeonVar_list[0] as String
|
||||
val windowHeight = pigeonVar_list[1] as Long
|
||||
val windowWidth = pigeonVar_list[2] as Long
|
||||
return WindowEvent(packageName, windowHeight, windowWidth)
|
||||
val top = pigeonVar_list[1] as Long
|
||||
val bottom = pigeonVar_list[2] as Long
|
||||
val right = pigeonVar_list[3] as Long
|
||||
val left = pigeonVar_list[4] as Long
|
||||
return WindowEvent(packageName, top, bottom, right, left)
|
||||
}
|
||||
}
|
||||
fun toList(): List<Any?> {
|
||||
return listOf(
|
||||
packageName,
|
||||
windowHeight,
|
||||
windowWidth,
|
||||
top,
|
||||
bottom,
|
||||
right,
|
||||
left,
|
||||
)
|
||||
}
|
||||
override fun equals(other: Any?): Boolean {
|
||||
@@ -88,8 +94,10 @@ data class WindowEvent (
|
||||
return true
|
||||
}
|
||||
return packageName == other.packageName
|
||||
&& windowHeight == other.windowHeight
|
||||
&& windowWidth == other.windowWidth
|
||||
&& top == other.top
|
||||
&& bottom == other.bottom
|
||||
&& right == other.right
|
||||
&& left == other.left
|
||||
}
|
||||
|
||||
override fun hashCode(): Int = toList().hashCode()
|
||||
@@ -131,7 +139,7 @@ val AccessibilityApiPigeonMethodCodec = StandardMethodCodec(AccessibilityApiPige
|
||||
interface Accessibility {
|
||||
fun hasPermission(): Boolean
|
||||
fun openPermissions()
|
||||
fun performTouch(x: Double, y: Double)
|
||||
fun performTouch(x: Double, y: Double, isKeyDown: Boolean, isKeyUp: Boolean)
|
||||
fun controlMedia(action: MediaAction)
|
||||
|
||||
companion object {
|
||||
@@ -181,8 +189,10 @@ interface Accessibility {
|
||||
val args = message as List<Any?>
|
||||
val xArg = args[0] as Double
|
||||
val yArg = args[1] as Double
|
||||
val isKeyDownArg = args[2] as Boolean
|
||||
val isKeyUpArg = args[3] as Boolean
|
||||
val wrapped: List<Any?> = try {
|
||||
api.performTouch(xArg, yArg)
|
||||
api.performTouch(xArg, yArg, isKeyDownArg, isKeyUpArg)
|
||||
listOf(null)
|
||||
} catch (exception: Throwable) {
|
||||
wrapError(exception)
|
||||
|
||||
@@ -7,18 +7,16 @@ import StreamEventsStreamHandler
|
||||
import WindowEvent
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
import io.flutter.embedding.engine.plugins.FlutterPlugin
|
||||
import io.flutter.plugin.common.MethodCall
|
||||
import io.flutter.plugin.common.MethodChannel
|
||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
||||
import io.flutter.plugin.common.MethodChannel.Result
|
||||
|
||||
|
||||
/** AccessibilityPlugin */
|
||||
class AccessibilityPlugin: FlutterPlugin, MethodCallHandler, Accessibility {
|
||||
class AccessibilityPlugin: FlutterPlugin, Accessibility {
|
||||
/// The MethodChannel that will the communication between Flutter and native Android
|
||||
///
|
||||
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
|
||||
@@ -38,14 +36,6 @@ class AccessibilityPlugin: FlutterPlugin, MethodCallHandler, Accessibility {
|
||||
Observable.fromService = eventHandler
|
||||
}
|
||||
|
||||
override fun onMethodCall(call: MethodCall, result: Result) {
|
||||
if (call.method == "getPlatformVersion") {
|
||||
result.success("Android ${android.os.Build.VERSION.RELEASE}")
|
||||
} else {
|
||||
result.notImplemented()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
|
||||
channel.setMethodCallHandler(null)
|
||||
}
|
||||
@@ -61,20 +51,27 @@ class AccessibilityPlugin: FlutterPlugin, MethodCallHandler, Accessibility {
|
||||
}, Bundle.EMPTY)
|
||||
}
|
||||
|
||||
override fun performTouch(x: Double, y: Double) {
|
||||
Observable.toService?.performTouch(x = x, y = y) ?: error("Service not running")
|
||||
override fun performTouch(x: Double, y: Double, isKeyDown: Boolean, isKeyUp: Boolean) {
|
||||
Observable.toService?.performTouch(x = x, y = y, isKeyUp = isKeyUp, isKeyDown = isKeyDown) ?: error("Service not running")
|
||||
}
|
||||
|
||||
override fun controlMedia(action: MediaAction) {
|
||||
val audioService = context.getSystemService(Context.AUDIO_SERVICE) as android.media.AudioManager
|
||||
when (action) {
|
||||
MediaAction.PLAY_PAUSE -> {
|
||||
audioService.dispatchMediaKeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_DOWN, android.view.KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE))
|
||||
audioService.dispatchMediaKeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_UP, android.view.KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE))
|
||||
audioService.dispatchMediaKeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_DOWN, android.view.KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE))
|
||||
audioService.dispatchMediaKeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_UP, android.view.KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE))
|
||||
}
|
||||
MediaAction.NEXT -> {
|
||||
audioService.dispatchMediaKeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_DOWN, android.view.KeyEvent.KEYCODE_MEDIA_NEXT))
|
||||
audioService.dispatchMediaKeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_UP, android.view.KeyEvent.KEYCODE_MEDIA_NEXT))
|
||||
}
|
||||
MediaAction.VOLUME_DOWN -> {
|
||||
audioService.adjustVolume(android.media.AudioManager.ADJUST_LOWER, android.media.AudioManager.FLAG_SHOW_UI)
|
||||
}
|
||||
MediaAction.VOLUME_UP -> {
|
||||
audioService.adjustVolume(android.media.AudioManager.ADJUST_RAISE, android.media.AudioManager.FLAG_SHOW_UI)
|
||||
}
|
||||
MediaAction.NEXT -> audioService.dispatchMediaKeyEvent(android.view.KeyEvent(android.view.KeyEvent.ACTION_DOWN, android.view.KeyEvent.KEYCODE_MEDIA_NEXT))
|
||||
MediaAction.VOLUME_DOWN -> audioService.adjustVolume(android.media.AudioManager.ADJUST_LOWER, android.media.AudioManager.FLAG_SHOW_UI)
|
||||
MediaAction.VOLUME_UP -> audioService.adjustVolume(android.media.AudioManager.ADJUST_RAISE, android.media.AudioManager.FLAG_SHOW_UI)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,8 +89,8 @@ class EventListener : StreamEventsStreamHandler(), Receiver {
|
||||
eventSink = null
|
||||
}
|
||||
|
||||
override fun onChange(packageName: String, windowWidth: Int, windowHeight: Int) {
|
||||
eventSink?.success(WindowEvent(packageName = packageName, windowWidth = windowWidth.toLong(), windowHeight = windowHeight.toLong()))
|
||||
override fun onChange(packageName: String, window: Rect) {
|
||||
eventSink?.success(WindowEvent(packageName = packageName, right = window.right.toLong(), left = window.left.toLong(), bottom = window.bottom.toLong(), top = window.top.toLong()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,11 +5,9 @@ import android.accessibilityservice.GestureDescription
|
||||
import android.accessibilityservice.GestureDescription.StrokeDescription
|
||||
import android.graphics.Path
|
||||
import android.graphics.Rect
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import android.view.ViewConfiguration
|
||||
import android.view.accessibility.AccessibilityEvent
|
||||
import android.view.accessibility.AccessibilityEvent.CONTENT_CHANGE_TYPE_PANE_DISAPPEARED
|
||||
import android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
|
||||
|
||||
|
||||
@@ -26,46 +24,41 @@ class AccessibilityService : AccessibilityService(), Listener {
|
||||
Observable.toService = null
|
||||
}
|
||||
|
||||
private val ignorePackages = listOf("com.android.systemui", "com.android.launcher", "com.android.settings")
|
||||
|
||||
override fun onAccessibilityEvent(event: AccessibilityEvent) {
|
||||
if (event.packageName == null || rootInActiveWindow == null) {
|
||||
return
|
||||
}
|
||||
if (event.contentChangeTypes == CONTENT_CHANGE_TYPE_PANE_DISAPPEARED) {
|
||||
if (event.eventType != TYPE_WINDOW_STATE_CHANGED || event.packageName in ignorePackages) {
|
||||
// we're not interested
|
||||
return
|
||||
}
|
||||
val currentPackageName = event.packageName.toString()
|
||||
val windowSize = getWindowSize()
|
||||
Observable.fromService?.onChange(packageName = currentPackageName, windowHeight = windowSize.bottom, windowWidth = windowSize.right)
|
||||
Observable.fromService?.onChange(packageName = currentPackageName, window = windowSize)
|
||||
}
|
||||
|
||||
private fun getWindowSize(): Rect {
|
||||
val outBounds = Rect()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||
rootInActiveWindow.getBoundsInWindow(outBounds)
|
||||
} else {
|
||||
rootInActiveWindow.getBoundsInScreen(outBounds)
|
||||
}
|
||||
rootInActiveWindow?.getBoundsInScreen(outBounds)
|
||||
return outBounds
|
||||
}
|
||||
|
||||
private fun simulateTap(x: Double, y: Double) {
|
||||
val gestureBuilder = GestureDescription.Builder()
|
||||
val path = Path()
|
||||
path.moveTo(x.toFloat(), y.toFloat())
|
||||
path.lineTo(x.toFloat()+1, y.toFloat())
|
||||
|
||||
val stroke = StrokeDescription(path, 0, ViewConfiguration.getTapTimeout().toLong())
|
||||
gestureBuilder.addStroke(stroke)
|
||||
|
||||
dispatchGesture(gestureBuilder.build(), null, null)
|
||||
}
|
||||
|
||||
override fun onInterrupt() {
|
||||
Log.d("AccessibilityService", "Service Interrupted")
|
||||
}
|
||||
|
||||
override fun performTouch(x: Double, y: Double) {
|
||||
simulateTap(x, y)
|
||||
override fun performTouch(x: Double, y: Double, isKeyDown: Boolean, isKeyUp: Boolean) {
|
||||
val gestureBuilder = GestureDescription.Builder()
|
||||
val path = Path()
|
||||
path.moveTo(x.toFloat(), y.toFloat())
|
||||
path.lineTo(x.toFloat()+1, y.toFloat())
|
||||
|
||||
val stroke = StrokeDescription(path, 0, ViewConfiguration.getTapTimeout().toLong(), isKeyDown && !isKeyUp)
|
||||
gestureBuilder.addStroke(stroke)
|
||||
|
||||
dispatchGesture(gestureBuilder.build(), null, null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package de.jonasbark.accessibility
|
||||
|
||||
import android.graphics.Rect
|
||||
|
||||
object Observable {
|
||||
var toService: Listener? = null
|
||||
var fromService: Receiver? = null
|
||||
}
|
||||
|
||||
interface Listener {
|
||||
fun performTouch(x: Double, y: Double)
|
||||
fun performTouch(x: Double, y: Double, isKeyDown: Boolean, isKeyUp: Boolean)
|
||||
}
|
||||
|
||||
interface Receiver {
|
||||
fun onChange(packageName: String, windowWidth: Int, windowHeight: Int)
|
||||
}
|
||||
fun onChange(packageName: String, window: Rect)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ abstract class Accessibility {
|
||||
|
||||
void openPermissions();
|
||||
|
||||
void performTouch(double x, double y);
|
||||
void performTouch(double x, double y, {bool isKeyDown = true, bool isKeyUp = false});
|
||||
|
||||
void controlMedia(MediaAction action);
|
||||
}
|
||||
@@ -15,10 +15,18 @@ enum MediaAction { playPause, next, volumeUp, volumeDown }
|
||||
|
||||
class WindowEvent {
|
||||
final String packageName;
|
||||
final int windowHeight;
|
||||
final int windowWidth;
|
||||
final int top;
|
||||
final int bottom;
|
||||
final int right;
|
||||
final int left;
|
||||
|
||||
WindowEvent({required this.packageName, required this.windowHeight, required this.windowWidth});
|
||||
WindowEvent({
|
||||
required this.packageName,
|
||||
required this.left,
|
||||
required this.right,
|
||||
required this.top,
|
||||
required this.bottom,
|
||||
});
|
||||
}
|
||||
|
||||
@EventChannelApi()
|
||||
|
||||
@@ -25,21 +25,29 @@ enum MediaAction {
|
||||
class WindowEvent {
|
||||
WindowEvent({
|
||||
required this.packageName,
|
||||
required this.windowHeight,
|
||||
required this.windowWidth,
|
||||
required this.top,
|
||||
required this.bottom,
|
||||
required this.right,
|
||||
required this.left,
|
||||
});
|
||||
|
||||
String packageName;
|
||||
|
||||
int windowHeight;
|
||||
int top;
|
||||
|
||||
int windowWidth;
|
||||
int bottom;
|
||||
|
||||
int right;
|
||||
|
||||
int left;
|
||||
|
||||
List<Object?> _toList() {
|
||||
return <Object?>[
|
||||
packageName,
|
||||
windowHeight,
|
||||
windowWidth,
|
||||
top,
|
||||
bottom,
|
||||
right,
|
||||
left,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -50,8 +58,10 @@ class WindowEvent {
|
||||
result as List<Object?>;
|
||||
return WindowEvent(
|
||||
packageName: result[0]! as String,
|
||||
windowHeight: result[1]! as int,
|
||||
windowWidth: result[2]! as int,
|
||||
top: result[1]! as int,
|
||||
bottom: result[2]! as int,
|
||||
right: result[3]! as int,
|
||||
left: result[4]! as int,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -66,8 +76,10 @@ class WindowEvent {
|
||||
}
|
||||
return
|
||||
packageName == other.packageName
|
||||
&& windowHeight == other.windowHeight
|
||||
&& windowWidth == other.windowWidth;
|
||||
&& top == other.top
|
||||
&& bottom == other.bottom
|
||||
&& right == other.right
|
||||
&& left == other.left;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -175,14 +187,14 @@ class Accessibility {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> performTouch(double x, double y) async {
|
||||
Future<void> performTouch(double x, double y, {bool isKeyDown = true, bool isKeyUp = false, }) async {
|
||||
final String pigeonVar_channelName = 'dev.flutter.pigeon.accessibility.Accessibility.performTouch$pigeonVar_messageChannelSuffix';
|
||||
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
|
||||
pigeonVar_channelName,
|
||||
pigeonChannelCodec,
|
||||
binaryMessenger: pigeonVar_binaryMessenger,
|
||||
);
|
||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[x, y]);
|
||||
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[x, y, isKeyDown, isKeyUp]);
|
||||
final List<Object?>? pigeonVar_replyList =
|
||||
await pigeonVar_sendFuture as List<Object?>?;
|
||||
if (pigeonVar_replyList == null) {
|
||||
|
||||
@@ -23,6 +23,10 @@ linter:
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
- require_trailing_commas
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
formatter:
|
||||
page_width: 120
|
||||
trailing_commas: preserve
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import java.io.FileInputStream
|
||||
import java.util.*
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
@@ -5,8 +8,13 @@ plugins {
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
|
||||
val keystorePropertiesFile = rootProject.file("keystore.properties")
|
||||
val keystoreProperties = Properties()
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
|
||||
android {
|
||||
namespace = "de.jonasbark.swift_play"
|
||||
namespace = "de.jonasbark.swiftcontrol"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = "27.0.12077973"
|
||||
|
||||
@@ -24,7 +32,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "de.jonasbark.swift_play"
|
||||
applicationId = "de.jonasbark.swiftcontrol"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
minSdk = 24
|
||||
@@ -33,11 +41,18 @@ android {
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("config") {
|
||||
keyAlias = keystoreProperties["keyAlias"] as String
|
||||
keyPassword = keystoreProperties["keyPassword"] as String
|
||||
storeFile = file("../${keystoreProperties["storeFile"] as String}")
|
||||
storePassword = keystoreProperties["storePassword"] as String
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
signingConfig = signingConfigs.getByName("config")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Allow Bluetooth -->
|
||||
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
|
||||
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE"/>
|
||||
|
||||
<!-- New Bluetooth permissions in Android 12
|
||||
https://developer.android.com/about/versions/12/features/bluetooth-permissions -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
|
||||
@@ -16,9 +18,12 @@
|
||||
|
||||
|
||||
<!-- legacy for Android 9 or lower -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28" tools:replace="android:maxSdkVersion" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||
|
||||
<!-- to check if you have the latest version -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:label="SwiftControl"
|
||||
android:name="${applicationName}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package de.jonasbark.swift_play
|
||||
package de.jonasbark.swiftcontrol
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
@@ -18,8 +18,8 @@ pluginManagement {
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.7.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
|
||||
id("com.android.application") version "8.7.3" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: Create a report to help us improve
|
||||
title: "fix: "
|
||||
labels: bug
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Steps To Reproduce**
|
||||
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected Behavior**
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional Context**
|
||||
|
||||
Add any other context about the problem here.
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Build System
|
||||
about: Changes that affect the build system or external dependencies
|
||||
title: "build: "
|
||||
labels: build
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Describe what changes need to be done to the build system and why.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] The build system is passing
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Chore
|
||||
about: Other changes that don't modify src or test files
|
||||
title: "chore: "
|
||||
labels: chore
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Clearly describe what change is needed and why. If this changes code then please use another issue type.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] No functional changes to the code
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Continuous Integration
|
||||
about: Changes to the CI configuration files and scripts
|
||||
title: "ci: "
|
||||
labels: ci
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Describe what changes need to be done to the ci/cd system and why.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] The ci system is passing
|
||||
@@ -1 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Documentation
|
||||
about: Improve the documentation so all collaborators have a common understanding
|
||||
title: "docs: "
|
||||
labels: documentation
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Clearly describe what documentation you are looking to add or improve.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] Requirements go here
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: A new feature to be added to the project
|
||||
title: "feat: "
|
||||
labels: feature
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Clearly describe what you are looking to add. The more context the better.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] Checklist of requirements to be fulfilled
|
||||
|
||||
**Additional Context**
|
||||
|
||||
Add any other context or screenshots about the feature request go here.
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Performance Update
|
||||
about: A code change that improves performance
|
||||
title: "perf: "
|
||||
labels: performance
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Clearly describe what code needs to be changed and what the performance impact is going to be. Bonus point's if you can tie this directly to user experience.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] There is no drop in test coverage.
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Refactor
|
||||
about: A code change that neither fixes a bug nor adds a feature
|
||||
title: "refactor: "
|
||||
labels: refactor
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Clearly describe what needs to be refactored and why. Please provide links to related issues (bugs or upcoming features) in order to help prioritize.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] There is no drop in test coverage.
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
name: Revert Commit
|
||||
about: Reverts a previous commit
|
||||
title: "revert: "
|
||||
labels: revert
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Provide a link to a PR/Commit that you are looking to revert and why.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] Change has been reverted
|
||||
- [ ] No change in test coverage has happened
|
||||
- [ ] A new ticket is created for any follow on work that needs to happen
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Style Changes
|
||||
about: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc)
|
||||
title: "style: "
|
||||
labels: style
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
Clearly describe what you are looking to change and why.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] There is no drop in test coverage.
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
name: Test
|
||||
about: Adding missing tests or correcting existing tests
|
||||
title: "test: "
|
||||
labels: test
|
||||
---
|
||||
|
||||
**Description**
|
||||
|
||||
List out the tests that need to be added or changed. Please also include any information as to why this was not covered in the past.
|
||||
|
||||
**Requirements**
|
||||
|
||||
- [ ] There is no drop in test coverage.
|
||||
@@ -1,27 +0,0 @@
|
||||
<!--
|
||||
Thanks for contributing!
|
||||
|
||||
Provide a description of your changes below and a general summary in the title
|
||||
|
||||
Please look at the following checklist to ensure that your PR can be accepted quickly:
|
||||
-->
|
||||
|
||||
## Status
|
||||
|
||||
**READY/IN DEVELOPMENT/HOLD**
|
||||
|
||||
## Description
|
||||
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Type of Change
|
||||
|
||||
<!--- Put an `x` in all the boxes that apply: -->
|
||||
|
||||
- [ ] ✨ New feature (non-breaking change which adds functionality)
|
||||
- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
|
||||
- [ ] 🧹 Code refactor
|
||||
- [ ] ✅ Build configuration change
|
||||
- [ ] 📝 Documentation
|
||||
- [ ] 🗑️ Chore
|
||||
21
flutter_blue_plus_windows/.github/cspell.json
vendored
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"version": "0.2",
|
||||
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
|
||||
"dictionaries": ["vgv_allowed", "vgv_forbidden"],
|
||||
"dictionaryDefinitions": [
|
||||
{
|
||||
"name": "vgv_allowed",
|
||||
"path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/allowed.txt",
|
||||
"description": "Allowed VGV Spellings"
|
||||
},
|
||||
{
|
||||
"name": "vgv_forbidden",
|
||||
"path": "https://raw.githubusercontent.com/verygoodopensource/very_good_dictionaries/main/forbidden.txt",
|
||||
"description": "Forbidden VGV Spellings"
|
||||
}
|
||||
],
|
||||
"useGitignore": true,
|
||||
"words": [
|
||||
"flutter_blue_plus_windows"
|
||||
]
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
version: 2
|
||||
enable-beta-ecosystems: true
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "pub"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
12
flutter_blue_plus_windows/.gitignore
vendored
@@ -1,12 +0,0 @@
|
||||
# See https://www.dartlang.org/guides/libraries/private-files
|
||||
|
||||
# Files and directories created by pub
|
||||
.dart_tool/
|
||||
.packages
|
||||
build/
|
||||
pubspec.lock
|
||||
/.idea/
|
||||
/.flutter-plugins
|
||||
/.flutter-plugins-dependencies
|
||||
|
||||
interanl_example
|
||||
@@ -1,106 +0,0 @@
|
||||
## 1.26.1
|
||||
* Add setOptions.
|
||||
|
||||
## 1.26.0
|
||||
* Set `flutter_blue_plus` upperbound <1.35.0 (due to api changes)
|
||||
|
||||
## 1.25.0
|
||||
* Ensure tracing connection when reconnection occurs after force disconnection.
|
||||
|
||||
## 1.24.22
|
||||
* Upgrade FBP version to `>=1.32.4 <=1.40.0` #24.
|
||||
|
||||
## 1.24.21
|
||||
* fix: startScan() doesn't return correct ScanResult #25
|
||||
|
||||
## 1.24.20
|
||||
* Downgrade FBP version to `>=1.32.4 <=1.33.6` due to the breaking changes.
|
||||
* After upgrade process, the dependencies will be returned to `>=1.34.4 <1.40.0` #24.
|
||||
|
||||
## 1.24.19
|
||||
* Fix a bug with `onValueReceived` of emitting write packet #22.
|
||||
|
||||
## 1.24.18
|
||||
* Add implementation of `BluetoothDeviceWindow.fromId()` #21.
|
||||
|
||||
## 1.24.15
|
||||
* Fix a bug w.r.t. company ID in manufacturer data. (@betto-a #18)
|
||||
|
||||
## 1.24.14
|
||||
* Implement cancelOnDisconnect (@jefflongo #16)
|
||||
|
||||
## 1.24.12
|
||||
* Fix minor bug w.r.t. `characteristic.isNotifying`.
|
||||
|
||||
## 1.24.11
|
||||
* Fix breaking changes of FBP w.r.t. `systemDevices(List withServices)`.
|
||||
|
||||
## 1.24.10
|
||||
* Add support for `cancelWhenScanComplete`
|
||||
|
||||
## 1.24.9
|
||||
* Implement scan filter (including `withServices`, `withRemoteIds`, `withNames`).
|
||||
|
||||
## 1.24.8
|
||||
* Keep manufacturer data when scanning.
|
||||
|
||||
## 1.24.7
|
||||
* Keep service uuids when scanning.
|
||||
|
||||
## 1.24.0
|
||||
* Update `README.md`.
|
||||
|
||||
## 1.23.6
|
||||
* Add unimplemented notification for `read` or `write`.
|
||||
|
||||
## 1.14.0
|
||||
* Remove dependencies `ffi` and `win32` to avoid compile error for web
|
||||
|
||||
## 1.9.5
|
||||
* Apply `flutter blue plus` to `1.28.13`.
|
||||
|
||||
## 1.9.0
|
||||
* Apply a breaking changes `Guid` in `Flutter blue plus` packages.
|
||||
* Use `uuid128` instead of `toString()`.
|
||||
|
||||
## 1.8.10
|
||||
* Fix `Guid` bug related with `Flutter blue plus` packages.
|
||||
|
||||
## 1.8.0
|
||||
* Fix bug with Guid converted from string due to starting/ending with '{ }' in `WinBLE`
|
||||
|
||||
## 1.7.0
|
||||
* Apply `flutter blue plus 1.28.5` (there is several breaking changes.).
|
||||
|
||||
## 1.6.6
|
||||
* Add cache for storing characteristics.
|
||||
|
||||
## 1.6.0
|
||||
* Apply `Flutter blue plus 1.26.0`, (there is a breaking change with `connect()`).
|
||||
|
||||
## 1.5.7
|
||||
* Remove connection by OS when performing `startScan`.
|
||||
|
||||
## 1.5.3
|
||||
* Write logs when connection state stream is started/terminated.
|
||||
|
||||
## 1.5.2
|
||||
* Fix a bug of features added in `1.5.1`
|
||||
|
||||
## 1.5.1
|
||||
* Remove device from connected device list when device is disconnected.
|
||||
|
||||
## 1.5.0
|
||||
* Split functionality of `disconnect` / `removeBond`.
|
||||
|
||||
## 1.4.0
|
||||
* Implement `Subscribe/Unsubscribe Characteristic`.
|
||||
|
||||
## 1.1.0
|
||||
* Implement `Read/Write Characteristic`.
|
||||
|
||||
## 1.0.5
|
||||
* Change `rxdart` version to `0.27.7`.
|
||||
|
||||
## 1.0.0
|
||||
* Initial release (using Github action).
|
||||
@@ -1,7 +0,0 @@
|
||||
Copyright 2023 Himchan Park
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,54 +0,0 @@
|
||||
[](https://pub.dartlang.org/packages/flutter_blue_plus_windows)
|
||||
|
||||
## Flutter Blue Plus Windows
|
||||
|
||||
This project is a wrapper library for `Flutter Blue Plus` and `Win_ble`.
|
||||
It allows `Flutter_blue_plus` to operate on Windows.
|
||||
|
||||
With minimal effort, you can use Flutter Blue Plus on Windows.
|
||||
|
||||
## Usage
|
||||
Only you need to do is change the import statement.
|
||||
|
||||
```dart
|
||||
// instead of import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';
|
||||
|
||||
// Alternatively, you can hide FlutterBluePlus when importing the FBP statement
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart' hide FlutterBluePlus;
|
||||
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';
|
||||
|
||||
```
|
||||
|
||||
### Scan devices
|
||||
```dart
|
||||
final scannedDevices = <ScanResult>{};
|
||||
|
||||
const timeout = Duration(seconds: 3);
|
||||
FlutterBluePlus.startScan(timeout: timeout);
|
||||
|
||||
final sub = FlutterBluePlus.scanResults.expand((e)=>e).listen(scannedDevices.add);
|
||||
|
||||
await Future.delayed(timeout);
|
||||
sub.cancel();
|
||||
scannedDevices.forEach(print);
|
||||
```
|
||||
|
||||
### Connect a device
|
||||
```dart
|
||||
final scannedDevice = scannedDevices
|
||||
.where((scanResult) => scanResult.device.platformName == DEVICE_NAME)
|
||||
.firstOrNull;
|
||||
final device = scannedDevice?.device;
|
||||
device?.connect();
|
||||
```
|
||||
|
||||
### Disconnect the device
|
||||
```dart
|
||||
device?.disconnect();
|
||||
```
|
||||
|
||||
Check out the usage of Flutter Blue Plus on [Flutter Blue Plus](https://pub.dev/packages/flutter_blue_plus)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
library flutter_blue_plus_windows;
|
||||
|
||||
export 'package:flutter_blue_plus/flutter_blue_plus.dart' hide FlutterBluePlus;
|
||||
export 'package:win_ble/win_ble.dart';
|
||||
export 'package:win_ble/win_file.dart';
|
||||
|
||||
export 'src/flutter_blue_plus_windows.dart';
|
||||
@@ -1,19 +0,0 @@
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:win_ble/win_ble.dart';
|
||||
|
||||
extension BluetoothAdapterStateExtension on BleState {
|
||||
BluetoothAdapterState toAdapterState() {
|
||||
switch(this){
|
||||
case BleState.On:
|
||||
return BluetoothAdapterState.on;
|
||||
case BleState.Off:
|
||||
return BluetoothAdapterState.off;
|
||||
case BleState.Unknown:
|
||||
return BluetoothAdapterState.unknown;
|
||||
case BleState.Disabled:
|
||||
return BluetoothAdapterState.unavailable;
|
||||
case BleState.Unsupported:
|
||||
return BluetoothAdapterState.unauthorized;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
|
||||
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';
|
||||
|
||||
extension BluetoothCharacteristicExtension on BluetoothCharacteristic {
|
||||
BmBluetoothCharacteristic toProto() {
|
||||
return BmBluetoothCharacteristic(
|
||||
remoteId: DeviceIdentifier(remoteId.str),
|
||||
serviceUuid: serviceUuid,
|
||||
characteristicUuid: characteristicUuid,
|
||||
descriptors: [for (final d in descriptors) d.toProto()],
|
||||
properties: properties.toProto(),
|
||||
primaryServiceUuid: null, // TODO: API changes
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
|
||||
|
||||
extension BluetoothDescriptorExtension on BluetoothDescriptor {
|
||||
BmBluetoothDescriptor toProto() {
|
||||
return BmBluetoothDescriptor(
|
||||
remoteId: DeviceIdentifier(remoteId.str),
|
||||
serviceUuid: serviceUuid,
|
||||
characteristicUuid: characteristicUuid,
|
||||
descriptorUuid: descriptorUuid,
|
||||
primaryServiceUuid: null, // TODO: API changes
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
|
||||
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';
|
||||
|
||||
extension BluetoothServiceExtension on BluetoothService {
|
||||
BmBluetoothService toProto() {
|
||||
return BmBluetoothService(
|
||||
serviceUuid: serviceUuid,
|
||||
remoteId: DeviceIdentifier(remoteId.str),
|
||||
characteristics: [for (final c in characteristics) c.toProto()],
|
||||
primaryServiceUuid: null, // TODO: API changes
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
|
||||
|
||||
extension CharacteristicPropertiesExtension on CharacteristicProperties {
|
||||
BmCharacteristicProperties toProto() {
|
||||
return BmCharacteristicProperties(
|
||||
broadcast: broadcast,
|
||||
read: read,
|
||||
writeWithoutResponse: writeWithoutResponse,
|
||||
write: write,
|
||||
notify: notify,
|
||||
indicate: indicate,
|
||||
authenticatedSignedWrites: authenticatedSignedWrites,
|
||||
extendedProperties: extendedProperties,
|
||||
notifyEncryptionRequired: notifyEncryptionRequired,
|
||||
indicateEncryptionRequired: indicateEncryptionRequired,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
export 'bluetooth_adapter_state_extension.dart';
|
||||
export 'bluetooth_characteristic_extension.dart';
|
||||
export 'bluetooth_descriptor_extension.dart';
|
||||
export 'bluetooth_service_extension.dart';
|
||||
export 'characteristic_properties_extension.dart';
|
||||
@@ -1,3 +0,0 @@
|
||||
export 'extension/extension.dart';
|
||||
export 'windows/windows.dart';
|
||||
export 'wrapper/wrapper.dart';
|
||||
@@ -1,160 +0,0 @@
|
||||
part of 'windows.dart';
|
||||
|
||||
class BluetoothCharacteristicWindows extends BluetoothCharacteristic {
|
||||
final DeviceIdentifier remoteId;
|
||||
final Guid serviceUuid;
|
||||
final Guid? secondaryServiceUuid;
|
||||
final Guid characteristicUuid;
|
||||
final List<BluetoothDescriptor> descriptors;
|
||||
|
||||
final Properties propertiesWinBle;
|
||||
|
||||
BluetoothCharacteristicWindows({
|
||||
required this.remoteId,
|
||||
required this.serviceUuid,
|
||||
required this.characteristicUuid,
|
||||
required this.descriptors,
|
||||
required this.propertiesWinBle,
|
||||
this.secondaryServiceUuid,
|
||||
}) : super.fromProto(
|
||||
BmBluetoothCharacteristic(
|
||||
remoteId: DeviceIdentifier(remoteId.str),
|
||||
serviceUuid: serviceUuid,
|
||||
characteristicUuid: characteristicUuid,
|
||||
descriptors: [
|
||||
for (final descriptor in descriptors)
|
||||
BmBluetoothDescriptor(
|
||||
remoteId: DeviceIdentifier(descriptor.remoteId.str),
|
||||
serviceUuid: descriptor.serviceUuid,
|
||||
characteristicUuid: descriptor.characteristicUuid,
|
||||
descriptorUuid: descriptor.uuid,
|
||||
primaryServiceUuid: null, // TODO: API changes
|
||||
),
|
||||
],
|
||||
properties: BmCharacteristicProperties(
|
||||
broadcast: propertiesWinBle.broadcast ?? false,
|
||||
read: propertiesWinBle.read ?? false,
|
||||
writeWithoutResponse: propertiesWinBle.writeWithoutResponse ?? false,
|
||||
write: propertiesWinBle.write ?? false,
|
||||
notify: propertiesWinBle.notify ?? false,
|
||||
indicate: propertiesWinBle.indicate ?? false,
|
||||
authenticatedSignedWrites: propertiesWinBle.authenticatedSignedWrites ?? false,
|
||||
// TODO: implementation missing
|
||||
extendedProperties: false,
|
||||
// TODO: implementation missing
|
||||
notifyEncryptionRequired: false,
|
||||
// TODO: implementation missing
|
||||
indicateEncryptionRequired: false,
|
||||
),
|
||||
primaryServiceUuid: null, // TODO: API changes
|
||||
),
|
||||
);
|
||||
|
||||
String get _address => remoteId.str.toLowerCase();
|
||||
|
||||
String get _key => "$serviceUuid:$characteristicUuid";
|
||||
|
||||
FBP.BluetoothDevice get device =>
|
||||
FlutterBluePlusWindows.connectedDevices.firstWhere((device) => device.remoteId == remoteId);
|
||||
|
||||
/// this variable is updated:
|
||||
/// - anytime `read()` is called
|
||||
/// - anytime `write()` is called
|
||||
/// - anytime a notification arrives (if subscribed)
|
||||
List<int> get lastValue => FlutterBluePlusWindows._lastChrs[remoteId]?[_key] ?? [];
|
||||
|
||||
/// this stream emits values:
|
||||
/// - anytime `read()` is called
|
||||
/// - anytime `write()` is called
|
||||
/// - anytime a notification arrives (if subscribed)
|
||||
/// - and when first listened to, it re-emits the last value for convenience
|
||||
Stream<List<int>> get lastValueStream => _mergeStreams(
|
||||
[
|
||||
WinBle.characteristicValueStreamOf(
|
||||
address: _address,
|
||||
serviceId: serviceUuid.str128,
|
||||
characteristicId: characteristicUuid.str128,
|
||||
),
|
||||
FlutterBluePlusWindows._charReadWriteStream.where((e) => e.$1 == _key).map((e) => e.$2)
|
||||
],
|
||||
).map((p) => <int>[...p]).newStreamWithInitialValue(lastValue).asBroadcastStream();
|
||||
|
||||
/// this stream emits values:
|
||||
/// - anytime `read()` is called
|
||||
/// - anytime a notification arrives (if subscribed)
|
||||
Stream<List<int>> get onValueReceived => _mergeStreams(
|
||||
[
|
||||
WinBle.characteristicValueStreamOf(
|
||||
address: _address,
|
||||
serviceId: serviceUuid.str128,
|
||||
characteristicId: characteristicUuid.str128,
|
||||
),
|
||||
FlutterBluePlusWindows._charReadStream.where((e) => e.$1 == _key).map((e) => e.$2)
|
||||
],
|
||||
).map((p) => <int>[...p]).asBroadcastStream();
|
||||
|
||||
// TODO: need to verify
|
||||
bool get isNotifying => FlutterBluePlusWindows._isNotifying[remoteId]?[_key] ?? false;
|
||||
|
||||
Future<List<int>> read({int timeout = 15}) async {
|
||||
final value = await WinBle.read(
|
||||
address: _address,
|
||||
serviceId: serviceUuid.str128,
|
||||
characteristicId: characteristicUuid.str128,
|
||||
);
|
||||
FlutterBluePlusWindows._charReadWriteStreamController.add((_key, value));
|
||||
FlutterBluePlusWindows._charReadStreamController.add((_key, value));
|
||||
FlutterBluePlusWindows._lastChrs[remoteId] ??= {};
|
||||
FlutterBluePlusWindows._lastChrs[remoteId]?[_key] = value;
|
||||
return value;
|
||||
}
|
||||
|
||||
Future<void> write(List<int> value,
|
||||
{bool allowLongWrite = false, bool withoutResponse = false, int timeout = 15}) async {
|
||||
await WinBle.write(
|
||||
address: _address,
|
||||
service: serviceUuid.str128,
|
||||
characteristic: characteristicUuid.str128,
|
||||
data: Uint8List.fromList(value),
|
||||
writeWithResponse: !withoutResponse, // propertiesWinBle.writeWithoutResponse ?? false,
|
||||
);
|
||||
FlutterBluePlusWindows._charReadWriteStreamController.add((_key, value));
|
||||
FlutterBluePlusWindows._lastChrs[remoteId] ??= {};
|
||||
FlutterBluePlusWindows._lastChrs[remoteId]?[_key] = value;
|
||||
}
|
||||
|
||||
// TODO: need to verify
|
||||
Future<bool> setNotifyValue(
|
||||
bool notify, {
|
||||
int timeout = 15, // TODO: missing implementation
|
||||
bool forceIndications = false, // TODO: missing implementation
|
||||
}) async {
|
||||
/// unSubscribeFromCharacteristic
|
||||
try {
|
||||
await WinBle.unSubscribeFromCharacteristic(
|
||||
address: _address,
|
||||
serviceId: serviceUuid.str128,
|
||||
characteristicId: characteristicUuid.str128,
|
||||
);
|
||||
} catch (e) {
|
||||
log('WinBle.unSubscribeFromCharacteristic was performed '
|
||||
'before setNotifyValue()');
|
||||
}
|
||||
|
||||
/// set notify
|
||||
try {
|
||||
if (notify) {
|
||||
await WinBle.subscribeToCharacteristic(
|
||||
address: _address,
|
||||
serviceId: serviceUuid.str128,
|
||||
characteristicId: characteristicUuid.str128,
|
||||
);
|
||||
}
|
||||
FlutterBluePlusWindows._isNotifying[remoteId] ??= {};
|
||||
FlutterBluePlusWindows._isNotifying[remoteId]?[_key] = notify;
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,310 +0,0 @@
|
||||
// Bluetooth Device Page:
|
||||
// https://github.com/boskokg/flutter_blue_plus/blob/master/lib/src/bluetooth_device.dart
|
||||
|
||||
part of 'windows.dart';
|
||||
|
||||
class BluetoothDeviceWindows extends FBP.BluetoothDevice {
|
||||
BluetoothDeviceWindows({required super.remoteId});
|
||||
|
||||
// used for 'servicesStream' public api
|
||||
final _services = StreamController<List<BluetoothServiceWindows>>.broadcast();
|
||||
|
||||
// used for 'isDiscoveringServices' public api
|
||||
final _isDiscoveringServices = _StreamController(initialValue: false);
|
||||
|
||||
String get _address => remoteId.str.toLowerCase();
|
||||
|
||||
/// Create a device from an id
|
||||
/// - to connect, this device must have been discovered by your app in a previous scan
|
||||
/// - iOS uses 128-bit uuids the remoteId, e.g. e006b3a7-ef7b-4980-a668-1f8005f84383
|
||||
/// - Android uses 48-bit mac addresses as the remoteId, e.g. 06:E5:28:3B:FD:E0
|
||||
static FBP.BluetoothDevice fromId(String remoteId) {
|
||||
if (Platform.isWindows) {
|
||||
return BluetoothDeviceWindows(remoteId: DeviceIdentifier(remoteId.toUpperCase()));
|
||||
}
|
||||
return FBP.BluetoothDevice.fromId(remoteId);
|
||||
}
|
||||
|
||||
/// platform name
|
||||
/// - this name is kept track of by the platform
|
||||
/// - this name usually persist between app restarts
|
||||
/// - iOS: after you connect, iOS uses the GAP name characteristic (0x2A00)
|
||||
/// if it exists. Otherwise iOS use the advertised name.
|
||||
/// - Android: always uses the advertised name
|
||||
String get platformName => FlutterBluePlusWindows._platformNames[remoteId] ?? "";
|
||||
|
||||
/// Advertised Named
|
||||
/// - this is the name advertised by the device during scanning
|
||||
/// - it is only available after you scan with FlutterBluePlus
|
||||
/// - it is cleared when the app restarts.
|
||||
/// - not all devices advertise a name
|
||||
String get advName => FlutterBluePlusWindows._advNames[remoteId] ?? "";
|
||||
|
||||
// stream return whether or not we are currently discovering services
|
||||
@Deprecated("planed for removal (Jan 2024). It can be easily implemented yourself") // deprecated on Aug 2023
|
||||
Stream<bool> get isDiscoveringServices => _isDiscoveringServices.stream;
|
||||
|
||||
/// Get services
|
||||
/// - returns empty if discoverServices() has not been called
|
||||
/// or if your device does not have any services (rare)
|
||||
List<BluetoothServiceWindows> get servicesList => FlutterBluePlusWindows._knownServices[remoteId] ?? [];
|
||||
|
||||
/// Stream of bluetooth services offered by the remote device
|
||||
/// - this stream is only updated when you call discoverServices()
|
||||
@Deprecated("planed for removal (Jan 2024). It can be easily implemented yourself") // deprecated on Aug 2023
|
||||
Stream<List<BluetoothService>> get servicesStream {
|
||||
if (FlutterBluePlusWindows._knownServices[remoteId] != null) {
|
||||
return _services.stream.newStreamWithInitialValue(
|
||||
FlutterBluePlusWindows._knownServices[remoteId]!,
|
||||
);
|
||||
} else {
|
||||
return _services.stream;
|
||||
}
|
||||
}
|
||||
|
||||
/// Register a subscription to be canceled when the device is disconnected.
|
||||
/// This function simplifies cleanup, so you can prevent creating duplicate stream subscriptions.
|
||||
/// - this is an optional convenience function
|
||||
/// - prevents accidentally creating duplicate subscriptions on each reconnection.
|
||||
/// - [next] if true, the the stream will be canceled only on the *next* disconnection.
|
||||
/// This is useful if you setup your subscriptions before you connect.
|
||||
/// - [delayed] Note: This option is only meant for `connectionState` subscriptions.
|
||||
/// When `true`, we cancel after a small delay. This ensures the `connectionState`
|
||||
/// listener receives the `disconnected` event.
|
||||
void cancelWhenDisconnected(StreamSubscription subscription, {bool next = false, bool delayed = false}) {
|
||||
if (isConnected == false && next == false) {
|
||||
subscription.cancel(); // cancel immediately if already disconnected.
|
||||
} else if (delayed) {
|
||||
FlutterBluePlusWindows._delayedSubscriptions[remoteId] ??= [];
|
||||
FlutterBluePlusWindows._delayedSubscriptions[remoteId]!.add(subscription);
|
||||
} else {
|
||||
FlutterBluePlusWindows._deviceSubscriptions[remoteId] ??= [];
|
||||
FlutterBluePlusWindows._deviceSubscriptions[remoteId]!.add(subscription);
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if this device is currently connected to your app
|
||||
bool get isConnected {
|
||||
return FlutterBluePlusWindows.connectedDevices.contains(this);
|
||||
}
|
||||
|
||||
/// Returns true if this device is currently disconnected from your app
|
||||
bool get isDisconnected => isConnected == false;
|
||||
|
||||
Future<void> connect({
|
||||
Duration? timeout = const Duration(seconds: 35), // TODO: implementation missing
|
||||
bool autoConnect = false, // TODO: implementation missing
|
||||
int? mtu = 512, // TODO: implementation missing
|
||||
}) async {
|
||||
try {
|
||||
await WinBle.connect(_address);
|
||||
FlutterBluePlusWindows._deviceSet.add(this);
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> disconnect({
|
||||
int androidDelay = 2000, // TODO: implementation missing
|
||||
int timeout = 35, // TODO: implementation missing
|
||||
bool queue = true, // TODO: implementation missing
|
||||
}) async {
|
||||
try {
|
||||
await WinBle.disconnect(_address);
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
} finally {
|
||||
FlutterBluePlusWindows._deviceSet.remove(this);
|
||||
|
||||
FlutterBluePlusWindows._deviceSubscriptions[remoteId]?.forEach((s) => s.cancel());
|
||||
FlutterBluePlusWindows._deviceSubscriptions.remove(remoteId);
|
||||
// use delayed to update the stream before we cancel it
|
||||
Future.delayed(Duration.zero).then((_) {
|
||||
FlutterBluePlusWindows._delayedSubscriptions[remoteId]?.forEach((s) => s.cancel());
|
||||
FlutterBluePlusWindows._delayedSubscriptions.remove(remoteId);
|
||||
});
|
||||
|
||||
FlutterBluePlusWindows._lastChrs[remoteId]?.clear();
|
||||
FlutterBluePlusWindows._isNotifying[remoteId]?.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<BluetoothService>> discoverServices({
|
||||
bool subscribeToServicesChanged = true, // TODO: implementation missing
|
||||
int timeout = 15, // TODO: implementation missing
|
||||
}) async {
|
||||
List<BluetoothServiceWindows> result = List.from(FlutterBluePlusWindows._knownServices[remoteId] ?? []);
|
||||
|
||||
try {
|
||||
_isDiscoveringServices.add(true);
|
||||
|
||||
final response = await WinBle.discoverServices(_address);
|
||||
FlutterBluePlusWindows._characteristicCache[remoteId] ??= <String, List<BluetoothCharacteristic>>{};
|
||||
|
||||
for (final serviceId in response) {
|
||||
final characteristic = await WinBle.discoverCharacteristics(
|
||||
address: _address,
|
||||
serviceId: serviceId,
|
||||
);
|
||||
FlutterBluePlusWindows._characteristicCache[remoteId] ??= {};
|
||||
FlutterBluePlusWindows._characteristicCache[remoteId]?[serviceId] ??= [
|
||||
...characteristic.map(
|
||||
(e) => BluetoothCharacteristicWindows(
|
||||
remoteId: remoteId,
|
||||
serviceUuid: Guid(serviceId),
|
||||
characteristicUuid: Guid(e.uuid),
|
||||
descriptors: [],
|
||||
// TODO: implementation missing
|
||||
propertiesWinBle: e.properties,
|
||||
),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
result = [
|
||||
...response.map(
|
||||
(p) => BluetoothServiceWindows(
|
||||
remoteId: remoteId,
|
||||
serviceUuid: Guid(p),
|
||||
// TODO: implementation missing
|
||||
isPrimary: true,
|
||||
// TODO: implementation missing
|
||||
characteristics: FlutterBluePlusWindows._characteristicCache[remoteId]![p]!,
|
||||
// TODO: implementation missing
|
||||
includedServices: [],
|
||||
),
|
||||
)
|
||||
];
|
||||
|
||||
FlutterBluePlusWindows._knownServices[remoteId] = result;
|
||||
|
||||
_services.add(result);
|
||||
} finally {
|
||||
_isDiscoveringServices.add(false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
DisconnectReason? get disconnectReason {
|
||||
// TODO: nothing to do
|
||||
return null;
|
||||
}
|
||||
|
||||
Stream<BluetoothConnectionState> get connectionState async* {
|
||||
await FlutterBluePlusWindows._initialize();
|
||||
|
||||
final map = FlutterBluePlusWindows._connectionStream.latestValue;
|
||||
|
||||
if (map[_address] != null) {
|
||||
yield map[_address]!.isConnected;
|
||||
}
|
||||
|
||||
yield* WinBle.connectionStreamOf(_address).map((e) => e.isConnected);
|
||||
}
|
||||
|
||||
Stream<int> get mtu async* {
|
||||
bool isEmitted = false;
|
||||
int retryCount = 0;
|
||||
while (!isEmitted) {
|
||||
if (retryCount > 3) throw "Device not found!";
|
||||
retryCount++;
|
||||
try {
|
||||
yield await WinBle.getMaxMtuSize(_address);
|
||||
isEmitted = true;
|
||||
} catch (e) {
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
log(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<int> readRssi({int timeout = 15}) async {
|
||||
return FlutterBluePlusWindows._rssiMap[remoteId] ?? -100;
|
||||
}
|
||||
|
||||
Future<int> requestMtu(
|
||||
int desiredMtu, {
|
||||
double predelay = 0.35,
|
||||
int timeout = 15,
|
||||
}) async {
|
||||
// https://github.com/rohitsangwan01/win_ble/issues/8
|
||||
return await WinBle.getMaxMtuSize(_address);
|
||||
}
|
||||
|
||||
Future<void> requestConnectionPriority({
|
||||
required ConnectionPriority connectionPriorityRequest,
|
||||
}) async {
|
||||
// TODO: nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
/// Set the preferred connection (Android Only)
|
||||
/// - [txPhy] bitwise OR of all allowed phys for Tx, e.g. (Phy.le2m.mask | Phy.leCoded.mask)
|
||||
/// - [txPhy] bitwise OR of all allowed phys for Rx, e.g. (Phy.le2m.mask | Phy.leCoded.mask)
|
||||
/// - [option] preferred coding to use when transmitting on Phy.leCoded
|
||||
/// Please note that this is just a recommendation given to the system.
|
||||
Future<void> setPreferredPhy({
|
||||
required int txPhy,
|
||||
required int rxPhy,
|
||||
required PhyCoding option,
|
||||
}) async {
|
||||
// TODO: implementation missing
|
||||
}
|
||||
|
||||
Future<void> createBond({
|
||||
Uint8List? pin,
|
||||
int timeout = 90, // TODO: implementation missing
|
||||
}) async {
|
||||
try {
|
||||
await WinBle.pair(_address);
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> removeBond({
|
||||
int timeout = 30, // TODO: implementation missing
|
||||
}) async {
|
||||
try {
|
||||
await WinBle.unPair(_address);
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> clearGattCache() async {
|
||||
// TODO: implementation missing
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
(other is BluetoothDeviceWindows && runtimeType == other.runtimeType && remoteId == other.remoteId);
|
||||
|
||||
@override
|
||||
int get hashCode => remoteId.hashCode;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BluetoothDevice{'
|
||||
'remoteId: $remoteId, '
|
||||
'platformName: $platformName, '
|
||||
'services: ${FlutterBluePlusWindows._knownServices[remoteId]}'
|
||||
'}';
|
||||
}
|
||||
|
||||
@Deprecated('Use createBond() instead')
|
||||
Future<void> pair() async => await createBond();
|
||||
|
||||
@Deprecated('Use remoteId instead')
|
||||
DeviceIdentifier get id => remoteId;
|
||||
|
||||
@Deprecated('Use localName instead')
|
||||
String get name => localName;
|
||||
|
||||
@Deprecated('Use connectionState instead')
|
||||
Stream<BluetoothConnectionState> get state => connectionState;
|
||||
|
||||
@Deprecated('Use servicesStream instead')
|
||||
Stream<List<BluetoothService>> get services => servicesStream;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
part of 'windows.dart';
|
||||
|
||||
class BluetoothServiceWindows extends BluetoothService {
|
||||
final DeviceIdentifier remoteId;
|
||||
final Guid serviceUuid;
|
||||
final bool isPrimary;
|
||||
final List<BluetoothCharacteristic> characteristics;
|
||||
final List<BluetoothService> includedServices;
|
||||
|
||||
BluetoothServiceWindows({
|
||||
required this.remoteId,
|
||||
required this.serviceUuid,
|
||||
required this.isPrimary,
|
||||
required this.characteristics,
|
||||
required this.includedServices,
|
||||
}) : super.fromProto(
|
||||
BmBluetoothService(
|
||||
remoteId: DeviceIdentifier(remoteId.str),
|
||||
serviceUuid: serviceUuid,
|
||||
characteristics: [for (final c in characteristics) c.toProto()],
|
||||
primaryServiceUuid: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,353 +0,0 @@
|
||||
part of 'windows.dart';
|
||||
|
||||
class FlutterBluePlusWindows {
|
||||
static bool _initialized = false;
|
||||
|
||||
static BluetoothAdapterState _state = BluetoothAdapterState.unknown;
|
||||
|
||||
// stream used for the isScanning public api
|
||||
static final _isScanning = _StreamController(initialValue: false);
|
||||
|
||||
// we always keep track of these device variables
|
||||
static final _platformNames = <DeviceIdentifier, String>{};
|
||||
static final _advNames = <DeviceIdentifier, String>{};
|
||||
static final _rssiMap = <DeviceIdentifier, int?>{};
|
||||
static final _knownServices = <DeviceIdentifier, List<BluetoothServiceWindows>>{};
|
||||
static final Map<DeviceIdentifier, Map<String, List<int>>> _lastChrs = {};
|
||||
static final Map<DeviceIdentifier, Map<String, bool>> _isNotifying = {};
|
||||
static final Map<DeviceIdentifier, Map<String, List<BluetoothCharacteristic>>> _characteristicCache = {};
|
||||
static final Map<DeviceIdentifier, List<StreamSubscription>> _deviceSubscriptions = {};
|
||||
static final Map<DeviceIdentifier, List<StreamSubscription>> _delayedSubscriptions = {};
|
||||
static final List<StreamSubscription> _scanSubscriptions = [];
|
||||
|
||||
// stream used for the scanResults public api
|
||||
static final _scanResultsList = _StreamController(initialValue: <ScanResult>[]);
|
||||
|
||||
// the subscription to the scan results stream
|
||||
static StreamSubscription<BleDevice?>? _scanSubscription;
|
||||
|
||||
// timeout for scanning that can be cancelled by stopScan
|
||||
static Timer? _scanTimeout;
|
||||
|
||||
static List<BluetoothDeviceWindows> get _devices => [..._deviceSet];
|
||||
|
||||
static final _deviceSet = <BluetoothDeviceWindows>{};
|
||||
static final _removedDeviceTracer = <BluetoothDeviceWindows, StreamSubscription>{};
|
||||
|
||||
// static final _unhandledDeviceSet = <BluetoothDeviceWindows>{};
|
||||
|
||||
/// Flutter blue plus windows
|
||||
static final _charReadWriteStreamController = StreamController<(String, List<int>)>();
|
||||
static final _charReadStreamController = StreamController<(String, List<int>)>();
|
||||
|
||||
static final _charReadWriteStream = _charReadWriteStreamController.stream.asBroadcastStream();
|
||||
static final _charReadStream = _charReadStreamController.stream.asBroadcastStream();
|
||||
|
||||
/// Flutter blue plus windows
|
||||
static final _connectionStream = _StreamController(initialValue: <String, bool>{});
|
||||
|
||||
static Future<void> _initialize() async {
|
||||
if (_initialized) return;
|
||||
await WinBle.initialize(
|
||||
serverPath: await WinServer.path(),
|
||||
enableLog: false,
|
||||
);
|
||||
|
||||
WinBle.connectionStream.listen(
|
||||
(event) {
|
||||
log('$event - event');
|
||||
if (event['device'] == null) return;
|
||||
if (event['connected'] == null) return;
|
||||
|
||||
final map = _connectionStream.latestValue;
|
||||
map[event['device']] = event['connected'];
|
||||
|
||||
log('$map - map');
|
||||
_connectionStream.add(map);
|
||||
|
||||
if (!event['connected']) {
|
||||
final removingDevices = [
|
||||
..._deviceSet.where(
|
||||
(device) => device._address == event['device'],
|
||||
),
|
||||
];
|
||||
for (final device in removingDevices) {
|
||||
_deviceSet.remove(device);
|
||||
if (!_removedDeviceTracer.keys.contains(device)) {
|
||||
_removedDeviceTracer[device] = Stream.periodic(const Duration(seconds: 10), (_) => device).listen(
|
||||
(event) {
|
||||
if(event.isConnected) {
|
||||
_removedDeviceTracer[device]?.cancel();
|
||||
_removedDeviceTracer.remove(device);
|
||||
return;
|
||||
}
|
||||
event.connect();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
_deviceSubscriptions[device.remoteId]?.forEach((s) => s.cancel());
|
||||
_deviceSubscriptions.remove(device.remoteId);
|
||||
// use delayed to update the stream before we cancel it
|
||||
Future.delayed(Duration.zero).then((_) {
|
||||
_delayedSubscriptions[device.remoteId]?.forEach((s) => s.cancel());
|
||||
_delayedSubscriptions.remove(device.remoteId);
|
||||
});
|
||||
|
||||
_lastChrs[device.remoteId]?.clear();
|
||||
_isNotifying[device.remoteId]?.clear();
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
static Future<bool> get isSupported async {
|
||||
return true;
|
||||
}
|
||||
|
||||
static Future<String> get adapterName async {
|
||||
return 'Windows';
|
||||
}
|
||||
|
||||
static Stream<bool> get isScanning => _isScanning.stream;
|
||||
|
||||
static bool get isScanningNow => _isScanning.latestValue;
|
||||
|
||||
static Future<void> turnOn({int timeout = 10}) async {
|
||||
await _initialize();
|
||||
await WinBle.updateBluetoothState(true);
|
||||
}
|
||||
|
||||
// TODO: compare with original lib
|
||||
static Stream<List<ScanResult>> get scanResults => _scanResultsList.stream;
|
||||
|
||||
static Stream<BluetoothAdapterState> get adapterState async* {
|
||||
await _initialize();
|
||||
yield _state;
|
||||
yield* WinBle.bleState.asBroadcastStream().map(
|
||||
(s) {
|
||||
_state = s.toAdapterState();
|
||||
return _state;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// Start a scan, and return a stream of results
|
||||
/// Note: scan filters use an "or" behavior. i.e. if you set `withServices` & `withNames` we
|
||||
/// return all the advertisments that match any of the specified services *or* any of the specified names.
|
||||
/// - [withServices] filter by advertised services
|
||||
/// - [withRemoteIds] filter for known remoteIds (iOS: 128-bit guid, android: 48-bit mac address)
|
||||
/// - [withNames] filter by advertised names (exact match)
|
||||
/// - [withKeywords] filter by advertised names (matches any substring)
|
||||
/// - [withMsd] filter by manfacture specific data
|
||||
/// - [withServiceData] filter by service data
|
||||
/// - [timeout] calls stopScan after a specified duration
|
||||
/// - [removeIfGone] if true, remove devices after they've stopped advertising for X duration
|
||||
/// - [continuousUpdates] If `true`, we continually update 'lastSeen' & 'rssi' by processing
|
||||
/// duplicate advertisements. This takes more power. You typically should not use this option.
|
||||
/// - [continuousDivisor] Useful to help performance. If divisor is 3, then two-thirds of advertisements are
|
||||
/// ignored, and one-third are processed. This reduces main-thread usage caused by the platform channel.
|
||||
/// The scan counting is per-device so you always get the 1st advertisement from each device.
|
||||
/// If divisor is 1, all advertisements are returned. This argument only matters for `continuousUpdates` mode.
|
||||
/// - [oneByOne] if `true`, we will stream every advertistment one by one, possibly including duplicates.
|
||||
/// If `false`, we deduplicate the advertisements, and return a list of devices.
|
||||
/// - [androidLegacy] Android only. If `true`, scan on 1M phy only.
|
||||
/// If `false`, scan on all supported phys. How the radio cycles through all the supported phys is purely
|
||||
/// dependent on the your Bluetooth stack implementation.
|
||||
/// - [androidScanMode] choose the android scan mode to use when scanning
|
||||
/// - [androidUsesFineLocation] request `ACCESS_FINE_LOCATION` permission at runtime
|
||||
static Future<void> startScan({
|
||||
List<Guid> withServices = const [],
|
||||
List<String> withRemoteIds = const [],
|
||||
List<String> withNames = const [],
|
||||
//TODO: implementation missing
|
||||
List<String> withKeywords = const [],
|
||||
//TODO: implementation missing
|
||||
List<MsdFilter> withMsd = const [],
|
||||
List<ServiceDataFilter> withServiceData = const [],
|
||||
Duration? timeout,
|
||||
Duration? removeIfGone,
|
||||
bool continuousUpdates = false,
|
||||
int continuousDivisor = 1,
|
||||
bool oneByOne = false,
|
||||
bool androidLegacy = false,
|
||||
AndroidScanMode androidScanMode = AndroidScanMode.lowLatency,
|
||||
bool androidUsesFineLocation = false,
|
||||
}) async {
|
||||
await _initialize();
|
||||
|
||||
// stop existing scan
|
||||
if (_isScanning.latestValue == true) {
|
||||
await stopScan();
|
||||
}
|
||||
|
||||
// push to stream
|
||||
_isScanning.add(true);
|
||||
|
||||
// Start timer *after* stream is being listened to, to make sure the
|
||||
// timeout does not fire before _buffer is set
|
||||
if (timeout != null) {
|
||||
_scanTimeout = Timer(timeout, stopScan);
|
||||
}
|
||||
|
||||
/// remove connection by OS.
|
||||
/// The reason why we add this logic is
|
||||
/// to avoid uncontrollable devices and to make consistency.
|
||||
|
||||
/// add WinBle scanning
|
||||
WinBle.startScanning();
|
||||
|
||||
// check every 250ms for gone devices?
|
||||
late Stream<BleDevice?> outputStream;
|
||||
if (removeIfGone != null) {
|
||||
outputStream = _mergeStreams([WinBle.scanStream, Stream.periodic(Duration(milliseconds: 250))]);
|
||||
} else {
|
||||
outputStream = WinBle.scanStream;
|
||||
}
|
||||
|
||||
final output = <ScanResult>[];
|
||||
|
||||
// listen & push to `scanResults` stream
|
||||
_scanSubscription = outputStream.listen(
|
||||
(BleDevice? winBleDevice) {
|
||||
// print(winBleDevice?.serviceUuids);
|
||||
if (winBleDevice == null) {
|
||||
// if null, this is just a periodic update for removing old results
|
||||
output.removeWhere((elm) => DateTime.now().difference(elm.timeStamp) > removeIfGone!);
|
||||
|
||||
// push to stream
|
||||
_scanResultsList.add(List.from(output));
|
||||
} else {
|
||||
final remoteId = DeviceIdentifier(winBleDevice.address.toUpperCase());
|
||||
final scanResult = output.where((sr) => sr.device.remoteId == remoteId).firstOrNull;
|
||||
final deviceName = winBleDevice.name.isNotEmpty ? winBleDevice.name : scanResult?.device.platformName ?? '';
|
||||
final serviceUuids = winBleDevice.serviceUuids.isNotEmpty
|
||||
? [...winBleDevice.serviceUuids.map((e) => Guid((e as String).replaceAll(RegExp(r'[{}]'), '')))]
|
||||
: scanResult?.advertisementData.serviceUuids ?? [];
|
||||
|
||||
final manufacturerData = winBleDevice.manufacturerData.isNotEmpty
|
||||
? {
|
||||
if (winBleDevice.manufacturerData.length >= 2)
|
||||
winBleDevice.manufacturerData[0] + (winBleDevice.manufacturerData[1] << 8):
|
||||
winBleDevice.manufacturerData.sublist(2),
|
||||
}
|
||||
: scanResult?.advertisementData.manufacturerData ?? {};
|
||||
|
||||
final rssi = int.tryParse(winBleDevice.rssi) ?? -100;
|
||||
|
||||
FlutterBluePlusWindows._platformNames[remoteId] = deviceName;
|
||||
FlutterBluePlusWindows._advNames[remoteId] = deviceName;
|
||||
FlutterBluePlusWindows._rssiMap[remoteId] = rssi;
|
||||
|
||||
final device = BluetoothDeviceWindows(remoteId: remoteId);
|
||||
|
||||
String hex(int value) => value.toRadixString(16).padLeft(2, '0');
|
||||
String hexToId(Iterable<int> values) => values.map((e) => hex(e)).join();
|
||||
|
||||
final sr = ScanResult(
|
||||
device: device,
|
||||
advertisementData: AdvertisementData(
|
||||
advName: deviceName,
|
||||
txPowerLevel: winBleDevice.adStructures?.where((e) => e.type == 10).singleOrNull?.data.firstOrNull,
|
||||
//TODO: Should verify
|
||||
connectable: !winBleDevice.advType.contains('Non'),
|
||||
manufacturerData: manufacturerData,
|
||||
serviceData: {
|
||||
for (final advStructures in winBleDevice.adStructures ?? <AdStructure>[])
|
||||
if (advStructures.type == 0x16 && advStructures.data.length >= 2)
|
||||
Guid(hexToId(advStructures.data.sublist(0, 2).reversed)): advStructures.data.sublist(2),
|
||||
for (final advStructures in winBleDevice.adStructures ?? <AdStructure>[])
|
||||
if (advStructures.type == 0x20 && advStructures.data.length >= 4)
|
||||
Guid(hexToId(advStructures.data.sublist(0, 4).reversed)): advStructures.data.sublist(4),
|
||||
for (final advStructures in winBleDevice.adStructures ?? <AdStructure>[])
|
||||
if (advStructures.type == 0x21 && advStructures.data.length >= 16)
|
||||
Guid(hexToId(advStructures.data.sublist(0, 16).reversed)): advStructures.data.sublist(16),
|
||||
},
|
||||
serviceUuids: serviceUuids,
|
||||
appearance: null,
|
||||
),
|
||||
rssi: rssi,
|
||||
timeStamp: DateTime.now(),
|
||||
);
|
||||
|
||||
// filter with services
|
||||
final isFilteredWithServices =
|
||||
withServices.isNotEmpty && serviceUuids.where((service) => withServices.contains(service)).isEmpty;
|
||||
|
||||
// filter with remote ids
|
||||
final isFilteredWithRemoteIds = withRemoteIds.isNotEmpty && !withRemoteIds.contains(remoteId);
|
||||
|
||||
// filter with names
|
||||
final isFilteredWithNames = withNames.isNotEmpty && !withNames.contains(deviceName);
|
||||
|
||||
if (isFilteredWithServices || isFilteredWithRemoteIds || isFilteredWithNames) {
|
||||
_scanResultsList.add(List.from(output));
|
||||
return;
|
||||
}
|
||||
|
||||
// add result to output
|
||||
if (oneByOne) {
|
||||
output
|
||||
..clear()
|
||||
..add(sr);
|
||||
} else {
|
||||
output.addOrUpdate(sr);
|
||||
}
|
||||
|
||||
// push to stream
|
||||
_scanResultsList.add(List.from(output));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static List<FBP.BluetoothDevice> get connectedDevices {
|
||||
return _devices;
|
||||
}
|
||||
|
||||
static Future<List<BluetoothDeviceWindows>> get bondedDevices async {
|
||||
return _devices;
|
||||
}
|
||||
|
||||
/// Stops a scan for Bluetooth Low Energy devices
|
||||
static Future<void> stopScan() async {
|
||||
await _initialize();
|
||||
WinBle.stopScanning();
|
||||
_scanSubscription?.cancel();
|
||||
_scanTimeout?.cancel();
|
||||
_isScanning.add(false);
|
||||
|
||||
for (var subscription in _scanSubscriptions) {
|
||||
subscription.cancel();
|
||||
}
|
||||
|
||||
_scanResultsList.latestValue = [];
|
||||
}
|
||||
|
||||
/// Register a subscription to be canceled when scanning is complete.
|
||||
/// This function simplifies cleanup, so you can prevent creating duplicate stream subscriptions.
|
||||
/// - this is an optional convenience function
|
||||
/// - prevents accidentally creating duplicate subscriptions before each scan
|
||||
static void cancelWhenScanComplete(StreamSubscription subscription) {
|
||||
_scanSubscriptions.add(subscription);
|
||||
}
|
||||
|
||||
/// Sets the internal FlutterBlue log level
|
||||
static Future<void> setLogLevel(LogLevel level, {color = true}) async {
|
||||
// Nothing to implement
|
||||
return;
|
||||
}
|
||||
|
||||
static Future<void> turnOff({int timeout = 10}) async {
|
||||
await _initialize();
|
||||
await WinBle.updateBluetoothState(false);
|
||||
}
|
||||
|
||||
// TODO: need to test
|
||||
static Future<bool> get isOn async {
|
||||
await _initialize();
|
||||
return await WinBle.bleState.asBroadcastStream().first == BleState.On;
|
||||
}
|
||||
}
|
||||
@@ -1,433 +0,0 @@
|
||||
part of 'windows.dart';
|
||||
|
||||
String _hexEncode(List<int> numbers) {
|
||||
return numbers
|
||||
.map((n) => (n & 0xFF).toRadixString(16).padLeft(2, '0'))
|
||||
.join();
|
||||
}
|
||||
|
||||
List<int> _hexDecode(String hex) {
|
||||
List<int> numbers = [];
|
||||
for (int i = 0; i < hex.length; i += 2) {
|
||||
String hexPart = hex.substring(i, i + 2);
|
||||
int num = int.parse(hexPart, radix: 16);
|
||||
numbers.add(num);
|
||||
}
|
||||
return numbers;
|
||||
}
|
||||
|
||||
int _compareAsciiLowerCase(String a, String b) {
|
||||
const int upperCaseA = 0x41;
|
||||
const int upperCaseZ = 0x5a;
|
||||
const int asciiCaseBit = 0x20;
|
||||
var defaultResult = 0;
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
if (i >= b.length) return 1;
|
||||
var aChar = a.codeUnitAt(i);
|
||||
var bChar = b.codeUnitAt(i);
|
||||
if (aChar == bChar) continue;
|
||||
var aLowerCase = aChar;
|
||||
var bLowerCase = bChar;
|
||||
// Upper case if ASCII letters.
|
||||
if (upperCaseA <= bChar && bChar <= upperCaseZ) {
|
||||
bLowerCase += asciiCaseBit;
|
||||
}
|
||||
if (upperCaseA <= aChar && aChar <= upperCaseZ) {
|
||||
aLowerCase += asciiCaseBit;
|
||||
}
|
||||
if (aLowerCase != bLowerCase) return (aLowerCase - bLowerCase).sign;
|
||||
if (defaultResult == 0) defaultResult = aChar - bChar;
|
||||
}
|
||||
if (b.length > a.length) return -1;
|
||||
return defaultResult.sign;
|
||||
}
|
||||
|
||||
// This is a reimplementation of BehaviorSubject from RxDart library.
|
||||
// It is essentially a stream but:
|
||||
// 1. we cache the latestValue of the stream
|
||||
// 2. the "latestValue" is re-emitted whenever the stream is listened to
|
||||
class _StreamController<T> {
|
||||
T latestValue;
|
||||
|
||||
final StreamController<T> _controller = StreamController<T>.broadcast();
|
||||
|
||||
_StreamController({required T initialValue})
|
||||
: this.latestValue = initialValue;
|
||||
|
||||
Stream<T> get stream => _controller.stream;
|
||||
|
||||
T get value => latestValue;
|
||||
|
||||
void add(T newValue) {
|
||||
latestValue = newValue;
|
||||
_controller.add(newValue);
|
||||
}
|
||||
|
||||
void listen(Function(T) onData,
|
||||
{Function? onError, void Function()? onDone, bool? cancelOnError}) {
|
||||
onData(latestValue);
|
||||
_controller.stream.listen(onData,
|
||||
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
|
||||
}
|
||||
|
||||
Future<void> close() {
|
||||
return _controller.close();
|
||||
}
|
||||
}
|
||||
|
||||
// imediately starts listening to a broadcast stream and
|
||||
// buffering it in a new single-subscription stream
|
||||
class _BufferStream<T> {
|
||||
final Stream<T> _inputStream;
|
||||
late final StreamSubscription? _subscription;
|
||||
late final StreamController<T> _controller;
|
||||
late bool hasReceivedValue = false;
|
||||
|
||||
_BufferStream.listen(this._inputStream) {
|
||||
_controller = StreamController<T>(
|
||||
onCancel: () {
|
||||
_subscription?.cancel();
|
||||
},
|
||||
onPause: () {
|
||||
_subscription?.pause();
|
||||
},
|
||||
onResume: () {
|
||||
_subscription?.resume();
|
||||
},
|
||||
onListen: () {}, // inputStream is already listened to
|
||||
);
|
||||
|
||||
// immediately start listening to the inputStream
|
||||
_subscription = _inputStream.listen(
|
||||
(data) {
|
||||
hasReceivedValue = true;
|
||||
_controller.add(data);
|
||||
},
|
||||
onError: (e) {
|
||||
_controller.addError(e);
|
||||
},
|
||||
onDone: () {
|
||||
_controller.close();
|
||||
},
|
||||
cancelOnError: false,
|
||||
);
|
||||
}
|
||||
|
||||
void close() {
|
||||
_subscription?.cancel();
|
||||
_controller.close();
|
||||
}
|
||||
|
||||
Stream<T> get stream async* {
|
||||
yield* _controller.stream;
|
||||
}
|
||||
}
|
||||
|
||||
// helper for 'doOnDone' method for streams.
|
||||
class _OnDoneTransformer<T> extends StreamTransformerBase<T, T> {
|
||||
final Function onDone;
|
||||
|
||||
_OnDoneTransformer({required this.onDone});
|
||||
|
||||
@override
|
||||
Stream<T> bind(Stream<T> stream) {
|
||||
if (stream.isBroadcast) {
|
||||
return _bindBroadcast(stream);
|
||||
}
|
||||
return _bindSingleSubscription(stream);
|
||||
}
|
||||
|
||||
Stream<T> _bindSingleSubscription(Stream<T> stream) {
|
||||
StreamController<T>? controller;
|
||||
StreamSubscription<T>? subscription;
|
||||
|
||||
controller = StreamController<T>(
|
||||
onListen: () {
|
||||
subscription = stream.listen(
|
||||
controller?.add,
|
||||
onError: controller?.addError,
|
||||
onDone: () {
|
||||
onDone();
|
||||
controller?.close();
|
||||
},
|
||||
);
|
||||
},
|
||||
onPause: ([Future<dynamic>? resumeSignal]) {
|
||||
subscription?.pause(resumeSignal);
|
||||
},
|
||||
onResume: () {
|
||||
subscription?.resume();
|
||||
},
|
||||
onCancel: () {
|
||||
return subscription?.cancel();
|
||||
},
|
||||
sync: true,
|
||||
);
|
||||
|
||||
return controller.stream;
|
||||
}
|
||||
|
||||
Stream<T> _bindBroadcast(Stream<T> stream) {
|
||||
StreamController<T>? controller;
|
||||
StreamSubscription<T>? subscription;
|
||||
|
||||
controller = StreamController<T>.broadcast(
|
||||
onListen: () {
|
||||
subscription = stream
|
||||
.listen(controller?.add, onError: controller?.addError, onDone: () {
|
||||
onDone();
|
||||
controller?.close();
|
||||
});
|
||||
},
|
||||
onCancel: () {
|
||||
subscription?.cancel();
|
||||
},
|
||||
sync: true,
|
||||
);
|
||||
|
||||
return controller.stream;
|
||||
}
|
||||
}
|
||||
|
||||
// helper for 'doOnCancel' method for streams.
|
||||
class _OnCancelTransformer<T> extends StreamTransformerBase<T, T> {
|
||||
final Function onCancel;
|
||||
|
||||
_OnCancelTransformer({required this.onCancel});
|
||||
|
||||
@override
|
||||
Stream<T> bind(Stream<T> stream) {
|
||||
if (stream.isBroadcast) {
|
||||
return _bindBroadcast(stream);
|
||||
}
|
||||
|
||||
return _bindSingleSubscription(stream);
|
||||
}
|
||||
|
||||
Stream<T> _bindSingleSubscription(Stream<T> stream) {
|
||||
StreamController<T>? controller;
|
||||
StreamSubscription<T>? subscription;
|
||||
|
||||
controller = StreamController<T>(
|
||||
onListen: () {
|
||||
subscription = stream.listen(
|
||||
controller?.add,
|
||||
onError: (Object error) {
|
||||
controller?.addError(error);
|
||||
controller?.close();
|
||||
},
|
||||
onDone: controller?.close,
|
||||
);
|
||||
},
|
||||
onPause: ([Future<dynamic>? resumeSignal]) {
|
||||
subscription?.pause(resumeSignal);
|
||||
},
|
||||
onResume: () {
|
||||
subscription?.resume();
|
||||
},
|
||||
onCancel: () {
|
||||
onCancel();
|
||||
return subscription?.cancel();
|
||||
},
|
||||
sync: true,
|
||||
);
|
||||
|
||||
return controller.stream;
|
||||
}
|
||||
|
||||
Stream<T> _bindBroadcast(Stream<T> stream) {
|
||||
StreamController<T>? controller;
|
||||
StreamSubscription<T>? subscription;
|
||||
|
||||
controller = StreamController<T>.broadcast(
|
||||
onListen: () {
|
||||
subscription = stream.listen(
|
||||
controller?.add,
|
||||
onError: (Object error) {
|
||||
controller?.addError(error);
|
||||
controller?.close();
|
||||
},
|
||||
onDone: controller?.close,
|
||||
);
|
||||
},
|
||||
onCancel: () {
|
||||
onCancel();
|
||||
subscription?.cancel();
|
||||
},
|
||||
sync: true,
|
||||
);
|
||||
|
||||
return controller.stream;
|
||||
}
|
||||
}
|
||||
|
||||
// Helper for 'newStreamWithInitialValue' method for streams.
|
||||
class _NewStreamWithInitialValueTransformer<T>
|
||||
extends StreamTransformerBase<T, T> {
|
||||
final T initialValue;
|
||||
|
||||
_NewStreamWithInitialValueTransformer(this.initialValue);
|
||||
|
||||
@override
|
||||
Stream<T> bind(Stream<T> stream) {
|
||||
return _bindSingleSubscription(stream);
|
||||
}
|
||||
|
||||
Stream<T> _bindSingleSubscription(Stream<T> stream) {
|
||||
StreamController<T>? controller;
|
||||
StreamSubscription<T>? subscription;
|
||||
|
||||
controller = StreamController<T>(
|
||||
onListen: () {
|
||||
// Emit the initial value
|
||||
controller?.add(initialValue);
|
||||
|
||||
subscription = stream.listen(
|
||||
controller?.add,
|
||||
onError: (Object error) {
|
||||
controller?.addError(error);
|
||||
controller?.close();
|
||||
},
|
||||
onDone: controller?.close,
|
||||
);
|
||||
},
|
||||
onPause: ([Future<dynamic>? resumeSignal]) {
|
||||
subscription?.pause(resumeSignal);
|
||||
},
|
||||
onResume: () {
|
||||
subscription?.resume();
|
||||
},
|
||||
onCancel: () {
|
||||
return subscription?.cancel();
|
||||
},
|
||||
sync: true,
|
||||
);
|
||||
|
||||
return controller.stream;
|
||||
}
|
||||
}
|
||||
|
||||
extension _StreamDoOnDone<T> on Stream<T> {
|
||||
// ignore: unused_element
|
||||
Stream<T> doOnDone(void Function() onDone) {
|
||||
return transform(_OnDoneTransformer(onDone: onDone));
|
||||
}
|
||||
}
|
||||
|
||||
extension _StreamDoOnCancel<T> on Stream<T> {
|
||||
// ignore: unused_element
|
||||
Stream<T> doOnCancel(void Function() onCancel) {
|
||||
return transform(_OnCancelTransformer(onCancel: onCancel));
|
||||
}
|
||||
}
|
||||
|
||||
extension _StreamNewStreamWithInitialValue<T> on Stream<T> {
|
||||
Stream<T> newStreamWithInitialValue(T initialValue) {
|
||||
return transform(_NewStreamWithInitialValueTransformer(initialValue));
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: unused_element
|
||||
Stream<T> _mergeStreams<T>(List<Stream<T>> streams) {
|
||||
StreamController<T> controller = StreamController<T>();
|
||||
List<StreamSubscription<T>> subscriptions = [];
|
||||
|
||||
void handleData(T data) {
|
||||
if (!controller.isClosed) {
|
||||
controller.add(data);
|
||||
}
|
||||
}
|
||||
|
||||
void handleError(Object error, StackTrace stackTrace) {
|
||||
if (!controller.isClosed) {
|
||||
controller.addError(error, stackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
void handleDone() {
|
||||
if (subscriptions.every((s) => s.isPaused)) {
|
||||
controller.close();
|
||||
}
|
||||
}
|
||||
|
||||
void subscribeToStream(Stream<T> stream) {
|
||||
final s =
|
||||
stream.listen(handleData, onError: handleError, onDone: handleDone);
|
||||
subscriptions.add(s);
|
||||
}
|
||||
|
||||
streams.forEach(subscribeToStream);
|
||||
|
||||
controller.onCancel = () async {
|
||||
await Future.wait(subscriptions.map((s) => s.cancel()));
|
||||
};
|
||||
|
||||
return controller.stream;
|
||||
}
|
||||
|
||||
// dart is single threaded, but still has task switching.
|
||||
// this mutex lets a single task through at a time.
|
||||
class _Mutex {
|
||||
final StreamController _controller = StreamController.broadcast();
|
||||
int current = 0;
|
||||
int issued = 0;
|
||||
|
||||
Future<void> take() async {
|
||||
int mine = issued;
|
||||
issued++;
|
||||
// tasks are executed in the same order they call take()
|
||||
while (mine != current) {
|
||||
await _controller.stream.first; // wait
|
||||
}
|
||||
}
|
||||
|
||||
void give() {
|
||||
current++;
|
||||
_controller.add(null); // release waiting tasks
|
||||
}
|
||||
}
|
||||
|
||||
// Create mutexes in a parrallel-safe way,
|
||||
class _MutexFactory {
|
||||
static final _Mutex _global = _Mutex();
|
||||
static final Map<String, _Mutex> _all = {};
|
||||
|
||||
static Future<_Mutex> getMutexForKey(String key) async {
|
||||
_Mutex? value;
|
||||
await _global.take();
|
||||
{
|
||||
_all[key] ??= _Mutex();
|
||||
value = _all[key];
|
||||
}
|
||||
_global.give();
|
||||
return value!;
|
||||
}
|
||||
}
|
||||
|
||||
String _black(String s) {
|
||||
// Use ANSI escape codes
|
||||
return '\x1B[1;30m$s\x1B[0m';
|
||||
}
|
||||
|
||||
// ignore: unused_element
|
||||
String _green(String s) {
|
||||
// Use ANSI escape codes
|
||||
return '\x1B[1;32m$s\x1B[0m';
|
||||
}
|
||||
|
||||
String _magenta(String s) {
|
||||
// Use ANSI escape codes
|
||||
return '\x1B[1;35m$s\x1B[0m';
|
||||
}
|
||||
|
||||
String _brown(String s) {
|
||||
// Use ANSI escape codes
|
||||
return '\x1B[1;33m$s\x1B[0m';
|
||||
}
|
||||
|
||||
extension Boolean2ConnectionState on bool {
|
||||
BluetoothConnectionState get isConnected {
|
||||
if (this) return BluetoothConnectionState.connected;
|
||||
return BluetoothConnectionState.disconnected;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart' as FBP;
|
||||
import 'package:flutter_blue_plus_platform_interface/flutter_blue_plus_platform_interface.dart';
|
||||
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';
|
||||
|
||||
part 'bluetooth_characteristic_windows.dart';
|
||||
part 'bluetooth_device_windows.dart';
|
||||
part 'bluetooth_service_windows.dart';
|
||||
part 'flutter_blue_plus_windows.dart';
|
||||
part 'util.dart';
|
||||
@@ -1,141 +0,0 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart' as FBP;
|
||||
import 'package:flutter_blue_plus_windows/flutter_blue_plus_windows.dart';
|
||||
|
||||
class FlutterBluePlus {
|
||||
static Future<void> startScan({
|
||||
List<Guid> withServices = const [],
|
||||
List<String> withRemoteIds = const [],
|
||||
List<String> withNames = const [],
|
||||
List<String> withKeywords = const [],
|
||||
List<MsdFilter> withMsd = const [],
|
||||
List<ServiceDataFilter> withServiceData = const [],
|
||||
Duration? timeout,
|
||||
Duration? removeIfGone,
|
||||
bool continuousUpdates = false,
|
||||
int continuousDivisor = 1,
|
||||
bool oneByOne = false,
|
||||
bool androidLegacy = false,
|
||||
AndroidScanMode androidScanMode = AndroidScanMode.lowLatency,
|
||||
bool androidUsesFineLocation = false,
|
||||
List<Guid> webOptionalServices = const [],
|
||||
}) async {
|
||||
if (!kIsWeb && Platform.isWindows) {
|
||||
return await FlutterBluePlusWindows.startScan(
|
||||
withServices: withServices,
|
||||
withRemoteIds: withRemoteIds,
|
||||
withNames: withNames,
|
||||
withKeywords: withKeywords,
|
||||
withMsd: withMsd,
|
||||
withServiceData: withServiceData,
|
||||
timeout: timeout,
|
||||
removeIfGone: removeIfGone,
|
||||
continuousUpdates: continuousUpdates,
|
||||
continuousDivisor: continuousDivisor,
|
||||
oneByOne: oneByOne,
|
||||
androidLegacy: androidLegacy,
|
||||
androidScanMode: androidScanMode,
|
||||
androidUsesFineLocation: androidUsesFineLocation,
|
||||
);
|
||||
}
|
||||
|
||||
return await FBP.FlutterBluePlus.startScan(
|
||||
withServices: withServices,
|
||||
withRemoteIds: withRemoteIds,
|
||||
withNames: withNames,
|
||||
withKeywords: withKeywords,
|
||||
withMsd: withMsd,
|
||||
withServiceData: withServiceData,
|
||||
timeout: timeout,
|
||||
removeIfGone: removeIfGone,
|
||||
continuousUpdates: continuousUpdates,
|
||||
continuousDivisor: continuousDivisor,
|
||||
oneByOne: oneByOne,
|
||||
androidLegacy: androidLegacy,
|
||||
androidScanMode: androidScanMode,
|
||||
androidUsesFineLocation: androidUsesFineLocation,
|
||||
webOptionalServices: webOptionalServices,
|
||||
);
|
||||
}
|
||||
|
||||
static Stream<BluetoothAdapterState> get adapterState {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.adapterState;
|
||||
return FBP.FlutterBluePlus.adapterState;
|
||||
}
|
||||
|
||||
static Stream<List<ScanResult>> get scanResults {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.scanResults;
|
||||
return FBP.FlutterBluePlus.scanResults;
|
||||
}
|
||||
|
||||
static bool get isScanningNow {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.isScanningNow;
|
||||
return FBP.FlutterBluePlus.isScanningNow;
|
||||
}
|
||||
|
||||
static Stream<bool> get isScanning {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.isScanning;
|
||||
return FBP.FlutterBluePlus.isScanning;
|
||||
}
|
||||
|
||||
static Future<void> stopScan() async {
|
||||
if (!kIsWeb && Platform.isWindows) return await FlutterBluePlusWindows.stopScan();
|
||||
return await FBP.FlutterBluePlus.stopScan();
|
||||
}
|
||||
|
||||
static Future<void> setLogLevel(LogLevel level, {color = true}) async {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.setLogLevel(level, color: color);
|
||||
return FBP.FlutterBluePlus.setLogLevel(level, color: color);
|
||||
}
|
||||
|
||||
/// TODO: need to verify
|
||||
static LogLevel get logLevel => FBP.FlutterBluePlus.logLevel;
|
||||
|
||||
static Future<void> setOptions({bool restoreState = false, bool showPowerAlert = true}) async {
|
||||
if (!kIsWeb && Platform.isWindows) return;
|
||||
FBP.FlutterBluePlus.setOptions(restoreState: restoreState, showPowerAlert: showPowerAlert);
|
||||
}
|
||||
|
||||
static Future<bool> get isSupported async {
|
||||
if (!kIsWeb && Platform.isWindows) return await FlutterBluePlusWindows.isSupported;
|
||||
return await FBP.FlutterBluePlus.isSupported;
|
||||
}
|
||||
|
||||
static Future<String> get adapterName async {
|
||||
if (!kIsWeb && Platform.isWindows) return await FlutterBluePlusWindows.adapterName;
|
||||
return await FBP.FlutterBluePlus.adapterName;
|
||||
}
|
||||
|
||||
static Future<void> turnOn({int timeout = 60}) async {
|
||||
if (!kIsWeb && Platform.isWindows) return await FlutterBluePlusWindows.turnOn(timeout: timeout);
|
||||
return await FBP.FlutterBluePlus.turnOn(timeout: timeout);
|
||||
}
|
||||
|
||||
static List<FBP.BluetoothDevice> get connectedDevices {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.connectedDevices;
|
||||
return FBP.FlutterBluePlus.connectedDevices;
|
||||
}
|
||||
|
||||
static Future<List<FBP.BluetoothDevice>> systemDevices(List<Guid> withServices) async {
|
||||
//TODO: connected devices => system devices
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.connectedDevices;
|
||||
return await FBP.FlutterBluePlus.systemDevices(withServices);
|
||||
}
|
||||
|
||||
static Future<PhySupport> getPhySupport() {
|
||||
return FBP.FlutterBluePlus.getPhySupport();
|
||||
}
|
||||
|
||||
static Future<List<FBP.BluetoothDevice>> get bondedDevices async {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.connectedDevices;
|
||||
return await FBP.FlutterBluePlus.bondedDevices;
|
||||
}
|
||||
|
||||
static void cancelWhenScanComplete(StreamSubscription subscription) {
|
||||
if (!kIsWeb && Platform.isWindows) return FlutterBluePlusWindows.cancelWhenScanComplete(subscription);
|
||||
return FBP.FlutterBluePlus.cancelWhenScanComplete(subscription);
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export 'flutter_blue_plus_wrapper.dart';
|
||||
@@ -1,13 +0,0 @@
|
||||
name: flutter_blue_plus_windows
|
||||
description: Flutter blue plus for Windows
|
||||
version: 1.26.1
|
||||
repository: https://github.com/chan150/flutter_blue_plus_windows
|
||||
#publish_to: none
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter_blue_plus: ">=1.32.4"
|
||||
win_ble: ">=1.1.1"
|
||||
stream_with_value: ">=0.5.0"
|
||||
@@ -9,9 +9,9 @@ flutter_launcher_icons:
|
||||
# adaptive_icon_foreground: "assets/icon/foreground.png"
|
||||
# adaptive_icon_monochrome: "assets/icon/monochrome.png"
|
||||
|
||||
ios: false
|
||||
ios: true
|
||||
# image_path_ios: "assets/icon/icon.png"
|
||||
remove_alpha_channel_ios: true
|
||||
remove_alpha_ios: true
|
||||
# image_path_ios_dark_transparent: "assets/icon/icon_dark.png"
|
||||
# image_path_ios_tinted_grayscale: "assets/icon/icon_tinted.png"
|
||||
# desaturate_tinted_to_grayscale_ios: true
|
||||
|
||||
29
ios/ExportOptions.plist
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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>destination</key>
|
||||
<string>export</string>
|
||||
<key>generateAppStoreInformation</key>
|
||||
<false/>
|
||||
<key>manageAppVersionAndBuildNumber</key>
|
||||
<true/>
|
||||
<key>method</key>
|
||||
<string>app-store-connect</string>
|
||||
<key>signingStyle</key>
|
||||
<string>manual</string>
|
||||
<key>provisioningProfiles</key>
|
||||
<dict>
|
||||
<key>de.jonasbark.swiftcontrol.darwin</key>
|
||||
<string>ios app store</string>
|
||||
</dict>
|
||||
<key>stripSwiftSymbols</key>
|
||||
<true/>
|
||||
<key>teamID</key>
|
||||
<string>UZRHKPVWN9</string>
|
||||
<key>testFlightInternalTestingOnly</key>
|
||||
<false/>
|
||||
<key>uploadSymbols</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -21,6 +21,6 @@
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>12.0</string>
|
||||
<string>13.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
# platform :ios, '12.0'
|
||||
# platform :ios, '13.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
91
ios/Podfile.lock
Normal file
@@ -0,0 +1,91 @@
|
||||
PODS:
|
||||
- bluetooth_low_energy_darwin (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- device_info_plus (0.0.1):
|
||||
- Flutter
|
||||
- Flutter (1.0.0)
|
||||
- flutter_local_notifications (0.0.1):
|
||||
- Flutter
|
||||
- image_picker_ios (0.0.1):
|
||||
- Flutter
|
||||
- package_info_plus (0.4.5):
|
||||
- Flutter
|
||||
- permission_handler_apple (9.3.0):
|
||||
- Flutter
|
||||
- restart (1.0.0):
|
||||
- Flutter
|
||||
- restart_app (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- universal_ble (0.0.1):
|
||||
- Flutter
|
||||
- FlutterMacOS
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
- wakelock_plus (0.0.1):
|
||||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- bluetooth_low_energy_darwin (from `.symlinks/plugins/bluetooth_low_energy_darwin/darwin`)
|
||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
|
||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||
- restart (from `.symlinks/plugins/restart/ios`)
|
||||
- restart_app (from `.symlinks/plugins/restart_app/ios`)
|
||||
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||
- universal_ble (from `.symlinks/plugins/universal_ble/darwin`)
|
||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||
- wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
bluetooth_low_energy_darwin:
|
||||
:path: ".symlinks/plugins/bluetooth_low_energy_darwin/darwin"
|
||||
device_info_plus:
|
||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_local_notifications:
|
||||
:path: ".symlinks/plugins/flutter_local_notifications/ios"
|
||||
image_picker_ios:
|
||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||
package_info_plus:
|
||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||
permission_handler_apple:
|
||||
:path: ".symlinks/plugins/permission_handler_apple/ios"
|
||||
restart:
|
||||
:path: ".symlinks/plugins/restart/ios"
|
||||
restart_app:
|
||||
:path: ".symlinks/plugins/restart_app/ios"
|
||||
shared_preferences_foundation:
|
||||
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||
universal_ble:
|
||||
:path: ".symlinks/plugins/universal_ble/darwin"
|
||||
url_launcher_ios:
|
||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||
wakelock_plus:
|
||||
:path: ".symlinks/plugins/wakelock_plus/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
bluetooth_low_energy_darwin: 764d8d1ae5abefbcdb839e812b4b25c0061fcf8b
|
||||
device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
|
||||
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
|
||||
flutter_local_notifications: ff50f8405aaa0ccdc7dcfb9022ca192e8ad9688f
|
||||
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
|
||||
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
|
||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||
restart: b5fe16e6e038f0024b2f3af43768e9d2a1557554
|
||||
restart_app: 806659942bf932f6ce51c5372f91ce5e81c8c14a
|
||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||
universal_ble: cf52a7b3fd2e7c14d6d7262e9fdadb72ab6b88a6
|
||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||
wakelock_plus: 76957ab028e12bfa4e66813c99e46637f367fc7e
|
||||
|
||||
PODFILE CHECKSUM: 3c63482e143d1b91d2d2560aee9fb04ecc74ac7e
|
||||
|
||||
COCOAPODS: 1.16.2
|
||||
@@ -10,10 +10,12 @@
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
3E50CA021EFA25CF89FE46AB /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C0E42A04700D6B661C7EE82 /* Pods_RunnerTests.framework */; };
|
||||
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||
9DEFD285994D09CFCE400F36 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5CE7ADD07A99710C0FB974A8 /* Pods_Runner.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -40,14 +42,20 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0CF32F9ECDBEA4B014717FF8 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||
2C0E42A04700D6B661C7EE82 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||
5CE7ADD07A99710C0FB974A8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
7D133E5D5548E2EF2879734F /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
86D436F6DAF367742EF27F51 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
8AA6D129479129F106E2298A /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -55,19 +63,43 @@
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
DFFDC4B9C4D6EF6A3BDE2E73 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
EFDECED99A47773C293F8819 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
5046C8DCA17DB268ED17F005 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
3E50CA021EFA25CF89FE46AB /* Pods_RunnerTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
9DEFD285994D09CFCE400F36 /* Pods_Runner.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
31E2F9ED567016937E8AEA3B /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
86D436F6DAF367742EF27F51 /* Pods-Runner.debug.xcconfig */,
|
||||
0CF32F9ECDBEA4B014717FF8 /* Pods-Runner.release.xcconfig */,
|
||||
7D133E5D5548E2EF2879734F /* Pods-Runner.profile.xcconfig */,
|
||||
DFFDC4B9C4D6EF6A3BDE2E73 /* Pods-RunnerTests.debug.xcconfig */,
|
||||
8AA6D129479129F106E2298A /* Pods-RunnerTests.release.xcconfig */,
|
||||
EFDECED99A47773C293F8819 /* Pods-RunnerTests.profile.xcconfig */,
|
||||
);
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -76,6 +108,15 @@
|
||||
path = RunnerTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6A38311855DC1CB8C0E2FD04 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5CE7ADD07A99710C0FB974A8 /* Pods_Runner.framework */,
|
||||
2C0E42A04700D6B661C7EE82 /* Pods_RunnerTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -94,6 +135,8 @@
|
||||
97C146F01CF9000F007C117D /* Runner */,
|
||||
97C146EF1CF9000F007C117D /* Products */,
|
||||
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||
31E2F9ED567016937E8AEA3B /* Pods */,
|
||||
6A38311855DC1CB8C0E2FD04 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@@ -128,8 +171,10 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||
buildPhases = (
|
||||
5E1D2B1ED00966C758CA2289 /* [CP] Check Pods Manifest.lock */,
|
||||
331C807D294A63A400263BE5 /* Sources */,
|
||||
331C807F294A63A400263BE5 /* Resources */,
|
||||
5046C8DCA17DB268ED17F005 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -145,12 +190,15 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||
buildPhases = (
|
||||
AF2FDC69578083D4D16AB4D6 /* [CP] Check Pods Manifest.lock */,
|
||||
9740EEB61CF901F6004384FC /* Run Script */,
|
||||
97C146EA1CF9000F007C117D /* Sources */,
|
||||
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||
97C146EC1CF9000F007C117D /* Resources */,
|
||||
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||
EEF1FBDEE98BA93C4FBDB3AE /* [CP] Embed Pods Frameworks */,
|
||||
1F0C44A79AE73641A1C3FF47 /* [CP] Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -222,6 +270,23 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
1F0C44A79AE73641A1C3FF47 /* [CP] Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
@@ -238,6 +303,28 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||
};
|
||||
5E1D2B1ED00966C758CA2289 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
alwaysOutOfDate = 1;
|
||||
@@ -253,6 +340,45 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||
};
|
||||
AF2FDC69578083D4D16AB4D6 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
EEF1FBDEE98BA93C4FBDB3AE /* [CP] Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputFileListPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@@ -346,7 +472,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
@@ -361,16 +487,19 @@
|
||||
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 = 7BL8RUV2K6;
|
||||
DEVELOPMENT_TEAM = UZRHKPVWN9;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.jonasbark.swiftPlay;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.jonasbark.swiftcontrol.darwin;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
@@ -379,6 +508,7 @@
|
||||
};
|
||||
331C8088294A63A400263BE5 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = DFFDC4B9C4D6EF6A3BDE2E73 /* Pods-RunnerTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@@ -396,6 +526,7 @@
|
||||
};
|
||||
331C8089294A63A400263BE5 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8AA6D129479129F106E2298A /* Pods-RunnerTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@@ -411,6 +542,7 @@
|
||||
};
|
||||
331C808A294A63A400263BE5 /* Profile */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = EFDECED99A47773C293F8819 /* Pods-RunnerTests.profile.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@@ -428,7 +560,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
@@ -473,7 +605,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
@@ -485,7 +617,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
@@ -524,7 +656,7 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = iphoneos;
|
||||
@@ -541,16 +673,19 @@
|
||||
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 = 7BL8RUV2K6;
|
||||
DEVELOPMENT_TEAM = UZRHKPVWN9;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.jonasbark.swiftPlay;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.jonasbark.swiftcontrol.darwin;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -564,16 +699,19 @@
|
||||
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 = 7BL8RUV2K6;
|
||||
DEVELOPMENT_TEAM = UZRHKPVWN9;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.jonasbark.swiftPlay;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = de.jonasbark.swiftcontrol.darwin;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
@@ -54,6 +55,7 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
||||
3
ios/Runner.xcworkspace/contents.xcworkspacedata
generated
@@ -4,4 +4,7 @@
|
||||
<FileRef
|
||||
location = "group:Runner.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
||||
@@ -1,122 +1 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
{"images":[{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@3x.png","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@3x.png","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@3x.png","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@3x.png","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@1x.png","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@1x.png","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@2x.png","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@1x.png","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@2x.png","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"Icon-App-83.5x83.5@2x.png","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"Icon-App-1024x1024@1x.png","scale":"1x"}],"info":{"version":1,"author":"xcode"}}
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 880 KiB |
|
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 450 B After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 704 B After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 37 KiB |
@@ -2,6 +2,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>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
@@ -24,6 +26,17 @@
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSBluetoothAlwaysUsageDescription</key>
|
||||
<string>SwiftControl uses Bluetooth to connect to accessories.</string>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>bluetooth-peripheral</string>
|
||||
<string>bluetooth-central</string>
|
||||
</array>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
@@ -41,9 +54,5 @@
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
12
keypress_simulator/.clang-format
Normal file
@@ -0,0 +1,12 @@
|
||||
# Defines the Chromium style for automatic reformatting.
|
||||
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||
BasedOnStyle: Chromium
|
||||
# This defaults to 'Auto'. Explicitly set it for a while, so that
|
||||
# 'vector<vector<int> >' in existing files gets formatted to
|
||||
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
|
||||
# 'int>>' if the file already contains at least one such instance.)
|
||||
Standard: Cpp11
|
||||
SortIncludes: true
|
||||
---
|
||||
Language: ObjC
|
||||
ColumnLimit: 100
|
||||
1
keypress_simulator/.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
liberapay: lijy91
|
||||
50
keypress_simulator/.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, dev]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: "3.16.8"
|
||||
channel: "stable"
|
||||
- uses: bluefireteam/melos-action@v2
|
||||
- working-directory: ./packages/keypress_simulator/example
|
||||
run: |
|
||||
melos bs
|
||||
flutter build macos --release
|
||||
|
||||
build-web:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: "3.16.8"
|
||||
channel: "stable"
|
||||
- uses: bluefireteam/melos-action@v2
|
||||
- working-directory: ./packages/keypress_simulator/example
|
||||
run: |
|
||||
melos bs
|
||||
flutter build web --release
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: "3.16.8"
|
||||
channel: "stable"
|
||||
- uses: bluefireteam/melos-action@v2
|
||||
- working-directory: ./packages/keypress_simulator/example
|
||||
run: |
|
||||
melos bs
|
||||
flutter build windows --release
|
||||
31
keypress_simulator/.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, dev]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: "3.16.8"
|
||||
channel: "stable"
|
||||
- uses: bluefireteam/melos-action@v2
|
||||
- run: melos run analyze
|
||||
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: "3.16.8"
|
||||
channel: "stable"
|
||||
cache: true
|
||||
- uses: bluefireteam/melos-action@v2
|
||||
- run: melos run format-check
|
||||
20
keypress_simulator/.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, dev]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: "3.16.8"
|
||||
channel: "stable"
|
||||
cache: true
|
||||
- uses: bluefireteam/melos-action@v2
|
||||
- run: melos run test --no-select
|
||||
6
keypress_simulator/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.dart_tool/
|
||||
.idea/
|
||||
|
||||
*.iml
|
||||
pubspec_overrides.yaml
|
||||
pubspec.lock
|
||||
21
keypress_simulator/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022-2024 LiJianying <lijy91@foxmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
93
keypress_simulator/README-ZH.md
Normal file
@@ -0,0 +1,93 @@
|
||||
> **🚀 快速发布您的应用**: 试试 [Fastforge](https://fastforge.dev) - 构建、打包和分发您的 Flutter 应用最简单的方式。
|
||||
|
||||
# keypress_simulator
|
||||
|
||||
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url]
|
||||
|
||||
[pub-image]: https://img.shields.io/pub/v/keypress_simulator.svg
|
||||
[pub-url]: https://pub.dev/packages/keypress_simulator
|
||||
[discord-image]: https://img.shields.io/discord/884679008049037342.svg
|
||||
[discord-url]: https://discord.gg/zPa6EZ2jqb
|
||||
|
||||
这个插件允许 Flutter 桌面应用模拟按键操作。
|
||||
|
||||
---
|
||||
|
||||
[English](./README.md) | 简体中文
|
||||
|
||||
---
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
- [平台支持](#%E5%B9%B3%E5%8F%B0%E6%94%AF%E6%8C%81)
|
||||
- [快速开始](#%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)
|
||||
- [安装](#%E5%AE%89%E8%A3%85)
|
||||
- [用法](#%E7%94%A8%E6%B3%95)
|
||||
- [谁在用使用它?](#%E8%B0%81%E5%9C%A8%E7%94%A8%E4%BD%BF%E7%94%A8%E5%AE%83)
|
||||
- [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## 平台支持
|
||||
|
||||
| Linux | macOS | Windows |
|
||||
| :---: | :---: | :-----: |
|
||||
| ➖ | ✔️ | ✔️ |
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 安装
|
||||
|
||||
将此添加到你的软件包的 pubspec.yaml 文件:
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
keypress_simulator: ^0.2.0
|
||||
```
|
||||
|
||||
### 用法
|
||||
|
||||
```dart
|
||||
import 'package:keypress_simulator/keypress_simulator.dart';
|
||||
|
||||
// 1. Simulate pressing ⌘ + C
|
||||
|
||||
// 1.1 Simulate key down
|
||||
await keyPressSimulator.simulateKeyDown(
|
||||
PhysicalKeyboardKey.keyC,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
|
||||
// 1.2 Simulate key up
|
||||
await keyPressSimulator.simulateKeyUp(
|
||||
PhysicalKeyboardKey.keyC,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
|
||||
// 2. Simulate long pressing ⌘ + space
|
||||
|
||||
// 2.1. Simulate key down
|
||||
await keyPressSimulator.simulateKeyDown(
|
||||
PhysicalKeyboardKey.space,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
|
||||
// 2.2. Simulate key up
|
||||
await keyPressSimulator.simulateKeyUp(
|
||||
PhysicalKeyboardKey.space,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
```
|
||||
|
||||
> 请看这个插件的示例应用,以了解完整的例子。
|
||||
|
||||
## 谁在用使用它?
|
||||
|
||||
- [Biyi (比译)](https://biyidev.com/) - 一个便捷的翻译和词典应用程序。
|
||||
|
||||
## 许可证
|
||||
|
||||
[MIT](./LICENSE)
|
||||
93
keypress_simulator/README.md
Normal file
@@ -0,0 +1,93 @@
|
||||
> **🚀 Ship Your App Faster**: Try [Fastforge](https://fastforge.dev) - The simplest way to build, package and distribute your Flutter apps.
|
||||
|
||||
# keypress_simulator
|
||||
|
||||
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url]
|
||||
|
||||
[pub-image]: https://img.shields.io/pub/v/keypress_simulator.svg
|
||||
[pub-url]: https://pub.dev/packages/keypress_simulator
|
||||
[discord-image]: https://img.shields.io/discord/884679008049037342.svg
|
||||
[discord-url]: https://discord.gg/zPa6EZ2jqb
|
||||
|
||||
This plugin allows Flutter desktop apps to simulate key presses.
|
||||
|
||||
---
|
||||
|
||||
English | [简体中文](./README-ZH.md)
|
||||
|
||||
---
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
- [Platform Support](#platform-support)
|
||||
- [Quick Start](#quick-start)
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Who's using it?](#whos-using-it)
|
||||
- [License](#license)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Platform Support
|
||||
|
||||
| Linux | macOS | Windows |
|
||||
| :---: | :---: | :-----: |
|
||||
| ➖ | ✔️ | ✔️ |
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Installation
|
||||
|
||||
Add this to your package's pubspec.yaml file:
|
||||
|
||||
```yaml
|
||||
dependencies:
|
||||
keypress_simulator: ^0.2.0
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
```dart
|
||||
import 'package:keypress_simulator/keypress_simulator.dart';
|
||||
|
||||
// 1. Simulate pressing ⌘ + C
|
||||
|
||||
// 1.1 Simulate key down
|
||||
await keyPressSimulator.simulateKeyDown(
|
||||
PhysicalKeyboardKey.keyC,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
|
||||
// 1.2 Simulate key up
|
||||
await keyPressSimulator.simulateKeyUp(
|
||||
PhysicalKeyboardKey.keyC,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
|
||||
// 2. Simulate long pressing ⌘ + space
|
||||
|
||||
// 2.1. Simulate key down
|
||||
await keyPressSimulator.simulateKeyDown(
|
||||
PhysicalKeyboardKey.space,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
|
||||
// 2.2. Simulate key up
|
||||
await keyPressSimulator.simulateKeyUp(
|
||||
PhysicalKeyboardKey.space,
|
||||
[ModifierKey.metaModifier],
|
||||
);
|
||||
```
|
||||
|
||||
> Please see the example app of this plugin for a full example.
|
||||
|
||||
## Who's using it?
|
||||
|
||||
- [Biyi (比译)](https://biyidev.com/) - A convenient translation and dictionary app.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
35
keypress_simulator/melos.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
name: keypress_simulator_workspace
|
||||
repository: https://github.com/leanflutter/keypress_simulator
|
||||
|
||||
packages:
|
||||
- examples/**
|
||||
- packages/**
|
||||
|
||||
command:
|
||||
bootstrap:
|
||||
# Uses the pubspec_overrides.yaml instead of having Melos modifying the lock file.
|
||||
usePubspecOverrides: true
|
||||
|
||||
scripts:
|
||||
analyze:
|
||||
exec: flutter analyze --fatal-infos
|
||||
description: Run `flutter analyze` for all packages.
|
||||
|
||||
test:
|
||||
exec: flutter test
|
||||
description: Run `flutter test` for a specific package.
|
||||
packageFilters:
|
||||
dirExists:
|
||||
- test
|
||||
|
||||
format:
|
||||
exec: dart format . --fix
|
||||
description: Run `dart format` for all packages.
|
||||
|
||||
format-check:
|
||||
exec: dart format . --fix --set-exit-if-changed
|
||||
description: Run `dart format` checks for all packages.
|
||||
|
||||
fix:
|
||||
exec: dart fix . --apply
|
||||
description: Run `dart fix` for all packages.
|
||||
29
keypress_simulator/packages/keypress_simulator/.gitignore
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# Miscellaneous
|
||||
*.class
|
||||
*.log
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
.atom/
|
||||
.buildlog/
|
||||
.history
|
||||
.svn/
|
||||
|
||||
# IntelliJ related
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# The .vscode folder contains launch configuration and tasks you configure in
|
||||
# VS Code which you may wish to be included in version control, so this line
|
||||
# is commented out by default.
|
||||
.vscode/
|
||||
|
||||
# Flutter/Dart/Pub related
|
||||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
|
||||
/pubspec.lock
|
||||
**/doc/api/
|
||||
.dart_tool/
|
||||
.packages
|
||||
build/
|
||||
10
keypress_simulator/packages/keypress_simulator/.metadata
Normal file
@@ -0,0 +1,10 @@
|
||||
# This file tracks properties of this Flutter project.
|
||||
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||
#
|
||||
# This file should be version controlled and should not be manually edited.
|
||||
|
||||
version:
|
||||
revision: db747aa1331bd95bc9b3874c842261ca2d302cd5
|
||||
channel: stable
|
||||
|
||||
project_type: plugin
|
||||
@@ -0,0 +1,7 @@
|
||||
## 0.2.0
|
||||
|
||||
* feat: Convert to federated plugin
|
||||
|
||||
## 0.1.0
|
||||
|
||||
* First release.
|
||||