Skip to content

Commit

Permalink
Merge pull request #134 from MXCzkEVM/big_upgrade
Browse files Browse the repository at this point in the history
Big upgrade
  • Loading branch information
reasje authored Dec 17, 2024
2 parents 3dfcc85 + e272b2f commit 801b98d
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 29 deletions.
4 changes: 3 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "com.moonchain.app"

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion "33.0.1"
ndkVersion flutter.ndkVersion
Expand Down Expand Up @@ -102,7 +104,7 @@ android {
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

Expand Down
26 changes: 25 additions & 1 deletion android/app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"project_info": {
"project_number": "810578982053",
"project_id": "moonchain-app",
"storage_bucket": "moonchain-app.appspot.com"
"storage_bucket": "moonchain-app.firebasestorage.app"
},
"client": [
{
Expand All @@ -13,6 +13,30 @@
}
},
"oauth_client": [
{
"client_id": "810578982053-ettvcq9ao4l1idjaap0vbqaq7lp906hh.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.moonchain.app",
"certificate_hash": "b3d8f034c8319b877f83a2a44ff9141325ded9c3"
}
},
{
"client_id": "810578982053-lcmvcramqf6cmnl3o60m5tbe91kfto89.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.moonchain.app",
"certificate_hash": "5c3aaff06b031aa5f90f61c1e1d3b79fc0294af0"
}
},
{
"client_id": "810578982053-q4cakrdg97b716dvbdqkrcpv87cl6d69.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.moonchain.app",
"certificate_hash": "2d7ddbcda8fff7b9cbc2b55d3b01e9ddc77c20e4"
}
},
{
"client_id": "810578982053-5mthh5ep4k1601komn39hu7c4biu4chb.apps.googleusercontent.com",
"client_type": 3
Expand Down
16 changes: 14 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:8.1.2'
// START: FlutterFire Configuration
// classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.gms:google-services:4.3.15'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand All @@ -22,6 +22,18 @@ allprojects {
url "${project(':background_fetch').projectDir}/libs"
}
}

subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
}

ext {
Expand Down
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
kotlin.jvm.target.validation.mode = IGNORE
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
1 change: 1 addition & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"moonchain-app","appId":"1:810578982053:android:dbfbe51474fccc2b21094c","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"moonchain-app","appId":"1:810578982053:ios:bc715e679aa91fe221094c","uploadDebugSymbols":true,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"moonchain-app","configurations":{"android":"1:810578982053:android:dbfbe51474fccc2b21094c","ios":"1:810578982053:ios:bc715e679aa91fe221094c"}}}}}}
19 changes: 19 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
A5618D03B0CF4532EDC74EED /* [CP] Embed Pods Frameworks */,
3EE0B9E34511D387BB0754AA /* [CP] Copy Pods Resources */,
5B64F37869CECD4392AE2CE2 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */,
);
buildRules = (
);
Expand Down Expand Up @@ -241,6 +242,24 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
5B64F37869CECD4392AE2CE2 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "FlutterFire: \"flutterfire upload-crashlytics-symbols\"";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\n#!/bin/bash\nPATH=${PATH}:$FLUTTER_ROOT/bin:$HOME/.pub-cache/bin\nflutterfire upload-crashlytics-symbols --upload-symbols-script-path=$PODS_ROOT/FirebaseCrashlytics/upload-symbols --platform=ios --apple-project-path=${SRCROOT} --env-platform-name=${PLATFORM_NAME} --env-configuration=${CONFIGURATION} --env-project-dir=${PROJECT_DIR} --env-built-products-dir=${BUILT_PRODUCTS_DIR} --env-dwarf-dsym-folder-path=${DWARF_DSYM_FOLDER_PATH} --env-dwarf-dsym-file-name=${DWARF_DSYM_FILE_NAME} --env-infoplist-path=${INFOPLIST_PATH} --default-config=default\n";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down
2 changes: 1 addition & 1 deletion ios/Runner/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>PROJECT_ID</key>
<string>moonchain-app</string>
<key>STORAGE_BUCKET</key>
<string>moonchain-app.appspot.com</string>
<string>moonchain-app.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
Expand Down
6 changes: 3 additions & 3 deletions lib/core/src/firebase/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// File generated by FlutterFire CLI.
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
Expand Down Expand Up @@ -54,15 +54,15 @@ class DefaultFirebaseOptions {
appId: '1:810578982053:android:dbfbe51474fccc2b21094c',
messagingSenderId: '810578982053',
projectId: 'moonchain-app',
storageBucket: 'moonchain-app.appspot.com',
storageBucket: 'moonchain-app.firebasestorage.app',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyBY-VWbgxaPfGC0WnkSga4zWEFpSs0ybZU',
appId: '1:810578982053:ios:bc715e679aa91fe221094c',
messagingSenderId: '810578982053',
projectId: 'moonchain-app',
storageBucket: 'moonchain-app.appspot.com',
storageBucket: 'moonchain-app.firebasestorage.app',
androidClientId: '810578982053-ef7chugg2fct7l6io3d7tis321hi1hnd.apps.googleusercontent.com',
iosClientId: '810578982053-p196bn8p9ipg3709v4ftk2a28fcvi6ka.apps.googleusercontent.com',
iosBundleId: 'com.moonchain.mxc',
Expand Down
3 changes: 2 additions & 1 deletion lib/core/src/firebase/moonchain_wallet_firebase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class MoonchainWalletFireBase {
static int buildTap = 0;

static Future<FirebaseApp> initializeFirebase() async {
return await Firebase.initializeApp();
return await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform);
}

// Listening to the foreground messages
Expand Down
39 changes: 32 additions & 7 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'dart:async';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter/foundation.dart';
import 'package:moonchain_wallet/app/logger.dart';
import 'package:moonchain_wallet/common/common.dart';
import 'package:moonchain_wallet/core/core.dart';
Expand All @@ -24,20 +26,43 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
print('Handling a background message ${message.messageId}');
}

