Skip to content
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
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.35.4"
}
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ devtools_options.yaml
.vscode/launch.json
non_translated_keys.txt

.codegpt
.codegpt

# FVM Version Cache
.fvm/

# Generated localization files
lib/l10n/app_localizations.dart
lib/l10n/app_localizations_*.dart
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{}
{
"dart.flutterSdkPath": ".fvm/versions/3.35.4",
"dart.sdkPath": ".fvm/versions/3.35.4/bin/cache/dart-sdk"
}
24 changes: 20 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

def flutterNdkVersion = localProperties.getProperty('flutter.ndkVersion')
if (flutterNdkVersion == null) {
flutterNdkVersion = flutter.ndkVersion
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
Expand All @@ -30,8 +35,8 @@ if (flutterVersionName == null) {

android {
namespace "org.qubic.wallet"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileSdkVersion 35
ndkVersion "28.2.13676358"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -51,10 +56,21 @@ 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 flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
minSdkVersion flutter.minSdkVersion
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

ndk {
// Ensure we build for 64-bit architectures required for 16KB alignment
abiFilters 'arm64-v8a', 'x86_64'
}
}

packagingOptions {
jniLibs {
useLegacyPackaging = false
}
}

signingConfigs {
Expand Down
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ allprojects {
if (project.plugins.hasPlugin("com.android.application") ||
project.plugins.hasPlugin("com.android.library")) {
project.android {
compileSdkVersion 34
compileSdkVersion 35
ndkVersion "28.2.13676358"
if (!project.android.hasProperty("namespace") || project.android.namespace == null) {
namespace project.group
}
Expand Down
2 changes: 2 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.bundle.enableUncompressedNativeLibs=true

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-8.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
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 "8.1.2" apply false
id "org.jetbrains.kotlin.android" version "1.8.0" apply false
id "com.android.application" version "8.12.2" apply false
id "org.jetbrains.kotlin.android" version "2.2.10" apply false
}

include ":app"
72 changes: 72 additions & 0 deletions check_elf_alignment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# check_elf_alignment.sh
# Checks if all .so files in an APK/AAB are 16KB page-aligned.
# Usage:

# For a release APK:
# flutter build apk --release
# ./check_elf_alignment.sh build/app/outputs/flutter-apk/app-release.apk

# For an app bundle (AAB):
# flutter build appbundle --release
# ./check_elf_alignment.sh build/app/outputs/bundle/release/app-release.aab


if [ -z "$1" ]; then
echo "Usage: $0 <path-to-apk-or-aab>"
exit 1
fi

FILE=$1
TEMP_DIR=$(mktemp -d)

trap 'rm -rf "$TEMP_DIR"' EXIT

echo "Extracting $FILE..."
if [[ $FILE == *.apk ]] || [[ $FILE == *.aab ]]; then
unzip -o -q "$FILE" -d "$TEMP_DIR"
else
echo "Unsupported file type. Use .apk or .aab"
exit 1
fi

# Search for readelf or llvm-readelf
READELF_BIN=$(which readelf || which llvm-readelf)

if [ -z "$READELF_BIN" ]; then
# Try to find it in common NDK locations on macOS
NDK_ROOT="$HOME/Library/Android/sdk/ndk"
READELF_BIN=$(find "$NDK_ROOT" -name "llvm-readelf" | head -n 1)
fi

if [ -z "$READELF_BIN" ]; then
echo "❌ Error: 'readelf' or 'llvm-readelf' not found."
echo "Please install the Android NDK or 'binutils' (brew install binutils)."
exit 1
fi

echo "Checking ELF alignment for $FILE using $READELF_BIN..."
echo "------------------------------------------------"

# Find all .so files
find "$TEMP_DIR" -name "*.so" | while read -r lib; do
# Get the alignment of the first LOAD segment
# 0x4000 = 16384 bytes = 16KB
# 0x10000 = 65536 bytes = 64KB
alignment_hex=$($READELF_BIN -l "$lib" | grep LOAD | head -n 1 | awk '{print $NF}')

# Convert hex to decimal if needed
if [[ $alignment_hex == 0x* ]]; then
alignment_dec=$((alignment_hex))
else
alignment_dec=$alignment_hex
fi

lib_name=$(basename "$lib")
if [ "$alignment_dec" -ge 16384 ]; then
echo "✅ [PASS] $lib_name is aligned to $alignment_hex ($alignment_dec bytes)"
else
echo "❌ [FAIL] $lib_name is NOT 16KB aligned ($alignment_hex)"
fi
done
3 changes: 1 addition & 2 deletions lib/components/bottom_bar/bottom_nav_bar_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ class BottomNavBarBuilder extends StatelessWidget {
@override
Widget build(BuildContext context) => DecoratedNavBar(
decoration: navBarDecoration,
filter: navBarDecoration.filter,
height: navBarConfig.navBarHeight,
height: 60,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: navBarConfig.items.map((item) {
Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/l10n.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:qubic_wallet/l10n/app_localizations.dart';
import 'package:qubic_wallet/globals/localization_manager.dart';

export 'package:flutter_gen/gen_l10n/app_localizations.dart';
export 'package:qubic_wallet/l10n/app_localizations.dart';

AppLocalizations l10nOf(BuildContext context) {
if (!LocalizationManager.instance.isInitialized) {
Expand Down
33 changes: 16 additions & 17 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:async';

import 'package:app_links/app_links.dart';
import 'package:blur/blur.dart';
import 'package:flex_color_scheme/flex_color_scheme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:package_info_plus/package_info_plus.dart';
Expand All @@ -27,12 +26,14 @@ Future<void> main() async {
try {
await setupDI(); //Dependency injection
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Colors.transparent,
));
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
statusBarBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Colors.transparent,
),
);

await PlatformSpecificInitilization().run();
getIt.get<SettingsStore>().loadSettings();
Expand Down Expand Up @@ -119,7 +120,7 @@ class _WalletAppState extends State<WalletApp> with WidgetsBindingObserver {
// same or higher package version, but still same major version. If you
// use a lower package version, some properties may not be supported.
// In that case remove them after copying this theme to your app.
theme: FlexThemeData.dark(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(
brightness: Brightness.dark,
primary: LightThemeColors.primary,
Expand All @@ -135,15 +136,15 @@ class _WalletAppState extends State<WalletApp> with WidgetsBindingObserver {
),

useMaterial3: true,
visualDensity: VisualDensity.adaptivePlatformDensity,
scaffoldBackgroundColor: LightThemeColors.background,
// To use the Playground font, add GoogleFonts package and uncomment
fontFamily: ThemeFonts.primary,
surfaceMode: FlexSurfaceMode.highScaffoldLowSurface,
blendLevel: 2,
visualDensity: FlexColorScheme.comfortablePlatformDensity,
).copyWith(
filledButtonTheme: FilledButtonThemeData(
style: ButtonStyles.primaryButtonBig,
)),
filledButtonTheme: FilledButtonThemeData(
style: ButtonStyles.primaryButtonBig,
),
),
builder: (context, child) {
final localizations = AppLocalizations.of(context);
if (localizations != null) {
Expand All @@ -159,9 +160,7 @@ class _WalletAppState extends State<WalletApp> with WidgetsBindingObserver {
blur: 21.0,
colorOpacity: 0.5,
blurColor: Colors.black,
child: Container(
color: Colors.black.withValues(alpha: 0.2),
),
child: Container(color: Colors.black.withValues(alpha: 0.2)),
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/main/main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class _MainScreenState extends State<MainScreen> with WidgetsBindingObserver {
if (error != "") {
//Error overriding for more than max accounts in wallet
if (error == "Failed to perform action. Server returned status 400") {
if (applicationStore.currentQubicIDs.length > Config.maxAccountsInWallet) {
if (applicationStore.currentQubicIDs.length >
Config.maxAccountsInWallet) {
return;
}
}
Expand Down Expand Up @@ -307,7 +308,6 @@ class _MainScreenState extends State<MainScreen> with WidgetsBindingObserver {
// _controller.jumpToPreviousTab();
return PersistentTabView(
controller: _controller,
navBarHeight: 60,
navBarBuilder: (navBarConfig) => Style1BottomNavBar(
navBarConfig: navBarConfig,
navBarDecoration: const NavBarDecoration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class _AddWalletConnectState extends State<AddWalletConnect> {
pairingTimer?.cancel();
existsTimer?.cancel();
if (args != null) {
log(args.toString());
wcPairingId = args.id;
wcPairingMetadata = args.params.proposer.metadata;
//Automatic parsing (with registering events and methods)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class _AddWalletConnectMobileViewState
torchEnabled: false,
),
onDetect: widget.onDetect,
errorBuilder: (context, error, child) {
errorBuilder: (context, error) {
return Material(
child: Center(
child: Padding(
Expand Down
2 changes: 1 addition & 1 deletion lib/services/qr_scanner_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class QrScannerService {
children: [
MobileScanner(
controller: controller,
errorBuilder: (context, error, _) {
errorBuilder: (context, error) {
return Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 50),
Expand Down
8 changes: 4 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
#include <gtk/gtk_plugin.h>
#include <screen_retriever/screen_retriever_plugin.h>
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>

Expand All @@ -19,9 +19,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) gtk_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
gtk_plugin_register_with_registrar(gtk_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
2 changes: 1 addition & 1 deletion linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
list(APPEND FLUTTER_PLUGIN_LIST
flutter_secure_storage_linux
gtk
screen_retriever
screen_retriever_linux
url_launcher_linux
window_manager
)
Expand Down
8 changes: 5 additions & 3 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import app_links
import connectivity_plus
import cryptography_flutter
import downloadsfolder
import file_picker
import flutter_inappwebview_macos
import flutter_secure_storage_macos
import local_auth_darwin
import mobile_scanner
import no_screenshot
import package_info_plus
import path_provider_foundation
import screen_retriever
import screen_retriever_macos
import share_plus
import shared_preferences_foundation
import sqflite_darwin
Expand All @@ -28,14 +29,15 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin"))
CryptographyFlutterPlugin.register(with: registry.registrar(forPlugin: "CryptographyFlutterPlugin"))
DownloadsfolderPlugin.register(with: registry.registrar(forPlugin: "DownloadsfolderPlugin"))
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))
LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
NoScreenshotPlugin.register(with: registry.registrar(forPlugin: "NoScreenshotPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
Expand Down
Loading