Skip to content

Commit e0c22ec

Browse files
authored
Merge pull request #271 from AgoraDesk-LocalMonero/iteration_57
Iteration 57
2 parents 85c4331 + 0bcea62 commit e0c22ec

File tree

65 files changed

+2293
-1887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2293
-1887
lines changed

.github/workflows/build_from_tags_ci.yml

+7
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,10 @@ jobs:
128128
artifacts: "build/app/outputs/flutter-apk/*.apk"
129129
bodyFile: "RELEASE.md"
130130
token: ${{ secrets.RELEASE_TOKEN }}
131+
132+
- name: Add tags for F-Droid releases
133+
run: |
134+
git checkout fdroid_ad
135+
git tag -a "v${{ steps.split.outputs._1 }}-fdroid"
136+
git checkout fdroid_lm
137+
git tag -a "v${{ steps.split.outputs._1 }}-fdroid-lm"

.vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"dart.lineLength": 120,
3+
"editor.fontSize": 15,
34
"[dart]": {
5+
"editor.fontSize": 15,
46
"editor.tabSize": 2,
57
"editor.insertSpaces": true,
68
"editor.rulers": [120],
@@ -19,5 +21,9 @@
1921
"**/.svn": false,
2022
"**/CVS": false,
2123
"**/Thumbs.db": false
24+
},
25+
"terminal.integrated.fontSize": 13,
26+
"[Log]": {
27+
"editor.fontSize": 13
2228
}
2329
}

assets/banks/ZELLE.svg

+4-1
Loading

devtools_options.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extensions:

ios/Podfile.lock