void main() {
var onError = FlutterError.onError;
FlutterError.onError = (FlutterErrorDetails details) {
onError?.call(details);
reportErrorAndLog(details);
};

void main() async {
runZoned(
() async {
WidgetsFlutterBinding.ensureInitialized();

await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);

const fatalError = true;
var onError = FlutterError.onError;
// Non-async exceptions
FlutterError.onError = (errorDetails) {
onError?.call(errorDetails);
reportErrorAndLog(errorDetails);
if (fatalError) {
// If you want to record a "fatal" exception
FirebaseCrashlytics.instance.recordFlutterFatalError(errorDetails);
// ignore: dead_code
} else {
// If you want to record a "non-fatal" exception
FirebaseCrashlytics.instance.recordFlutterError(errorDetails);
}
};
// Async exceptions
PlatformDispatcher.instance.onError = (error, stack) {
if (fatalError) {
// If you want to record a "fatal" exception
FirebaseCrashlytics.instance.recordError(error, stack, fatal: true);
// ignore: dead_code
} else {
// If you want to record a "non-fatal" exception
FirebaseCrashlytics.instance.recordError(error, stack);
}
return true;
};

FirebaseMessaging.onBackgroundMessage(
_firebaseMessagingBackgroundHandler);
Expand Down
64 changes: 52 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: _flutterfire_internals
sha256: "71c01c1998c40b3af1944ad0a5f374b4e6fef7f3d2df487f3970dbeadaeb25a1"
sha256: eae3133cbb06de9205899b822e3897fc6a8bc278ad4c944b4ce612689369694b
url: "https://pub.dev"
source: hosted
version: "1.3.46"
version: "1.3.47"
analyzer:
dependency: transitive
description:
Expand Down Expand Up @@ -92,10 +92,10 @@ packages:
dependency: "direct main"
description:
name: background_fetch
sha256: f70b28a0f7a3156195e9742229696f004ea3bf10f74039b7bf4c78a74fbda8a4
sha256: e9f26ae54d88310b7ac2a68f2f9fcee0081a4d5f11100f233a70702021e7ac4f
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.7"
bip32:
dependency: transitive
description:
Expand Down Expand Up @@ -399,30 +399,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.1"
firebase_analytics:
dependency: "direct main"
description:
name: firebase_analytics
sha256: "366140abb55418ea23060b779893fa997c2d8e1974a4d1cc4d9590933b65c5fd"
url: "https://pub.dev"
source: hosted
version: "11.3.6"
firebase_analytics_platform_interface:
dependency: transitive
description:
name: firebase_analytics_platform_interface
sha256: "8e987cf977c0c8f4ad02d9950a9b25b1a9606899f37b66a322a43af05be0246b"
url: "https://pub.dev"
source: hosted
version: "4.2.8"
firebase_analytics_web:
dependency: transitive
description:
name: firebase_analytics_web
sha256: "0b64ef9060d394bba3d3b4777f49ee098efeeea7b0afb04663c956de6a3da170"
url: "https://pub.dev"
source: hosted
version: "0.5.10+5"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
sha256: "2438a75ad803e818ad3bd5df49137ee619c46b6fc7101f4dbc23da07305ce553"
sha256: fef81a53ba1ca618def1f8bef4361df07968434e62cb204c1fb90bb880a03da2
url: "https://pub.dev"
source: hosted
version: "3.8.0"
version: "3.8.1"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
sha256: e30da58198a6d4b49d5bce4e852f985c32cb10db329ebef9473db2b9f09ce810
sha256: b94b217e3ad745e784960603d33d99471621ecca151c99c670869b76e50ad2a6
url: "https://pub.dev"
source: hosted
version: "5.3.0"
version: "5.3.1"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
sha256: f967a7138f5d2ffb1ce15950e2a382924239eaa521150a8f144af34e68b3b3e5
sha256: "9e69806bb3d905aeec3c1242e0e1475de6ea6d48f456af29d598fb229a2b4e5e"
url: "https://pub.dev"
source: hosted
version: "2.18.2"
firebase_crashlytics:
dependency: "direct main"
description:
name: firebase_crashlytics
sha256: e235c8452d5622fc271404592388fde179e4b62c50e777ad3c8c3369296104ed
url: "https://pub.dev"
source: hosted
version: "2.18.1"
version: "4.2.0"
firebase_crashlytics_platform_interface:
dependency: transitive
description:
name: firebase_crashlytics_platform_interface
sha256: "4ddadf44ed0a202f3acad053f12c083877940fa8cc1a9f747ae09e1ef4372160"
url: "https://pub.dev"
source: hosted
version: "3.7.0"
firebase_messaging:
dependency: "direct main"
description:
Expand Down Expand Up @@ -627,10 +667,10 @@ packages:
dependency: "direct main"
description:
name: flutter_mailer
sha256: a935e9caa842877e8ed56109afb75b86e6488edbcd4696a5ac02b327a48fcd8a
sha256: "4fffaa35e911ff5ec2e5a4ebbca62c372e99a154eb3bb2c0bf79f09adf6ecf4c"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down

0 comments on commit 801b98d

Please sign in to comment.