Skip to content

Commit

Permalink
Merge pull request #149 from MXCzkEVM/pre_main_qa
Browse files Browse the repository at this point in the history
Pre main qa
  • Loading branch information
reasje authored Jan 9, 2025
2 parents c4270b6 + a539f26 commit 09fd185
Show file tree
Hide file tree
Showing 39 changed files with 509 additions and 332 deletions.
8 changes: 5 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 34
namespace "com.moonchain.app"

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion "33.0.1"
ndkVersion flutter.ndkVersion

Expand All @@ -60,7 +62,7 @@ android {
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
targetSdkVersion 34
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode System.getenv('VERSION_CODE')?.hashCode()?.abs() ?: 404
versionName flutterVersionName
}
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
7 changes: 7 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

<!-- Used for force removal of Google add id, Because one of
3rd party SDk was injecting It in merged Manifest in build/app/intermediates/merged_manifests/productDebug/AndroidManifest.xml -->
<!-- Should be removed If analytics is added and in
Google play console we need to tell them we this add id for analytics
https://stackoverflow.com/questions/73129574/you-cant-submit-updates-as-some-information-about-your-app-is-incomplete-googl -->
<!-- <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" /> -->

<!-- legacy for Android 11 or lower -->
<!-- <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" /> -->
Expand Down
21 changes: 19 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,23 @@ allprojects {
url "${project(':background_fetch').projectDir}/libs"
}
}

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

ext {
compileSdkVersion = 34
targetSdkVersion = 34
}

rootProject.buildDir = '../build'
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"}}}}}}
26 changes: 26 additions & 0 deletions ios/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
PrivacyInfo.xcprivacy
Runner
Created by Reza on 12/13/24.
Copyright (c) 2024 . All rights reserved.
-->
<plist version="1.0">
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<!-- [1] background_fetch: UserDefaults -->
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>

<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
</dict>
</plist>
23 changes: 23 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
0056F8382D0C2A050080BAFB /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0056F8372D0C2A050080BAFB /* PrivacyInfo.xcprivacy */; };
04AD4F67A3C80B4D8D21E1D5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9AA8843D70E9DCF281E30EE /* Pods_Runner.framework */; };
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
Expand All @@ -31,6 +32,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0056F8372D0C2A050080BAFB /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
00B871672B0DE8FE007D0206 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -96,6 +98,7 @@
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
0056F8372D0C2A050080BAFB /* PrivacyInfo.xcprivacy */,
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
Expand Down Expand Up @@ -145,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 @@ -193,6 +197,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0056F8382D0C2A050080BAFB /* PrivacyInfo.xcprivacy in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
Expand Down Expand Up @@ -237,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
8 changes: 4 additions & 4 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<key>BGTaskSchedulerPermittedIdentifiers</key>
<array>
<string>com.transistorsoft.fetch</string>
<string>com.moonchain.mxc.notificationsTask</string>
<string>com.moonchain.mxc.wifiHooksTask</string>
<string>com.moonchain.mxc.minerAutoClaimTask</string>
<string>com.moonchain.mxc.blueberryAutoSyncTask</string>
<string>com.transistorsoft.notificationsTask</string>
<string>com.transistorsoft.wifiHooksTask</string>
<string>com.transistorsoft.minerAutoClaimTask</string>
<string>com.transistorsoft.blueberryAutoSyncTask</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,25 @@ class SpeedUpCancelBottomSheetInfo extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...notice(context),
SingleLineInfoItem(
title: 'estimated_fee',
value: MXCFormatter.formatNumberForUI(
estimatedFee,
),
hint: symbol,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...notice(context),
SingleLineInfoItem(
title: 'estimated_fee',
value: MXCFormatter.formatNumberForUI(
estimatedFee,
),
SingleLineInfoItem(
title: 'max_fee',
value: MXCFormatter.formatNumberForUI(
maxFee,
),
hint: symbol,
hint: symbol,
),
SingleLineInfoItem(
title: 'max_fee',
value: MXCFormatter.formatNumberForUI(
maxFee,
),
],
),
hint: symbol,
),
],
),
const SizedBox(height: Sizes.spaceXSmall),
submitButton(context),
Expand Down
1 change: 0 additions & 1 deletion lib/common/utils/permission.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class PermissionUtils {

static Future<bool> checkNotificationPermission() async {
AuthorizationStatus authorizationStatus = await getNotificationPermission();

return authorizationStatus == AuthorizationStatus.authorized ||
authorizationStatus == AuthorizationStatus.provisional;
}
Expand Down
15 changes: 14 additions & 1 deletion lib/core/src/background_process/notifications_service.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:background_fetch/background_fetch.dart';
import 'package:moonchain_wallet/app/logger.dart';
import 'package:moonchain_wallet/core/core.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:mxc_logic/mxc_logic.dart';
Expand Down Expand Up @@ -48,20 +49,24 @@ class NotificationsService {
final lowBatteryEnabled = periodicalCallData.lowBatteryEnabled;

// Make sure user is logged in
print("isLoggedIn : $isLoggedIn, serviceEnabled : $serviceEnabled" );
if (isLoggedIn && MXCChains.isMXCChains(chainId) && serviceEnabled) {
await MoonchainWalletNotification()
.setupFlutterNotifications(shouldInitFirebase: false);

print('lowBalanceLimitEnabled: $lowBalanceLimitEnabled');
if (lowBalanceLimitEnabled) {
await backgroundFetchConfigUseCase.checkLowBalance(
account!, lowBalanceLimit);
}

print('expectedTransactionFeeEnabled: $expectedTransactionFeeEnabled');
if (expectedTransactionFeeEnabled) {
await backgroundFetchConfigUseCase
.checkTransactionFee(expectedTransactionFee);
}

print('expectedEpochOccurrenceEnabled: $expectedEpochOccurrenceEnabled');
if (expectedEpochOccurrenceEnabled) {
periodicalCallData =
await backgroundFetchConfigUseCase.checkEpochOccur(
Expand All @@ -71,30 +76,38 @@ class NotificationsService {
chainId);
}

print('activityReminderEnabled: $activityReminderEnabled');
if (activityReminderEnabled) {
await blueberryRingBackgroundNotificationsUseCase
.checkActivityReminder();
}

print('sleepInsightEnabled: $sleepInsightEnabled');
if (sleepInsightEnabled) {
await blueberryRingBackgroundNotificationsUseCase.checkSleepInsight();
}

print('heartAlertEnabled: $heartAlertEnabled');
if (heartAlertEnabled) {
await blueberryRingBackgroundNotificationsUseCase.checkHeartAlert();
}

print('lowBatteryEnabled: $lowBatteryEnabled');
if (lowBatteryEnabled) {
await blueberryRingBackgroundNotificationsUseCase.checkLowBattery();
}

print('periodicalCallData: ${periodicalCallData.toString()}');
backgroundFetchConfigUseCase.updateItem(periodicalCallData);
BackgroundFetch.finish(taskId);
} else {
print("Terminating background service because conditions doesn't meet" );
// terminate background fetch
BackgroundFetch.stop(taskId);
}
} catch (e) {
} catch (e, s) {
print("Background fetch ERROR : $e" );
print("Background fetch stacktrace : $s" );
BackgroundFetch.finish(taskId);
}
}
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
Loading

0 comments on commit 09fd185

Please sign in to comment.