+28-27
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PODS:
1616
- firebase_core (2.25.4):
1717
- Firebase/CoreOnly (= 10.20.0)
1818
- Flutter
19-
- firebase_messaging (14.7.15):
19+
- firebase_messaging (14.7.16):
2020
- Firebase/Messaging (= 10.20.0)
2121
- firebase_core
2222
- Flutter
@@ -58,9 +58,6 @@ PODS:
5858
- Flutter
5959
- flutter_secure_storage (6.0.0):
6060
- Flutter
61-
- FMDB (2.7.5):
62-
- FMDB/standard (= 2.7.5)
63-
- FMDB/standard (2.7.5)
6461
- GoogleDataTransport (9.3.0):
6562
- GoogleUtilities/Environment (~> 7.7)
6663
- nanopb (< 2.30910.0, >= 2.30908.0)
@@ -98,25 +95,27 @@ PODS:
9895
- path_provider_foundation (0.0.1):
9996
- Flutter
10097
- FlutterMacOS
101-
- permission_handler_apple (9.0.4):
98+
- permission_handler_apple (9.1.1):
10299
- Flutter
103100
- PromisesObjC (2.3.1)
104101
- ReachabilitySwift (5.0.0)
105-
- Sentry/HybridSDK (8.9.1):
106-
- SentryPrivate (= 8.9.1)
102+
- restart_app (0.0.1):
103+
- Flutter
104+
- Sentry/HybridSDK (8.20.0):
105+
- SentryPrivate (= 8.20.0)
107106
- sentry_flutter (0.0.1):
108107
- Flutter
109108
- FlutterMacOS
110-
- Sentry/HybridSDK (= 8.9.1)
111-
- SentryPrivate (8.9.1)
109+
- Sentry/HybridSDK (= 8.20.0)
110+
- SentryPrivate (8.20.0)
112111
- share_plus (0.0.1):
113112
- Flutter
114113
- shared_preferences_foundation (0.0.1):
115114
- Flutter
116115
- FlutterMacOS
117-
- sqflite (0.0.2):
116+
- sqflite (0.0.3):
118117
- Flutter
119-
- FMDB (>= 2.7.5)
118+
- FlutterMacOS
120119
- store_checker (0.0.1):
121120
- Flutter
122121
- SwiftProtobuf (1.25.2)
@@ -143,10 +142,11 @@ DEPENDENCIES:
143142
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
144143
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
145144
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
145+
- restart_app (from `.symlinks/plugins/restart_app/ios`)
146146
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
147147
- share_plus (from `.symlinks/plugins/share_plus/ios`)
148148
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
149-
- sqflite (from `.symlinks/plugins/sqflite/ios`)
149+
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
150150
- store_checker (from `.symlinks/plugins/store_checker/ios`)
151151
- uni_links (from `.symlinks/plugins/uni_links/ios`)
152152
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@@ -158,7 +158,6 @@ SPEC REPOS:
158158
- FirebaseCoreInternal
159159
- FirebaseInstallations
160160
- FirebaseMessaging
161-
- FMDB
162161
- GoogleDataTransport
163162
- GoogleUtilities
164163
- MTBBarcodeScanner
@@ -205,14 +204,16 @@ EXTERNAL SOURCES:
205204
:path: ".symlinks/plugins/path_provider_foundation/darwin"
206205
permission_handler_apple:
207206
:path: ".symlinks/plugins/permission_handler_apple/ios"
207+
restart_app:
208+
:path: ".symlinks/plugins/restart_app/ios"
208209
sentry_flutter:
209210
:path: ".symlinks/plugins/sentry_flutter/ios"
210211
share_plus:
211212
:path: ".symlinks/plugins/share_plus/ios"
212213
shared_preferences_foundation:
213214
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
214215
sqflite:
215-
:path: ".symlinks/plugins/sqflite/ios"
216+
:path: ".symlinks/plugins/sqflite/darwin"
216217
store_checker:
217218
:path: ".symlinks/plugins/store_checker/ios"
218219
uni_links:
@@ -223,10 +224,10 @@ EXTERNAL SOURCES:
223224
SPEC CHECKSUMS:
224225
barcode_scan2: 0af2bb63c81b4565aab6cd78278e4c0fa136dbb0
225226
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
226-
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
227+
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
227228
Firebase: 10c8cb12fb7ad2ae0c09ffc86cd9c1ab392a0031
228229
firebase_core: a46c312d8bae4defa3d009b2aa7b5b413aeb394e
229-
firebase_messaging: 40d7dd2f3e88a6367c7326cf601f84633d477582
230+
firebase_messaging: e7062cef946e12f93b42abea96937004f8d914d6
230231
FirebaseCore: 28045c1560a2600d284b9c45a904fe322dc890b6
231232
FirebaseCoreInternal: 43c1788eaeee9d1b97caaa751af567ce11010d00
232233
FirebaseInstallations: 390ea1d10a4d02b20c965cbfd527ee9b3b412acb
@@ -238,25 +239,25 @@ SPEC CHECKSUMS:
238239
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069
239240
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
240241
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
241-
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
242242
GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe
243243
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
244244
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
245-
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
245+
local_auth_ios: 5046a18c018dd973247a0564496c8898dbb5adf9
246246
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
247247
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
248248
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
249-
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
250-
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
251-
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
249+
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
250+
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
251+
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
252252
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
253253
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
254-
Sentry: e3203780941722a1fcfee99e351de14244c7f806
255-
sentry_flutter: 8f0ffd53088e6a4d50c095852c5cad9e4405025c
256-
SentryPrivate: 5e3683390f66611fc7c6215e27645873adb55d13
257-
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
258-
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
259-
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
254+
restart_app: 806659942bf932f6ce51c5372f91ce5e81c8c14a
255+
Sentry: a8d7b373b9f9868442b02a0c425192f693103cbf
256+
sentry_flutter: 03e7660857a8cdb236e71456a7e8447b65c8a788
257+
SentryPrivate: 006b24af16828441f70e2ab6adf241bd0a8ad130
258+
share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5
259+
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
260+
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
260261
store_checker: 359c5051d9ec30ff0a8fa39eb5ec9df021bb745d
261262
SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1
262263
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a

