Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] debug release #177

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ android {
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
release {
storeFile file("/Users/anukul/Desktop/reef/mobile-app/anukulpandey.jks")
storePassword "anukulpandey"
keyAlias "anukulpandey"
keyPassword "anukulpandey"
}
}
buildTypes {
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ext.kotlin_version = '1.9.23'
ext.kotlin_version = '2.1.10'
allprojects {
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.1.2" apply false
id "org.jetbrains.kotlin.android" version "1.9.23" apply false
id "com.android.application" version "7.3.1" apply false
id "org.jetbrains.kotlin.android" version "2.1.10" apply false
}

include ":app"
Binary file added anukulpandey.jks
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/components/getQrTypeData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:file_picker/file_picker.dart';
import 'package:reef_mobile_app/utils/functions.dart';
import 'package:reef_mobile_app/utils/password_manager.dart';
import 'package:reef_mobile_app/utils/styles.dart';
import 'package:qr_code_tools/qr_code_tools.dart';
// import 'package:qr_code_tools/qr_code_tools.dart';

class QrDataDisplay extends StatefulWidget {
ReefQrCodeType? expectedType;
Expand Down Expand Up @@ -303,8 +303,8 @@ Future<String?> scanFile() async {
if (pickedFile != null) {
final filePath = pickedFile.files.single.path;
if (filePath != null) {
var res = await QrCodeToolsPlugin.decodeFrom(filePath);
return res;
// var res = await QrCodeToolsPlugin.decodeFrom(filePath);
return "res";
}
}
} catch (e) {
Expand Down
67 changes: 46 additions & 21 deletions lib/model/ReefAppState.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,75 +55,91 @@ class ReefAppState {

static ReefAppState get instance => _instance ??= ReefAppState._();

init(StorageService storage, WalletConnectService walletConnect,ReefChainApi _reefChainApi) async {
init(JsApiService _jsApi, StorageService storage, WalletConnectService walletConnect,ReefChainApi _reefChainApi) async {
this.storage = storage;
this.reefChainApi = _reefChainApi;
this.walletConnect = walletConnect;

await Future.delayed(Duration(milliseconds: 100));
// added initial delay so as to wait for the controller to set in ios
reefChainApi.ready.future.then((_)=>debugPrint("reefChainApi READYYYY"));
await reefChainApi.ready.future;
reefChainApi.ready.future.then((_)async{
this.initStatusStream.add("starting reefChainApi...");
debugPrint("reefChainApi READYYYY");
await reefChainApi.ready.future;
this.initStatusStream.add("finshined reefChainApi init...");
});

this.initStatusStream.add("observables...");
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("network...");
networkCtrl = NetworkCtrl(storage, model.network,_reefChainApi);
firebaseAnalyticsCtrl = FirebaseAnalyticsCtrl(_reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
stealthexCtrl = StealthexCtrl(model.stealthexModel,_reefChainApi);
this.initStatusStream.add("tokens...");
tokensCtrl = TokenCtrl(model.tokens,reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("account...");
accountCtrl = AccountCtrl(storage, model.accounts,reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("signer...");
signingCtrl = SigningCtrl(storage, model.signatureRequests, model.accounts,reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("transfers...");
transferCtrl = TransferCtrl(reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("swap...");
swapCtrl = SwapCtrl(model.swapSettings,reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("pools...");
poolsCtrl = PoolsCtrl(model.pools,reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("metadata...");
metadataCtrl = MetadataCtrl(reefChainApi);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("navigation...");
navigationCtrl =
NavigationCtrl(model.navigationModel, model.homeNavigationModel);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("state...");


this.initStatusStream.add("config...");
await Future.delayed(Duration(milliseconds: 100));
appConfigCtrl = AppConfigCtrl(storage, model.appConfig);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("locale...");
localeCtrl = LocaleCtrl(storage, model.locale);
await Future.delayed(Duration(milliseconds: 10));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("storage...");
storageCtrl = StorageCtrl(storage);
await Future.delayed(Duration(milliseconds: 200));
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("complete");


Network currentNetwork =
await storage.getValue(StorageKey.network.name) == Network.testnet.name
? Network.testnet
: Network.mainnet;


await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("current network===$currentNetwork");
try {
await _initReefState(currentNetwork,_reefChainApi);
await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("init networ started");
await _initReefState(_jsApi,currentNetwork,_reefChainApi);

await Future.delayed(Duration(milliseconds: 100));
this.initStatusStream.add("init networ finished");
return;
} catch (e){
this.initStatusStream.add("error state= ${e.toString()}");
}
return;
}

_initReefState(Network currentNetwork,ReefChainApi _reefChainApi) async {
_initReefState(JsApiService _jsApi, Network currentNetwork,ReefChainApi _reefChainApi) async {
this.initStatusStream.add("init networ accounts");
// var accounts = [];
var accounts = await accountCtrl.getStorageAccountsList();

List<ReefAccount> parsedAccounts = [];
Expand All @@ -132,6 +148,15 @@ class ReefAppState {
parsedAccounts.add(ReefAccount(accounts[i]['name'], accounts[i]['address'], false));
}

await reefChainApi.reefState.init(currentNetwork.name=="mainnet"?ReefNetowrk.mainnet:ReefNetowrk.testnet, parsedAccounts);
this.initStatusStream.add("init networ parsed accounts");

await _jsApi.jsPromise(
'window.jsApi.initReefState("${currentNetwork}", ${jsonEncode(
accounts)})');

var x = await _jsApi.jsPromise('window.keyring.generate()');
this.initStatusStream.add("x===$x");

// await reefChainApi.reefState.init(currentNetwork.name=="mainnet"?ReefNetowrk.mainnet:ReefNetowrk.testnet, parsedAccounts);
}
}
7 changes: 6 additions & 1 deletion lib/pages/SplashScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,16 @@ class _SplashAppState extends State<SplashApp> {
}

Future<void> _initializeAsyncDependencies() async {
final JsApiService reefJsApiService = JsApiService.reefAppJsApi(onErrorCb: () {
debugPrint('JS CONNECTION ERROR - RESET');
});
final storageService = StorageService();
final walletConnectService = WalletConnectService();
await ReefAppState.instance.init(storageService, walletConnectService,widget.reefChainApi);
ReefAppState.instance.init(reefJsApiService,storageService, walletConnectService,widget.reefChainApi).then((val){
setState(() {
appReady = true;
});
});
}

@override
Expand Down Expand Up @@ -223,6 +227,7 @@ class _SplashAppState extends State<SplashApp> {
width: 128.0,
),
const Gap(16),
Text(appReady==true?"app is ready":"app not ready"),
Visibility(
maintainSize: true,
maintainAnimation: true,
Expand Down
4 changes: 2 additions & 2 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import local_auth_darwin
import package_info_plus
import path_provider_foundation
import shared_preferences_foundation
import sqflite
import sqflite_darwin
import url_launcher_macos
import video_player_avfoundation
import webview_flutter_wkwebview
Expand All @@ -30,5 +30,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin"))
WebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "WebViewFlutterPlugin"))
}
Loading