diff --git a/.github/workflows/pr_test_build_android.yml b/.github/workflows/pr_test_build_android.yml index 1b1566aba..f6d203331 100644 --- a/.github/workflows/pr_test_build_android.yml +++ b/.github/workflows/pr_test_build_android.yml @@ -61,6 +61,14 @@ jobs: sudo apt update sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang + + - name: Clone Repo + run: | + sudo mkdir -p /opt/android + sudo chown $USER /opt/android + cd /opt/android + git clone https://github.com/cake-tech/cake_wallet.git --branch ${{ env.BRANCH_NAME }} + - name: Cache Keystore id: cache-keystore uses: actions/cache@v3 @@ -76,12 +84,9 @@ jobs: - name: Execute Build and Setup Commands run: | - sudo mkdir -p /opt/android - sudo chown $USER /opt/android cd /opt/android -y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh cargo install cargo-ndk - git clone https://github.com/cake-tech/cake_wallet.git --branch ${{ env.BRANCH_NAME }} cd cake_wallet/scripts/android/ ./install_ndk.sh source ./app_env.sh cakewallet diff --git a/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart b/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart index fad86e94d..64e8f3aab 100644 --- a/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart +++ b/lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart @@ -198,8 +198,9 @@ class TOTPEnterCode extends BasePage { }, ); if (isForSetup && result) { - Navigator.pushReplacementNamed( - context, Routes.modify2FAPage); + if (context.mounted) { + Navigator.pushReplacementNamed(context, Routes.modify2FAPage); + } } }, diff --git a/lib/utils/exception_handler.dart b/lib/utils/exception_handler.dart index f7fc3684e..d79dfe314 100644 --- a/lib/utils/exception_handler.dart +++ b/lib/utils/exception_handler.dart @@ -1,9 +1,11 @@ import 'dart:io'; +import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; +import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cw_core/root_dir.dart'; @@ -29,9 +31,21 @@ class ExceptionHandler { _file = File('${appDocDir.path}/error.txt'); } + String? walletType; + CustomTrace? programInfo; + + try { + walletType = getIt.get().wallet?.type.name; + + programInfo = CustomTrace(stackTrace ?? StackTrace.current); + } catch (_) {} + final exception = { "${DateTime.now()}": { "Error": "$error\n\n", + "WalletType": "$walletType\n\n", + "VerboseLog": + "${programInfo?.fileName}#${programInfo?.lineNumber}:${programInfo?.columnNumber} ${programInfo?.callerFunctionName}\n\n", "Library": "$library\n\n", "StackTrace": stackTrace.toString(), }