From 09236e25182c3c218c812bc819133bf8d0943896 Mon Sep 17 00:00:00 2001 From: nikitateplyakov Date: Wed, 26 Feb 2020 21:22:43 +0300 Subject: [PATCH 1/6] 13700 update flutter 1.9 --- android/app/build.gradle | 14 ++-- .../java/com/dinect/checker/MainActivity.java | 4 +- .../com/dinect/checker/ScannerActivity.java | 12 ++-- .../src/main/res/layout/v_custom_toolbar.xml | 4 +- android/build.gradle | 18 +---- android/gradle.properties | 2 + pubspec.lock | 66 +++++++++++++++---- pubspec.yaml | 16 ++--- 8 files changed, 83 insertions(+), 53 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 1032764..d95bf24 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -16,15 +16,15 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 27 - buildToolsVersion '27.0.3' + compileSdkVersion 29 + buildToolsVersion '29.0.2' lintOptions { disable 'InvalidPackage' } defaultConfig { - targetSdkVersion 27 + targetSdkVersion 29 minSdkVersion 16 applicationId "com.dinect.checker" } @@ -200,10 +200,10 @@ flutter { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.android.support:recyclerview-v7:27.1.1' - implementation 'com.android.support:support-v4:27.1.1' - implementation 'com.android.support:support-media-compat:27.1.1' + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.recyclerview:recyclerview:1.1.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.media:media:1.1.0' implementation 'com.squareup.okhttp3:okhttp:3.9.0' implementation 'com.squareup.okio:okio:1.13.0' implementation 'me.dm7.barcodescanner:zxing:1.9.8' diff --git a/android/app/src/main/java/com/dinect/checker/MainActivity.java b/android/app/src/main/java/com/dinect/checker/MainActivity.java index be9a587..2681e25 100644 --- a/android/app/src/main/java/com/dinect/checker/MainActivity.java +++ b/android/app/src/main/java/com/dinect/checker/MainActivity.java @@ -10,8 +10,8 @@ import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; import android.widget.Toast; import java.util.ArrayList; diff --git a/android/app/src/main/java/com/dinect/checker/ScannerActivity.java b/android/app/src/main/java/com/dinect/checker/ScannerActivity.java index fe784b1..e6a3814 100644 --- a/android/app/src/main/java/com/dinect/checker/ScannerActivity.java +++ b/android/app/src/main/java/com/dinect/checker/ScannerActivity.java @@ -19,12 +19,12 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.provider.Settings; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.content.ContextCompat; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuItem; diff --git a/android/app/src/main/res/layout/v_custom_toolbar.xml b/android/app/src/main/res/layout/v_custom_toolbar.xml index 9a6c187..ae5065a 100644 --- a/android/app/src/main/res/layout/v_custom_toolbar.xml +++ b/android/app/src/main/res/layout/v_custom_toolbar.xml @@ -1,5 +1,5 @@ - - + diff --git a/android/build.gradle b/android/build.gradle index a2b6e7a..581b100 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.2.40' + ext.kotlin_version = '1.3.61' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.1' + classpath 'com.android.tools.build:gradle:3.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -17,17 +17,3 @@ allprojects { jcenter() } } - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} - -task wrapper(type: Wrapper) { - gradleVersion = '2.14.1' -} diff --git a/android/gradle.properties b/android/gradle.properties index 8bd86f6..53ae0ae 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1 +1,3 @@ +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M diff --git a/pubspec.lock b/pubspec.lock index fd4a58b..ba1a54a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -22,6 +22,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.14.11" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + dart2_constant: + dependency: transitive + description: + name: dart2_constant + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2+dart2" flutter: dependency: "direct main" description: flutter @@ -33,7 +47,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.0" + version: "0.12.0+4" http_parser: dependency: transitive description: @@ -47,14 +61,21 @@ packages: name: image_picker url: "https://pub.dartlang.org" source: hosted - version: "0.4.10" + version: "0.6.1+11" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.15.7" + version: "0.16.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.6" meta: dependency: transitive description: @@ -75,21 +96,42 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "1.4.5" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.4.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "0.29.0+2" sentry: dependency: "direct main" description: name: sentry url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.0.1" sky_engine: dependency: transitive description: flutter @@ -108,14 +150,14 @@ packages: name: sprintf url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.2" sqflite: dependency: "direct main" description: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "0.12.2+1" + version: "1.1.8" stack_trace: dependency: transitive description: @@ -136,7 +178,7 @@ packages: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "1.5.3" + version: "2.1.1" typed_data: dependency: transitive description: @@ -164,7 +206,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.2.3" + version: "3.5.0" sdks: - dart: ">=2.2.2 <3.0.0" - flutter: ">=0.1.4 <2.0.0" + dart: ">=2.5.0 <3.0.0" + flutter: ">=1.9.1+hotfix.5 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index ecb8afa..d97fa6c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,14 +2,14 @@ name: checker description: A new Flutter project. dependencies: - http: '>=0.11.3+12' - sprintf: "4.0.0" - path_provider: "0.4.1" - sqflite: "0.12.2+1" - image_picker: '^0.4.1' # use for ask permissions @ iOS - xml: "^3.0.0" - sentry: 2.2.0 - intl: 0.15.7 + http: '0.12.0+4' + sprintf: "4.0.2" + path_provider: "1.4.5" + sqflite: "1.1.8" + image_picker: '0.6.1+11' # use for ask permissions @ iOS + xml: "3.5.0" + sentry: 2.0.1 + intl: 0.16.1 flutter: sdk: flutter From a41b30f29568f2419cfd59a271e84d9b7b85d2c9 Mon Sep 17 00:00:00 2001 From: nikitateplyakov Date: Thu, 27 Feb 2020 22:23:31 +0300 Subject: [PATCH 2/6] 13700 update flutter 1.9 --- android/app/build.gradle | 5 ++-- android/build.gradle | 2 +- android/gradle.properties | 1 + lib/main.dart | 27 +++++++---------- pubspec.lock | 63 +++++++++++++++++---------------------- pubspec.yaml | 10 +++---- 6 files changed, 48 insertions(+), 60 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index d95bf24..5f85a5d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,8 +1,8 @@ def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { - localPropertiesFile.withInputStream { stream -> - localProperties.load(stream) + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) } } @@ -48,6 +48,7 @@ android { signingConfig signingConfigs.debug } release { + shrinkResources false minifyEnabled false signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' diff --git a/android/build.gradle b/android/build.gradle index 581b100..31bd497 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle.properties b/android/gradle.properties index 53ae0ae..b0bc401 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,4 @@ android.enableJetifier=true android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M +android.enableR8=false diff --git a/lib/main.dart b/lib/main.dart index ffc5c81..50ca567 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,21 +1,20 @@ import 'dart:async'; import 'package:checker/db.dart'; +import 'package:checker/screens/splash.dart'; import 'package:checker/strings.dart'; import 'package:flutter/material.dart'; -import 'package:checker/screens/splash.dart'; import 'package:flutter/services.dart'; import 'package:sentry/sentry.dart'; const platform = const MethodChannel('com.dinect.checker/instance_id'); main() { - + WidgetsFlutterBinding.ensureInitialized(); platform.invokeMethod('getFlavor').then((flavor) { platform.invokeMethod('getAppTitle').then((title) { - - String app = flavor; // dinect, autobonus - String appName= title; // Dinect, Dinect (INT), Autobonus + String app = flavor; // dinect, autobonus + String appName = title; // Dinect, Dinect (INT), Autobonus SqliteHelper helper = new SqliteHelper(); @@ -32,7 +31,8 @@ main() { }); } -initWithSystemValue(String app, String name, String locale, SqliteHelper helper) { +initWithSystemValue( + String app, String name, String locale, SqliteHelper helper) { helper.getSettings(false).then((settings) { if (settings.isEmpty) { createSettingsTable(app, name, helper); @@ -54,7 +54,7 @@ createSettingsTable(String app, String name, SqliteHelper helper) { start(String app, String name, String locale, SqliteHelper helper) { final SentryClient sentry = new SentryClient( - dsn: 'https://42166056b75d4fe49455555a9bc576a0@sentry.io/1376057'); + dsn: 'https://42166056b75d4fe49455555a9bc576a0@sentry.io/1376057'); FlutterError.onError = (FlutterErrorDetails details) { FlutterError.dumpErrorToConsole(details); @@ -74,7 +74,6 @@ start(String app, String name, String locale, SqliteHelper helper) { } class Checker extends StatefulWidget { - final SqliteHelper helper; final String app; final String appName; @@ -82,14 +81,11 @@ class Checker extends StatefulWidget { Checker(this.app, this.appName, this.helper); @override - State createState() => new CheckerState( - this.app, - this.appName, - this.helper); + State createState() => + new CheckerState(this.app, this.appName, this.helper); } class CheckerState extends State { - SqliteHelper helper; String app; String appName; @@ -98,9 +94,6 @@ class CheckerState extends State { @override Widget build(BuildContext context) { - return new MaterialApp( - title: appName, - home: new SplashScreen(helper, app) - ); + return new MaterialApp(title: appName, home: new SplashScreen(helper, app)); } } diff --git a/pubspec.lock b/pubspec.lock index ba1a54a..96f8061 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.4.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.3" collection: dependency: transitive description: @@ -29,18 +29,18 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" - dart2_constant: - dependency: transitive - description: - name: dart2_constant - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2+dart2" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" http: dependency: "direct main" description: @@ -61,7 +61,7 @@ packages: name: image_picker url: "https://pub.dartlang.org" source: hosted - version: "0.6.1+11" + version: "0.6.3+4" intl: dependency: "direct main" description: @@ -69,34 +69,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.16.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.6" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.7" + version: "1.1.8" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.2" + version: "1.6.4" path_provider: dependency: "direct main" description: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.4.5" + version: "1.6.1" pedantic: dependency: transitive description: @@ -118,20 +111,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.1" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "0.29.0+2" sentry: dependency: "direct main" description: name: sentry url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.1" sky_engine: dependency: transitive description: flutter @@ -143,7 +129,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.6.0" sprintf: dependency: "direct main" description: @@ -157,7 +143,7 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.2.1" stack_trace: dependency: transitive description: @@ -171,14 +157,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" synchronized: dependency: transitive description: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" typed_data: dependency: transitive description: @@ -206,7 +199,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.6.0" sdks: - dart: ">=2.5.0 <3.0.0" - flutter: ">=1.9.1+hotfix.5 <2.0.0" + dart: ">=2.6.0 <3.0.0" + flutter: ">=1.12.13 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index d97fa6c..ed0f4ba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,11 +4,11 @@ description: A new Flutter project. dependencies: http: '0.12.0+4' sprintf: "4.0.2" - path_provider: "1.4.5" - sqflite: "1.1.8" - image_picker: '0.6.1+11' # use for ask permissions @ iOS - xml: "3.5.0" - sentry: 2.0.1 + path_provider: "1.6.1" + sqflite: "1.2.1" + image_picker: '0.6.3+4' # use for ask permissions @ iOS + xml: "3.6.0" + sentry: 3.0.1 intl: 0.16.1 flutter: sdk: flutter From 3b91f3dce693d998b838ffa66a9d6159bbb907de Mon Sep 17 00:00:00 2001 From: vtretyakov Date: Wed, 4 Mar 2020 11:37:07 +0700 Subject: [PATCH 3/6] build script fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2384ebe..ad717c6 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ android-apps: pub-get apk-prod apk-ote apk-int apk-staging apk-testing apk-autob archive: rm -fR output mkdir -p output - rsync build/app/outputs/apk/*/*/*.apk output + rsync android/app/build/app/outputs/apk/*/*/*.apk output apk-prod: flutter build apk --split-per-abi --release --build-name $(VERSION_NAME) $(FLAGS) --build-number $(VERSION) --flavor dinect || echo "prod" From 611071ecd071f215bc19e7518bad113de08a5cb2 Mon Sep 17 00:00:00 2001 From: vtretyakov Date: Wed, 4 Mar 2020 11:49:20 +0700 Subject: [PATCH 4/6] build script fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ad717c6..af286b8 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ android-apps: pub-get apk-prod apk-ote apk-int apk-staging apk-testing apk-autob archive: rm -fR output mkdir -p output - rsync android/app/build/app/outputs/apk/*/*/*.apk output + rsync android/app/build/outputs/apk/*/*/*.apk output apk-prod: flutter build apk --split-per-abi --release --build-name $(VERSION_NAME) $(FLAGS) --build-number $(VERSION) --flavor dinect || echo "prod" From 1274f8a3c3f0ef74417009ab63b45da980016590 Mon Sep 17 00:00:00 2001 From: vtretyakov Date: Wed, 18 Mar 2020 11:25:50 +0700 Subject: [PATCH 5/6] search phone is default --- .../src/main/java/com/dinect/checker/ScannerActivity.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/android/app/src/main/java/com/dinect/checker/ScannerActivity.java b/android/app/src/main/java/com/dinect/checker/ScannerActivity.java index e6a3814..5529e21 100644 --- a/android/app/src/main/java/com/dinect/checker/ScannerActivity.java +++ b/android/app/src/main/java/com/dinect/checker/ScannerActivity.java @@ -155,11 +155,7 @@ public class ScannerActivity extends AppCompatActivity implements private void initSwitchButton() { mButton = findViewById(R.id.cardPhoneButton); mButton.setOnClickListener(this); - if ("autobonus".equals(BuildConfig.FLAVOR)) { - resetSearchType(SearchType.PHONE_NUMBER, R.drawable.ic_phone, "enter_phone"); - } else { - resetSearchType(SearchType.CARD, R.drawable.ic_card, "enter_manual"); - } + resetSearchType(SearchType.PHONE_NUMBER, R.drawable.ic_phone, "enter_phone"); } private void resetSearchType(SearchType type, int iconId, String hintKey) { From 30281fff408d6acbaa693943e471fa65023b089f Mon Sep 17 00:00:00 2001 From: vtretyakov Date: Wed, 18 Mar 2020 11:29:28 +0700 Subject: [PATCH 6/6] close branch