iOS zxing scanner, iOS localization

This commit is contained in:
Ivan Murashov
2018-02-09 23:13:47 +03:00
parent 6068b7e3b2
commit 90bf053c7e
45 changed files with 348 additions and 314 deletions

Binary file not shown.

View File

@@ -1,6 +1,6 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
pod 'ZXingObjC', '~> 3.2.1'
pod 'ZXingObjC', '~> 3.2.2'
if ENV['FLUTTER_FRAMEWORK_DIR'] == nil
abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework')

View File

@@ -19,7 +19,7 @@ DEPENDENCIES:
- image_picker (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.5/ios`)
- path_provider (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios`)
- sqflite (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/sqflite-0.6.2+2/ios`)
- ZXingObjC (~> 3.2.1)
- ZXingObjC (~> 3.2.2)
EXTERNAL SOURCES:
Flutter:
@@ -39,6 +39,6 @@ SPEC CHECKSUMS:
sqflite: edb0e4df7640c26fea6a107c21ed1542219e761a
ZXingObjC: 2c95a0dc52daac69b23ec78fad8fa2fec05f8981
PODFILE CHECKSUM: 6ff82960897df72ab1735b87f4a4feb0f254f399
PODFILE CHECKSUM: 9f4cf0c4c102f6176b37e2c4c913e0544612cec5
COCOAPODS: 1.4.0

View File

@@ -21,21 +21,15 @@
ACE861361F9F745B006FEF38 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBA9BB311F1792570053B6EA /* AVFoundation.framework */; };
ACE861371F9F745B006FEF38 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
ACE861381F9F745B006FEF38 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
ACE861391F9F745B006FEF38 /* libzbar.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ACE103AB1F8FCC6000D17794 /* libzbar.a */; };
ACE8613A1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28B464359F9DDCC3EF756D7D /* libPods-Runner.a */; };
ACE8613B1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; };
ACE8613C1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; };
ACE8613E1F9F745B006FEF38 /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; };
ACE8613F1F9F745B006FEF38 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
ACE861401F9F745B006FEF38 /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
ACE861411F9F745B006FEF38 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
ACE861421F9F745B006FEF38 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
ACE861431F9F745B006FEF38 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
ACE861441F9F745B006FEF38 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
ACE861461F9F745B006FEF38 /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
ACE861471F9F745B006FEF38 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
AFFEFA1AD31BC8D9EA04CFCB /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; };
BAE7FF4D875B996672385844 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -64,10 +58,10 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
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>"; };
28B464359F9DDCC3EF756D7D /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
32DA147B1FBC3DCE008F0388 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
@@ -85,27 +79,6 @@
AC45BF661F9E3F97009713E2 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AC45BF911F9E408E009713E2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Users/ntrlab/semyon/apps/checker/ios/Runner/Info.plist; sourceTree = "<absolute>"; };
AC73A4241F9F7F920026EBA4 /* Dinect.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Dinect.plist; path = /Users/ntrlab/semyon/apps/checker/ios/Runner/Dinect.plist; sourceTree = "<absolute>"; };
ACE103AB1F8FCC6000D17794 /* libzbar.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzbar.a; path = ZBarSDK/libzbar.a; sourceTree = "<group>"; };
ACE103AD1F8FCC6F00D17794 /* zbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zbar.h; path = ZBarSDK/Headers/zbar.h; sourceTree = "<group>"; };
ACE103AE1F8FCC6F00D17794 /* ZBarCaptureReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarCaptureReader.h; path = ZBarSDK/Headers/ZBarCaptureReader.h; sourceTree = "<group>"; };
ACE103AF1F8FCC6F00D17794 /* ZBarReaderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarReaderViewController.h; path = ZBarSDK/Headers/ZBarReaderViewController.h; sourceTree = "<group>"; };
ACE103B01F8FCC6F00D17794 /* ZBarImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarImage.h; path = ZBarSDK/Headers/ZBarImage.h; sourceTree = "<group>"; };
ACE103B11F8FCC7000D17794 /* ZBarCameraSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarCameraSimulator.h; path = ZBarSDK/Headers/ZBarCameraSimulator.h; sourceTree = "<group>"; };
ACE103B21F8FCC7000D17794 /* ZBarReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarReaderView.h; path = ZBarSDK/Headers/ZBarReaderView.h; sourceTree = "<group>"; };
ACE103B31F8FCC7000D17794 /* ZBarSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarSDK.h; path = ZBarSDK/Headers/ZBarSDK.h; sourceTree = "<group>"; };
ACE103B41F8FCC7000D17794 /* ZBarHelpController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarHelpController.h; path = ZBarSDK/Headers/ZBarHelpController.h; sourceTree = "<group>"; };
ACE103B51F8FCC7000D17794 /* ZBarImageScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarImageScanner.h; path = ZBarSDK/Headers/ZBarImageScanner.h; sourceTree = "<group>"; };
ACE103B61F8FCC7100D17794 /* ZBarReaderController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarReaderController.h; path = ZBarSDK/Headers/ZBarReaderController.h; sourceTree = "<group>"; };
ACE103B71F8FCC7100D17794 /* ZBarSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarSymbol.h; path = ZBarSDK/Headers/ZBarSymbol.h; sourceTree = "<group>"; };
ACE103BE1F8FCD1400D17794 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Window.h; path = ZBarSDK/Headers/zbar/Window.h; sourceTree = "<group>"; };
ACE103BF1F8FCD1500D17794 /* Decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Decoder.h; path = ZBarSDK/Headers/zbar/Decoder.h; sourceTree = "<group>"; };
ACE103C01F8FCD1500D17794 /* Processor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Processor.h; path = ZBarSDK/Headers/zbar/Processor.h; sourceTree = "<group>"; };
ACE103C11F8FCD1500D17794 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = ZBarSDK/Headers/zbar/Exception.h; sourceTree = "<group>"; };
ACE103C21F8FCD1500D17794 /* Symbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symbol.h; path = ZBarSDK/Headers/zbar/Symbol.h; sourceTree = "<group>"; };
ACE103C31F8FCD1500D17794 /* Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Image.h; path = ZBarSDK/Headers/zbar/Image.h; sourceTree = "<group>"; };
ACE103C41F8FCD1500D17794 /* Video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Video.h; path = ZBarSDK/Headers/zbar/Video.h; sourceTree = "<group>"; };
ACE103C51F8FCD1500D17794 /* ImageScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageScanner.h; path = ZBarSDK/Headers/zbar/ImageScanner.h; sourceTree = "<group>"; };
ACE103C61F8FCD1500D17794 /* Scanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scanner.h; path = ZBarSDK/Headers/zbar/Scanner.h; sourceTree = "<group>"; };
ACE861531F9F745B006FEF38 /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
BBA9BAFD1F176DD10053B6EA /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
BBA9BAFE1F176DD10053B6EA /* ScannerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScannerViewController.swift; sourceTree = "<group>"; };
@@ -132,12 +105,8 @@
ACE861361F9F745B006FEF38 /* AVFoundation.framework in Frameworks */,
ACE861371F9F745B006FEF38 /* Flutter.framework in Frameworks */,
ACE861381F9F745B006FEF38 /* App.framework in Frameworks */,
ACE861391F9F745B006FEF38 /* libzbar.a in Frameworks */,
ACE8613A1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */,
ACE8613B1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */,
ACE8613C1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */,
BAE7FF4D875B996672385844 /* libPods-Runner.a in Frameworks */,
AFFEFA1AD31BC8D9EA04CFCB /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -169,7 +138,6 @@
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
ACE103BB1F8FCCA500D17794 /* ZBarSDK */,
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
@@ -214,50 +182,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
ACE103BB1F8FCCA500D17794 /* ZBarSDK */ = {
isa = PBXGroup;
children = (
ACE103AB1F8FCC6000D17794 /* libzbar.a */,
ACE103BC1F8FCCD000D17794 /* Headers */,
);
name = ZBarSDK;
sourceTree = "<group>";
};
ACE103BC1F8FCCD000D17794 /* Headers */ = {
isa = PBXGroup;
children = (
ACE103BD1F8FCCF300D17794 /* zbar */,
ACE103AD1F8FCC6F00D17794 /* zbar.h */,
ACE103AE1F8FCC6F00D17794 /* ZBarCaptureReader.h */,
ACE103AF1F8FCC6F00D17794 /* ZBarReaderViewController.h */,
ACE103B31F8FCC7000D17794 /* ZBarSDK.h */,
ACE103B71F8FCC7100D17794 /* ZBarSymbol.h */,
ACE103B11F8FCC7000D17794 /* ZBarCameraSimulator.h */,
ACE103B41F8FCC7000D17794 /* ZBarHelpController.h */,
ACE103B01F8FCC6F00D17794 /* ZBarImage.h */,
ACE103B51F8FCC7000D17794 /* ZBarImageScanner.h */,
ACE103B61F8FCC7100D17794 /* ZBarReaderController.h */,
ACE103B21F8FCC7000D17794 /* ZBarReaderView.h */,
);
name = Headers;
sourceTree = "<group>";
};
ACE103BD1F8FCCF300D17794 /* zbar */ = {
isa = PBXGroup;
children = (
ACE103BF1F8FCD1500D17794 /* Decoder.h */,
ACE103C11F8FCD1500D17794 /* Exception.h */,
ACE103C31F8FCD1500D17794 /* Image.h */,
ACE103C51F8FCD1500D17794 /* ImageScanner.h */,
ACE103C01F8FCD1500D17794 /* Processor.h */,
ACE103C61F8FCD1500D17794 /* Scanner.h */,
ACE103C21F8FCD1500D17794 /* Symbol.h */,
ACE103C41F8FCD1500D17794 /* Video.h */,
ACE103BE1F8FCD1400D17794 /* Window.h */,
);
name = zbar;
sourceTree = "<group>";
};
BBA9BB001F1786510053B6EA /* Frameworks */ = {
isa = PBXGroup;
children = (
@@ -308,7 +232,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0900;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
ACE861271F9F745B006FEF38 = {
@@ -348,9 +272,7 @@
2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
ACE8613E1F9F745B006FEF38 /* app.flx in Resources */,
ACE8613F1F9F745B006FEF38 /* LaunchScreen.storyboard in Resources */,
ACE861401F9F745B006FEF38 /* Generated.xcconfig in Resources */,
ACE861411F9F745B006FEF38 /* AppFrameworkInfo.plist in Resources */,
ACE861421F9F745B006FEF38 /* Debug.xcconfig in Resources */,
ACE861431F9F745B006FEF38 /* Assets.xcassets in Resources */,
ACE861441F9F745B006FEF38 /* Main.storyboard in Resources */,
);
@@ -484,14 +406,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -532,14 +460,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -559,6 +493,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
@@ -569,12 +504,6 @@
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ARCHS = (
"$(ARCHS_STANDARD)",
arm7s,
armv7,
arm64,
);
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
@@ -593,7 +522,6 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
"$(PROJECT_DIR)/ZBarSDK",
);
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.dinect.checker.autoclub.app;
@@ -613,12 +541,6 @@
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ARCHS = (
"$(ARCHS_STANDARD)",
arm7s,
armv7,
arm64,
);
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
@@ -637,7 +559,6 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
"$(PROJECT_DIR)/ZBarSDK",
);
PRODUCT_BUNDLE_IDENTIFIER = com.dinect.checker.autoclub.app;
PRODUCT_NAME = "$(TARGET_NAME)";

View File

@@ -0,0 +1,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">
<plist version="1.0">
<dict>
<key>BuildLocationStyle</key>
<string>UseTargetSettings</string>
</dict>
</plist>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@@ -1,8 +1,6 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "Autobonus-Swift.h"
#import "ZBarSDK.h"
@implementation AppDelegate
@@ -90,14 +88,9 @@
} else if ([@"getCurrency" isEqualToString:call.method]) {
result(buildSettings[@"currency"]);
} else if ([@"startScanner" isEqualToString:call.method]) {
NSString *locale = call.arguments[@"locale"];
NSLog(@"locale is %@", locale);
ScannerViewController *modalViewController = [[ScannerViewController alloc] initWithLocale:locale];
ScannerViewController *modalViewController = [[ScannerViewController alloc] initWithStrings:call.arguments];
modalViewController.platformChannel = weekPlatformChannel;
[controller presentViewController:modalViewController animated:YES completion:nil];
// [weekPlatformChannel invokeMethod:(@"findUserAndPurchase") arguments: @[@"79039441628", @"phone"]];
} else if ([@"isOnline" isEqualToString:call.method]) {
result(@YES);
} else if ([@"getSupportPhone" isEqualToString:call.method]) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 B

View File

@@ -2,5 +2,4 @@
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "ZBarSDK.h"
#import "ZBarImageScanner.h"
#import "ZXingObjC/ZXingObjC.h"

View File

@@ -1,250 +1,308 @@
//
// ScannerViewController.swift
// Runner
//
// Created by Ivan Murashov on 13/07/2017.
// Copyright © 2017 The Chromium Authors. All rights reserved.
//
import UIKit
import Flutter
extension ZBarSymbolSet: Sequence {
//public typealias Element = ZBarSymbol
//public typealias Iterator = NSFastEnumerationIterator
public func makeIterator() -> NSFastEnumerationIterator {
return NSFastEnumerationIterator(self)
}
}
@objc class ScannerViewController: UIViewController, ZBarReaderDelegate, UITextFieldDelegate {
@objc class ScannerViewController: UIViewController, ZXCaptureDelegate, UITextFieldDelegate {
enum AppLocale {
case ru
case en
case ru
case en
}
enum ButtonState {
case card
case phone
var icon: UIImage {
switch self {
case .card: return UIImage(named: "card")!
case .phone: return UIImage(named: "phone")!
case .card: return UIImage(named: "card")!
case .phone: return UIImage(named: "phone")!
}
}
var searchType: String {
switch self {
case .card: return "card"
case .phone: return "phone"
case .card: return "card"
case .phone: return "phone"
}
}
}
var appLocale: AppLocale
// @IBOutlet weak var decodedLabel: UILabel!
private var captureSizeTransform: CGAffineTransform?
var buttonState: ButtonState = .card
var platformChannel: FlutterMethodChannel?
let readerViewController = ZBarReaderViewController()
// Квадрат для наведения на цель (надеюсь)
let scanRectView = UIView()
//Вьюшка для верхнего меню
let topView = UIView()
//Окно ввода кода
let textField = UITextField()
//Кнопка настроек
var settingButton: UIButton!
var strings = [String:String]()
required init?(coder aDecoder: NSCoder) {
self.appLocale = .en
super.init(coder: aDecoder)
}
init(locale: String) {
switch locale {
case "ru": self.appLocale = .ru; break
default: self.appLocale = .en
}
init(strings: [String: String]) {
super.init(nibName: nil, bundle: nil)
strings.forEach { (k,v) in self.strings[k] = v }
}
func getCardHint() -> String {
switch self.appLocale {
case .ru: return "Ввести номер карты"
default: return "Enter the barcode"
}
}
func getPhoneHint() -> String {
switch self.appLocale {
case .ru: return "Телефон 79XXXXXXXXX"
default: return "Phone 79XXXXXXXXX"
}
}
func getInputHint() -> String {
switch self.buttonState {
case .card: return self.getCardHint()
case .phone: return self.getPhoneHint()
case .card: return strings["enter_manual"]!
case .phone: return strings["enter_phone"]!
}
}
func getErrorTitle() -> String {
switch self.appLocale {
case .ru: return "Ошибка"
default: return "Error"
}
}
func getCardErrorText() -> String {
switch self.appLocale {
case .ru: return "Пользователь с номером карты %@ не найден"
default: return "User with card number %@ not found"
}
}
func getPhoneErrorText() -> String {
switch self.appLocale {
case .ru: return "Пользователь с номером телефона %@ не найден"
default: return "User with phone number %@ not found"
}
}
func getErrorText() -> String {
switch self.buttonState {
case .card: return self.getCardErrorText()
case .phone: return self.getPhoneErrorText()
case .card: return strings["user_card_not_found"]!
case .phone: return strings["user_phone_not_found"]!
}
}
func getDismissText() -> String {
switch self.appLocale {
case .ru: return "Скрыть"
default: return "Dismiss"
}
}
let capture: ZXCapture = ZXCapture()
override func viewDidLoad() {
super.viewDidLoad()
readerViewController.readerDelegate = self
readerViewController.readerView.zoom = 1.0
readerViewController.showsZBarControls = false
capture.camera = capture.back()
capture.focusMode = .continuousAutoFocus
view.layer.addSublayer((capture.layer)!)
view.addSubview(scanRectView)
settingButton = UIButton(type: .system)
settingButton.addTarget(self, action: #selector(ScannerViewController.buttonTouch), for: .touchUpInside)
self.addChildViewController(readerViewController)
self.view.addSubview(readerViewController.view)
readerViewController.didMove(toParentViewController: self)
readerViewController.view.addSubview(topView)
topView.addSubview(textField)
topView.addSubview(settingButton)
view.addSubview(topView)
view.bringSubview(toFront: topView)
textField.delegate = self
//textField.keyboardType = .numberPad
//Looks for single or multiple taps.
let tap = UITapGestureRecognizer(target: self, action: #selector(ScannerViewController.hideKeyboard))
readerViewController.view.addGestureRecognizer(tap)
view.addGestureRecognizer(tap)
settingButton.setImage(self.buttonState.icon, for: .normal)
textField.placeholder = self.getInputHint()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
topView.backgroundColor = UIColor.white
textField.borderStyle = .roundedRect
capture.delegate = self
applyOrientation()
}
override func viewWillLayoutSubviews() {
scanRectView.frame = view.bounds
topView.frame = CGRect(x: 0, y: 0, width: view.frame.size.width, height: 56)
settingButton.frame = CGRect(x: 8, y: 26, width: 20, height: 20)
textField.frame = CGRect(x: settingButton.frame.maxX + 8, y: 21,
width: view.frame.size.width - settingButton.frame.maxX - 16, height: 30)
}
func hideKeyboard() {
view.endEditing(false)
}
func buttonTouch(){
switch self.buttonState {
case .card: self.buttonState = .phone
case .phone: self.buttonState = .card
case .card: self.buttonState = .phone
case .phone: self.buttonState = .card
}
settingButton.setImage(self.buttonState.icon, for: .normal)
textField.placeholder = self.getInputHint()
}
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
sendResult(textField.text!)
return true
}
func sendResult(_ str: String) {
platformChannel?.invokeMethod("findUser", arguments: [str, buttonState.searchType], result: { (result: Any?) in
if result is FlutterError {
self.showErrorAlert(str)
} else {
self.dismiss(animated: true) {
self.platformChannel?.invokeMethod("purchase", arguments: [result, str])
}
}
print("result: \(result.debugDescription )")
})
}
func showErrorAlert(_ str: String) {
let alertController = UIAlertController(
title: self.getErrorTitle(),
title: strings["error"]!,
message: String(format: self.getErrorText(), str),
preferredStyle: UIAlertControllerStyle.alert
)
alertController.addAction(UIAlertAction(title: self.getDismissText(), style: UIAlertActionStyle.default,handler: nil))
// if let appDelegate = UIApplication.shared.delegate as? FlutterAppDelegate {
// appDelegate.window.rootViewController?.present(alertController, animated: true, completion: nil)
// }
alertController.addAction(UIAlertAction(title: strings["dismiss"]!, style: UIAlertActionStyle.default,handler: nil))
self.present(alertController, animated: true, completion: nil)
}
override func viewWillAppear(_ animated: Bool) {
topView.backgroundColor = UIColor.white
textField.borderStyle = .roundedRect
super.viewWillAppear(animated)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}
override func viewWillLayoutSubviews() {
readerViewController.view.frame = view.bounds
topView.frame = CGRect(x: 0, y: 0, width: readerViewController.view.frame.size.width, height: 40)
textField.frame = CGRect(x: settingButton.frame.maxX + 8 + 20 + 5, y: 5, width: readerViewController.view.frame.size.width - 50, height: 30)
settingButton.frame = CGRect(x: 8, y: 10, width: 20, height: 20)
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
guard let symbols = info[ZBarReaderControllerResults] as? ZBarSymbolSet else { return }
for symbol in symbols {
if let symbol = symbol as? ZBarSymbol, let data = symbol.data {
sendResult(data)
}
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
deinit {
capture.layer.removeFromSuperlayer()
}
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
coordinator.animate(alongsideTransition: {(_ context: UIViewControllerTransitionCoordinatorContext) -> Void in
}, completion: {(_ context: UIViewControllerTransitionCoordinatorContext) -> Void in
self.applyOrientation()
})
}
func applyOrientation() {
print("APPLY ORIENTATION")
let orientation: UIInterfaceOrientation = UIApplication.shared.statusBarOrientation
var scanRectRotation: Float
var captureRotation: Float
switch orientation {
case .portrait:
captureRotation = 0
scanRectRotation = 90
case .landscapeLeft:
captureRotation = 90
scanRectRotation = 180
case .landscapeRight:
captureRotation = 270
scanRectRotation = 0
case .portraitUpsideDown:
captureRotation = 180
scanRectRotation = 270
default:
captureRotation = 0
scanRectRotation = 90
}
applyRectOfInterest(orientation)
let transform = CGAffineTransform(rotationAngle: CGFloat(captureRotation / 180 * .pi))
capture.transform = transform
capture.rotation = CGFloat(scanRectRotation)
capture.layer.frame = view.frame
}
func applyRectOfInterest(_ orientation: UIInterfaceOrientation) {
var scaleVideo: CGFloat
var scaleVideoX: CGFloat
var scaleVideoY: CGFloat
var videoSizeX: CGFloat
var videoSizeY: CGFloat
var transformedVideoRect: CGRect = scanRectView.frame
videoSizeX = 720
videoSizeY = 1280
if UIInterfaceOrientationIsPortrait(orientation) {
scaleVideoX = view.frame.size.width / videoSizeX
scaleVideoY = view.frame.size.height / videoSizeY
scaleVideo = max(scaleVideoX, scaleVideoY)
if scaleVideoX > scaleVideoY {
transformedVideoRect.origin.y += (scaleVideo * videoSizeY - view.frame.size.height) / 2
}
else {
transformedVideoRect.origin.x += (scaleVideo * videoSizeX - view.frame.size.width) / 2
}
}
else {
scaleVideoX = view.frame.size.width / videoSizeY
scaleVideoY = view.frame.size.height / videoSizeX
scaleVideo = max(scaleVideoX, scaleVideoY)
if scaleVideoX > scaleVideoY {
transformedVideoRect.origin.y += (scaleVideo * videoSizeX - view.frame.size.height) / 2
}
else {
transformedVideoRect.origin.x += (scaleVideo * videoSizeY - view.frame.size.width) / 2
}
}
captureSizeTransform = CGAffineTransform(scaleX: 1 / scaleVideo, y: 1 / scaleVideo)
capture.scanRect = transformedVideoRect.applying(captureSizeTransform!)
}
// MARK: - Private Methods
func barcodeFormat(toString format: ZXBarcodeFormat) -> String {
switch format {
case kBarcodeFormatAztec:
return "Aztec"
case kBarcodeFormatCodabar:
return "CODABAR"
case kBarcodeFormatCode39:
return "Code 39"
case kBarcodeFormatCode93:
return "Code 93"
case kBarcodeFormatCode128:
return "Code 128"
case kBarcodeFormatDataMatrix:
return "Data Matrix"
case kBarcodeFormatEan8:
return "EAN-8"
case kBarcodeFormatEan13:
return "EAN-13"
case kBarcodeFormatITF:
return "ITF"
case kBarcodeFormatPDF417:
return "PDF417"
case kBarcodeFormatQRCode:
return "QR Code"
case kBarcodeFormatRSS14:
return "RSS 14"
case kBarcodeFormatRSSExpanded:
return "RSS Expanded"
case kBarcodeFormatUPCA:
return "UPCA"
case kBarcodeFormatUPCE:
return "UPCE"
case kBarcodeFormatUPCEANExtension:
return "UPC/EAN extension"
default:
return "Unknown"
}
}
// MARK: - ZXCaptureDelegate Methods
func captureResult(_ capture: ZXCapture, result: ZXResult) {
let inverse: CGAffineTransform = captureSizeTransform!.inverted()
var points = [AnyHashable]()
var location = ""
for resultPoint in result.resultPoints {
let p = resultPoint as! ZXResultPoint
let cgPoint = CGPoint(x: CGFloat(p.x), y: CGFloat(p.y))
var transformedPoint: CGPoint = cgPoint.applying(inverse)
transformedPoint = scanRectView.convert(transformedPoint, to: scanRectView.window)
let windowPointValue = NSValue(cgPoint: transformedPoint)
location = "\(location) (\(transformedPoint.x), \(transformedPoint.y))"
points.append(windowPointValue)
}
// We got a result. Display information about the result onscreen.
let formatString: String = barcodeFormat(toString: result.barcodeFormat)
sendResult(result.text)
print(result.text)
self.capture.stop()
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(2 * Double(NSEC_PER_SEC)) / Double(NSEC_PER_SEC), execute: {() -> Void in
self.capture.start()
})
}
}