Skip to content

Commit

Permalink
Merge branch 'main' into CW-829-Solana-Enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarHatem28 authored Dec 10, 2024
2 parents e7967b9 + ed600f9 commit 4f31be6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 27 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/cache_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,11 @@ jobs:
source ./app_env.sh cakewallet
./build_monero_all.sh
- name: Set up cache path
id: cache-path
run: echo "cache-file-path=/opt/android/cake_wallet/android/app/key.jks" >> $GITHUB_ENV

- name: Cache Keystore
id: cache-keystore
uses: actions/cache@v3
with:
path: ${{ env.cache-file-path }}
path: /opt/android/cake_wallet/android/app
key: keystore

- if: ${{ steps.cache-keystore.outputs.cache-hit != 'true' }}
Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/pr_test_build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,32 @@ jobs:
sudo apt update
sudo apt-get install -y curl unzip automake build-essential file pkg-config git python libtool libtinfo5 cmake clang
- name: Execute Build and Setup Commands
- 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
# with:
# path: /opt/android/cake_wallet/android/app
# key: keystore
#
# - if: ${{ steps.cache-keystore.outputs.cache-hit != 'true' }}
- name: Generate KeyStore
run: |
cd /opt/android/cake_wallet/android/app
keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass $STORE_PASS -keypass $KEY_PASS
- name: Execute Build and Setup Commands
run: |
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
Expand Down Expand Up @@ -115,24 +133,6 @@ jobs:
cd /opt/android/cake_wallet/scripts/android/
./build_mwebd.sh --dont-install
- name: Set up cache path
id: cache-path
run: echo "cache-file-path=/opt/android/cake_wallet/android/app/key.jks" >> $GITHUB_ENV

- name: Cache Keystore
id: cache-keystore
uses: actions/cache@v3
with:
path: ${{ env.cache-file-path }}
key: keystore

- if: ${{ steps.cache-keystore.outputs.cache-hit != 'true' }}
name: Generate KeyStore
run: |
cd /opt/android/cake_wallet/android/app
keytool -genkey -v -keystore key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias testKey -noprompt -dname "CN=CakeWallet, OU=CakeWallet, O=CakeWallet, L=Florida, S=America, C=USA" -storepass $STORE_PASS -keypass $KEY_PASS
- name: Generate key properties
run: |
cd /opt/android/cake_wallet
Expand Down
5 changes: 3 additions & 2 deletions lib/src/screens/setup_2fa/setup_2fa_enter_code_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ class TOTPEnterCode extends BasePage {
},
);
if (isForSetup && result) {
Navigator.pushReplacementNamed(
context, Routes.modify2FAPage);
if (context.mounted) {
Navigator.pushReplacementNamed(context, Routes.modify2FAPage);
}
}

},
Expand Down
14 changes: 14 additions & 0 deletions lib/utils/exception_handler.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -29,9 +31,21 @@ class ExceptionHandler {
_file = File('${appDocDir.path}/error.txt');
}

String? walletType;
CustomTrace? programInfo;

try {
walletType = getIt.get<AppStore>().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(),
}
Expand Down

0 comments on commit 4f31be6

Please sign in to comment.