Commit 189d8a36 authored by CLOUARD Regis's avatar CLOUARD Regis
Browse files

Merge branch 'release3.0.0-ios' into 'master'

Release3.0.0 ios

See merge request rclouard/vikazimut-flutter!51
parents ba8052c7 71d49641
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>8.0</string> <string>9.0</string>
</dict> </dict>
</plist> </plist>
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
...@@ -383,6 +383,7 @@ ...@@ -383,6 +383,7 @@
PROVISIONING_PROFILE_SPECIFIER = "Vikazimut Provisioning Profile"; PROVISIONING_PROFILE_SPECIFIER = "Vikazimut Provisioning Profile";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Profile; name = Profile;
...@@ -513,7 +514,7 @@ ...@@ -513,7 +514,7 @@
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
...@@ -529,6 +530,7 @@ ...@@ -529,6 +530,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Debug; name = Debug;
...@@ -550,7 +552,7 @@ ...@@ -550,7 +552,7 @@
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
...@@ -565,6 +567,7 @@ ...@@ -565,6 +567,7 @@
PROVISIONING_PROFILE_SPECIFIER = "Vikazimut Provisioning Profile"; PROVISIONING_PROFILE_SPECIFIER = "Vikazimut Provisioning Profile";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
}; };
name = Release; name = Release;
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Vikazimut</string> <string>Vikazimut</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Vikazimut</string> <string>Vikazimut</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string> <string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NFCReaderUsageDescription</key> <key>NFCReaderUsageDescription</key>
<string>The NFC reader is used to validate a checkpoint when the checkpoint is equipped</string> <string>The NFC reader is used to validate a checkpoint when the checkpoint is equipped</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>The camera is used to validate a checkpoint from QR Code when the checkpoint is equipped</string> <string>The camera is used to validate a checkpoint from QR Code when the checkpoint is equipped</string>
<key>NSLocationAlwaysUsageDescription</key> <key>NSLocationAlwaysUsageDescription</key>
<string>Vikazimut needs access to location when in the background to validate checkpoint from location, record the GPS track, and perform route control even during a phone call or use of another apps.</string> <string>Vikazimut needs access to location when in the background to continue controlling the correct sequence of checkpoint visits and recording the GPS track even during a phone call or use of another apps.</string>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationUsageDescription</key>
<string>Your location is used to automatically validate a checkpoint, display the track on map interactively or afterwards, and compute some statistics on your route.</string> <string>Your location is used to check if you visited the correct sequence of checkpoints, show your live position on the map in the walk mode, and record the route you took to display at the end of the course the resulted track and some performance statistics.</string>
<key>UIBackgroundModes</key> <key>NSLocationWhenInUseUsageDescription</key>
<array> <string>Your location is used to check if you visited the correct sequence of checkpoints, show your live position on the map in the walk mode, and record the route you took to display at the end of the course the resulted track and some performance statistics.</string>
<string>location</string> <key>UIBackgroundModes</key>
</array> <array>
<key>UILaunchStoryboardName</key> <string>location</string>
<string>LaunchScreen</string> </array>
<key>UIMainStoryboardFile</key> <key>UILaunchStoryboardName</key>
<string>Main</string> <string>LaunchScreen</string>
<key>UIStatusBarHidden</key> <key>UIMainStoryboardFile</key>
<false/> <string>Main</string>
<key>UISupportedInterfaceOrientations</key> <key>UIStatusBarHidden</key>
<array> <false/>
<string>UIInterfaceOrientationPortrait</string> <key>UISupportedInterfaceOrientations</key>
<string>UIInterfaceOrientationLandscapeRight</string> <array>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationPortrait</string>
</array> <string>UIInterfaceOrientationLandscapeRight</string>
<key>UISupportedInterfaceOrientations~ipad</key> <string>UIInterfaceOrientationLandscapeLeft</string>
<array> </array>
<string>UIInterfaceOrientationPortrait</string> <key>UISupportedInterfaceOrientations~ipad</key>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <array>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array> <string>UIInterfaceOrientationLandscapeLeft</string>
<key>UIViewControllerBasedStatusBarAppearance</key> <string>UIInterfaceOrientationLandscapeRight</string>
<false/> </array>
<key>io.flutter.embedded_views_preview</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<true/> <false/>
</dict> <key>io.flutter.embedded_views_preview</key>
</plist> <true/>
</dict>
</plist>
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.nfc.readersession.formats</key> <key>com.apple.developer.nfc.readersession.formats</key>
<array> <array>
<string>NDEF</string> <string>NDEF</string>
......
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'dart:typed_data';
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:archive/archive.dart';
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:vikazimut/keys.dart';
import 'package:vikazimut/map/geodesic_point.dart'; import 'package:vikazimut/map/geodesic_point.dart';
import 'package:vikazimut/map/lat_lon_box.dart'; import 'package:vikazimut/map/lat_lon_box.dart';
import 'layer.dart'; import 'layer.dart';
import 'map_scale_view.dart'; import 'map_scale_view.dart';
import 'read_encrypt_image.dart';
class MapView extends StatefulWidget { class MapView extends StatefulWidget {
final ui.Image _image; final ui.Image _image;
...@@ -36,33 +32,8 @@ class MapView extends StatefulWidget { ...@@ -36,33 +32,8 @@ class MapView extends StatefulWidget {
return _state!; return _state!;
} }
// TODO Récupérer les sources de archive Apache 2.0 (LICENSE) static Future<ui.Image> loadImage(File file) async {
// TODO Récupérer les sources de encrypt BSD (LICENSE) return loadEncryptImage(file);
static Future<ui.Image> loadImage(File gzipFile) async {
final String data = await unarchive(gzipFile);
Uint8List imageData = await decryptFile(data);
final Completer<ui.Image> completer = Completer();
ui.decodeImageFromList(imageData, (ui.Image image) {
completer.complete(image);
});
return completer.future;
}
static Future<String> unarchive(File zippedFile) async {
final Uint8List bytes = zippedFile.readAsBytesSync();
try {
return String.fromCharCodes(GZipDecoder().decodeBytes(bytes));
} catch (e) {
throw new Exception("Bad image contents");
}
}
static Future<Uint8List> decryptFile(String encryptedBase64EncodedString) async {
var decoded = base64.decode(encryptedBase64EncodedString);
final key = encrypt.Key.fromBase64(Secret.key);
final iv = encrypt.IV.fromBase64(Secret.initializationVector);
final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
return Uint8List.fromList(encrypter.decryptBytes(encrypt.Encrypted(decoded), iv: iv));
} }
void onResume() { void onResume() {
......
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:archive/archive.dart';
import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:vikazimut/keys.dart';
Future<ui.Image> loadEncryptImage(File gzipFile) async {
final String data = await _unarchive(gzipFile);
Uint8List imageData = await _decryptFile(data);
final Completer<ui.Image> completer = Completer();
ui.decodeImageFromList(imageData, (ui.Image image) {
completer.complete(image);
});
return completer.future;
}
Future<String> _unarchive(File zippedFile) async {
final Uint8List bytes = zippedFile.readAsBytesSync();
try {
return String.fromCharCodes(GZipDecoder().decodeBytes(bytes));
} catch (e) {
throw new Exception("Bad image contents");
}
}
Future<Uint8List> _decryptFile(String encryptedBase64EncodedString) async {
var decoded = base64.decode(encryptedBase64EncodedString);
final key = encrypt.Key.fromBase64(Secret.key);
final iv = encrypt.IV.fromBase64(Secret.initializationVector);
final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
return Uint8List.fromList(encrypter.decryptBytes(encrypt.Encrypted(decoded), iv: iv));
}
...@@ -238,7 +238,7 @@ packages: ...@@ -238,7 +238,7 @@ packages:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.1" version: "6.1.2"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
...@@ -489,7 +489,7 @@ packages: ...@@ -489,7 +489,7 @@ packages:
name: node_preamble name: node_preamble
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.1"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
......
...@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 3.0.0+87 version: 3.0.0+88
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
...@@ -39,6 +39,7 @@ dependencies: ...@@ -39,6 +39,7 @@ dependencies:
xml: ^5.1.1 xml: ^5.1.1
http: ^0.13.3 http: ^0.13.3
url_launcher: ^6.0.4 url_launcher: ^6.0.4
archive: ^3.1.2 archive: ^3.1.2
encrypt: ^5.0.0 encrypt: ^5.0.0
...@@ -50,7 +51,7 @@ dependencies: ...@@ -50,7 +51,7 @@ dependencies:
focus_detector: ^2.0.0 focus_detector: ^2.0.0
badges: ^2.0.1 badges: ^2.0.1
location: ^4.3.0 location: ^4.3.0
geolocator: ^7.1.0 geolocator: ^7.1.0
flutter_compass: ^0.6.1 flutter_compass: ^0.6.1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment