Skip to content

Commit

Permalink
Merge pull request #390 from dreautall/develop
Browse files Browse the repository at this point in the history
v1.0.4
  • Loading branch information
dreautall authored Jun 1, 2024
2 parents d9b18f5 + f7ba775 commit 1c30b39
Show file tree
Hide file tree
Showing 31 changed files with 1,738 additions and 1,200 deletions.
7 changes: 7 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,18 @@ android {
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
applicationIdSuffix ".debug"
}

release {
signingConfig signingConfigs.release

minifyEnabled true
shrinkResources true

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

Expand Down
3 changes: 3 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-keep class java.net.URL { *; }
-keep class java.util.concurrent.Executors { *; }
-keep class org.chromium.net.** { *; }
7 changes: 6 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<!-- For flutter_sharing_intent -->
<intent-filter>
<action android:name="android.intent.action.SEND" />
Expand All @@ -26,6 +26,8 @@
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data android:name="flutterEmbedding" android:value="2" />
<!-- Try Impeller - see https://docs.flutter.dev/perf/impeller#android -->
<meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="true" />
</application>

<!-- Permissions -->
Expand Down Expand Up @@ -151,7 +153,9 @@
<package android:name="com.ing.banking"/>
<package android:name="com.ing.mobile"/>
<package android:name="com.interbank.mobile"/>
<package android:name="com.kasikorn.retail.mbanking.wap"/>
<package android:name="com.konylabs.capitalone"/>
<package android:name="com.krungsri.kma"/>
<package android:name="com.latuabancaperandroid"/>
<package android:name="com.loan.cash.credit.nanopay"/>
<package android:name="com.loan.cash.credit.nanopaymx"/>
Expand Down Expand Up @@ -257,6 +261,7 @@
<package android:name="ro.ing.mobile.banking.android.activity"/>
<package android:name="ru.abr"/>
<package android:name="ru.nspk.mirpay"/>
<package android:name="ru.ozon.app.android"/>
<package android:name="ru.sberbankmobile"/>
<package android:name="ru.vtb24.mobilebanking.android"/>
<package android:name="si.delavskahranilnica.dhdenarnik"/>
Expand Down
2 changes: 0 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ allprojects {
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

Expand Down
4 changes: 4 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/312.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Option to hide tags in transaction view
- Bugfix for custom certificates
- Support for additional banking apps
- Minor bugfixes & improvements
4 changes: 2 additions & 2 deletions fastlane/metadata/android/version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
versionName=1.0.3
versionCode=291
versionName=1.0.4
versionCode=312
2 changes: 1 addition & 1 deletion lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class _WaterflyAppState extends State<WaterflyApp> {
seedColor: Colors.blue,
brightness: Brightness.dark,
).copyWith(
surfaceVariant: Colors.blueGrey.shade900,
surfaceContainerHighest: Colors.blueGrey.shade900,
onSurfaceVariant: Colors.white,
);

Expand Down
67 changes: 29 additions & 38 deletions lib/auth.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';

import 'package:cronet_http/cronet_http.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:http/http.dart' as http;
import 'package:http/io_client.dart';
import 'package:logging/logging.dart';

import 'package:chopper/chopper.dart'
show HttpMethod, Request, Response, StripStringExtension;
show
Chain,
HttpMethod,
Interceptor,
Request,
Response,
StripStringExtension,
applyHeaders;
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:version/version.dart';
Expand Down Expand Up @@ -105,14 +113,23 @@ class AuthErrorNoInstance extends AuthError {
final String host;
}

http.Client get httpClient {
// Only for Android
return CronetClient.fromCronetEngine(
CronetEngine.build(
cacheMode: CacheMode.memory,
cacheMaxSize: 2 * 1024 * 1024,
),
);
http.Client get httpClient => IOClient(HttpClient());

class APIRequestInterceptor implements Interceptor {
APIRequestInterceptor(this.headerFunc);

final Function() headerFunc;

@override
FutureOr<Response<BodyType>> intercept<BodyType>(
Chain<BodyType> chain) async {
log.finest(() => "API query to ${chain.request.url}");
final Request request =
applyHeaders(chain.request, headerFunc(), override: true);
request.followRedirects = false;
request.maxRedirects = 0;
return chain.proceed(request);
}
}

class AuthUser {
Expand All @@ -136,39 +153,13 @@ class AuthUser {
_api = FireflyIii.create(
baseUrl: _host,
httpClient: httpClient,
interceptors: <dynamic>[
(Request request) async {
log.finest(() => "API query to ${request.url}");
request.followRedirects = false;
request.maxRedirects = 0;
return request.copyWith(headers: <String, String>{
...request.headers,
...headers(),
});
},
(Response<dynamic> response) async {
return response;
},
],
interceptors: <Interceptor>[APIRequestInterceptor(headers)],
);

_apiV2 = FireflyIiiV2.create(
baseUrl: _host,
httpClient: httpClient,
interceptors: <dynamic>[
(Request request) async {
log.finest(() => "APIv2 query to ${request.url}");
request.followRedirects = false;
request.maxRedirects = 0;
return request.copyWith(headers: <String, String>{
...request.headers,
...headers(),
});
},
(Response<dynamic> response) async {
return response;
},
],
interceptors: <Interceptor>[APIRequestInterceptor(headers)],
);
}

Expand Down
Loading

0 comments on commit 1c30b39

Please sign in to comment.