ios/Runner.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
97C146E61CF9000F007C117D /* Project object */ = {
175175
isa = PBXProject;
176176
attributes = {
177-
LastUpgradeCheck = 1430;
177+
LastUpgradeCheck = 1510;
178178
ORGANIZATIONNAME = "Blue Sunday Limited";
179179
TargetAttributes = {
180180
97C146ED1CF9000F007C117D = {

lib/core/api/api_client.dart

+30-24
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import 'dart:async';
22
import 'dart:convert';
33
import 'dart:developer';
44

5+
import 'package:agoradesk/core/api/dio_logging_interceptor.dart';
56
import 'package:agoradesk/core/app_parameters.dart';
67
import 'package:agoradesk/core/events.dart';
78
import 'package:agoradesk/core/utils/url_mixin.dart';
89
import 'package:dio/dio.dart';
910
import 'package:flutter/foundation.dart';
11+
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
1012

1113
import 'api_helper.dart';
1214
import 'mock_interceptor.dart';
@@ -51,7 +53,7 @@ class ApiClient with UrlMixin {
5153
}) : _dio = Dio(options ?? _defaultOptions),
5254
_debug = debug,
5355
_useMocks = useMocks {
54-
(_dio.transformer as DefaultTransformer).jsonDecodeCallback = _parseJson;
56+
(_dio.transformer as BackgroundTransformer).jsonDecodeCallback = _parseJson;
5557

5658
if (_useMocks && _debug) {
5759
_dio.interceptors.add(MockInterceptor());
@@ -65,24 +67,21 @@ class ApiClient with UrlMixin {
6567
}
6668
List<String> cookiesLst = [];
6769
final bool isLoggedIn = GetIt.I<AppParameters>().accessToken?.isNotEmpty == true;
68-
if (GetIt.I<AppParameters>().cookies != null) {
69-
for (final cookie in GetIt.I<AppParameters>().cookies!) {
70-
try {
71-
if (cookie.name == 'token' && isLoggedIn) {
72-
continue;
73-
}
74-
cookiesLst.add('${cookie.name}=${cookie.value}');
75-
} catch (e) {
76-
debugPrint('[++++parsing cookies error] - $e');
70+
71+
for (final cookie in GetIt.I<AppParameters>().cookies) {
72+
try {
73+
if (cookie.name == 'token' && isLoggedIn) {
74+
continue;
7775
}
76+
cookiesLst.add('${cookie.name}=${cookie.value}');
77+
} catch (e) {
78+
debugPrint('[++++parsing cookies error] - $e');
7879
}
7980
}
8081

8182
final bool hasCookies = options.headers["cookie"] != null && options.headers["cookie"].toString().isNotEmpty;
8283
if (isLoggedIn && hasCookies) {
8384
options.headers["cookie"] = options.headers["cookie"] + ';' + cookiesLst.join(';');
84-
} else {
85-
options.headers["cookie"] = cookiesLst.join(';');
8685
}
8786
if (GetIt.I<AppParameters>().debugPrintIsOn) {
8887
debugPrint('[++++ api_client cookies] ${options.headers["cookie"]}');
@@ -100,10 +99,17 @@ class ApiClient with UrlMixin {
10099
'[++++response.statusCode] ${response.statusCode} [++++response.headers] ${response.headers} --END');
101100
if (res.contains('<iframe id')) {
102101
final List<dynamic> cookiesLst = response.headers.map['set-cookie'] ?? [];
103-
eventBus.fire(DisplayCaptchaEvent(
104-
cookies: cookiesLst,
105-
body: response.data,
106-
));
102+
for (final c in cookiesLst) {
103+
final cookieRaw = c.split(';').first;
104+
final name = cookieRaw.split('=').first;
105+
final value = cookieRaw.substring(name.length + 1);
106+
GetIt.I<AppParameters>().cookies.add(Cookie(name: name, value: value));
107+
}
108+
109+
// eventBus.fire(DisplayCaptchaEvent(
110+
// cookies: cookiesLst,
111+
// body: response.data,
112+
// ));
107113
}
108114
// }
109115
return handler.next(response);
@@ -116,7 +122,7 @@ class ApiClient with UrlMixin {
116122
log('++++[api_client ERROR RESPONSE] ${error.response}');
117123
log('++++[api_client ERROR RESPONSE DATA] ${error.response?.data}');
118124

119-
DioError? finalError;
125+
DioException? finalError;
120126
if (statusCode == 401) {
121127
log('++++[401 headers] ${error.response?.headers}');
122128
log('++++[401 data] ${error.response?.data}');
@@ -127,7 +133,7 @@ class ApiClient with UrlMixin {
127133
final message = ApiHelper.parseErrorToString(error);
128134
if (message != null) {
129135
log('++++[api_client ERROR message] statusCode [400, 422, 401] - $message');
130-
finalError = DioError(
136+
finalError = DioException(
131137
error: jsonEncode(message),
132138
requestOptions: error.requestOptions,
133139
response: error.response,
@@ -168,12 +174,12 @@ class ApiClient with UrlMixin {
168174
);
169175

170176
if (_debug) {
171-
// _dio.interceptors.add(
172-
// DioLoggingInterceptor(
173-
// level: Level.body,
174-
// compact: false,
175-
// ),
176-
// );
177+
_dio.interceptors.add(
178+
DioLoggingInterceptor(
179+
level: Level.body,
180+
compact: false,
181+
),
182+
);
177183
}
178184
}
179185

lib/core/api/api_helper.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'package:dio/dio.dart';
77
import 'package:flutter/foundation.dart';
88

99
mixin ApiHelper {
10-
static String? parseErrorToString(DioError e) {
10+
static String? parseErrorToString(DioException e) {
1111
log('++++ApiHelper parseErrorToString -- $e');
1212
if (e.response != null && e.response!.data is Map) {
1313
// Parse validation error messages
@@ -43,7 +43,7 @@ mixin ApiHelper {
4343
static ApiError parseErrorToApiError(dynamic err, String? objectStr) {
4444
if (GetIt.I<AppParameters>().debugPrintIsOn) debugPrint('[++++parseErrorToApiError objectStr] $err');
4545
try {
46-
final e = err as DioError;
46+
final e = err as DioException;
4747
if (e.response?.statusCode == 403) {
4848
return ApiError(statusCode: 403, message: {});
4949
}

lib/core/api/dio_logging_interceptor.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class DioLoggingInterceptor extends Interceptor {
165165

166166
@override
167167
void onError(
168-
DioError err,
168+
DioException err,
169169
ErrorInterceptorHandler handler,
170170
) {
171171
if (level == Level.none) return handler.next(err);

lib/core/app.dart

+16-12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:agoradesk/core/app_hive.dart';
99
import 'package:agoradesk/core/app_parameters.dart';
1010
import 'package:agoradesk/core/app_shared_prefs.dart';
1111
import 'package:agoradesk/core/app_state.dart';
12+
import 'package:agoradesk/core/app_state_v2.dart';
1213
import 'package:agoradesk/core/events.dart';
1314
import 'package:agoradesk/core/observers/routes_observer.dart';
1415
import 'package:agoradesk/core/packages/mapbox/places_search.dart';
@@ -41,6 +42,7 @@ import 'package:agoradesk/features/trades/data/repository/trade_repository.dart'
4142
import 'package:agoradesk/features/trades/data/services/trade_service.dart';
4243
import 'package:agoradesk/features/wallet/data/services/wallet_service.dart';
4344
import 'package:agoradesk/generated/i18n.dart';
45+
import 'package:agoradesk/main.dart';
4446
import 'package:agoradesk/router.gr.dart';
4547
import 'package:auto_route/auto_route.dart';
4648
import 'package:connectivity_plus/connectivity_plus.dart';
@@ -164,6 +166,8 @@ class _AppState extends State<App>
164166
WidgetsBinding.instance.addObserver(this);
165167
WidgetsBinding.instance.addPostFrameCallback(_afterLayout);
166168

169+
container.read(appStateV2Provider.notifier);
170+
167171
super.initState();
168172
}
169173

@@ -506,18 +510,18 @@ class _AppState extends State<App>
506510
_authService.logOut();
507511
}
508512
})
509-
..on<DisplayCaptchaEvent>().listen((e) {
510-
if (router.current.name != WebviewRoute.name) {
511-
router.push(
512-
WebviewRoute(
513-
cookies: e.cookies,
514-
token: token,
515-
url: 'https://agoradesk.com',
516-
isFromCaptchaEvent: true,
517-
),
518-
);
519-
}
520-
})
513+
// ..on<DisplayCaptchaEvent>().listen((e) {
514+
// if (router.current.name != WebviewRoute.name) {
515+
// router.push(
516+
// WebviewRoute(
517+
// cookies: e.cookies,
518+
// token: token,
519+
// url: 'https://agoradesk.com',
520+
// isFromCaptchaEvent: true,
521+
// ),
522+
// );
523+
// }
524+
// })
521525
..on<ReloadMarketScreenEvent>().listen((e) {
522526
appState.sinkReloadMarket.add(true);
523527
})

lib/core/app_constants.dart

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
22

33
///
44
/// When FCM is not available appp polling messages in the Foreground service with this interval
5+
/// milliseconds
56
///
67
const kForegroungPollingInterval = 60000;
78

0 commit comments

Comments
 (0)