Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: blockchainservice ANR's #1336

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
58b6a2b
feat: show platform version on AboutActivity
HashEngineering Nov 20, 2024
5125d25
chore: update to dashj 21.1.3-SNAPSHOT
HashEngineering Nov 20, 2024
17a214d
Rename .java to .kt
HashEngineering Nov 21, 2024
9127169
refactor: convert BlockchainServiceImpl to Java
HashEngineering Nov 21, 2024
4d7a378
refactor: use serviceScope for onStartCommand, onDestroy, onReceive
HashEngineering Nov 21, 2024
655d2e6
fix: various fixes
HashEngineering Nov 21, 2024
55e26c8
fix: propogate context
HashEngineering Nov 23, 2024
5474f28
refactor: update based on changes to dash-sdk-kotlin
HashEngineering Nov 23, 2024
9237a1c
fix: update copyright year to 2024
HashEngineering Nov 23, 2024
c9248c3
Merge branch 'bugfix-sync-stuck-31' into bugfix-sync-anr
HashEngineering Nov 25, 2024
837e7b7
fix: use DashSystem instead of Context
HashEngineering Nov 25, 2024
9a9f3e2
Merge branch 'master' of https://github.com/dashevo/dash-wallet into …
HashEngineering Dec 3, 2024
ae43499
fix: wait for shutdown when starting again after blockchain rescan
HashEngineering Dec 3, 2024
1044859
refactor: simplify Injected fields
HashEngineering Dec 3, 2024
51d7e55
feat: update tx list with observeTransactions
HashEngineering Dec 5, 2024
1f118ab
fix: adding tx in wrapper
HashEngineering Dec 12, 2024
eea84d3
fix: attempt to update tx lists
HashEngineering Dec 13, 2024
62ddb04
fix: attempt to update tx lists
HashEngineering Dec 13, 2024
70d5851
fix: attempt to update tx lists
HashEngineering Dec 13, 2024
0bde26c
fix: attempt to update tx lists
HashEngineering Dec 13, 2024
0504d80
fix: attempt to update tx lists
HashEngineering Dec 13, 2024
ea5e6d8
Merge branch 'master' of https://github.com/dashevo/dash-wallet into …
HashEngineering Dec 16, 2024
a799907
fix: improve WalletBalanceObserver
HashEngineering Dec 17, 2024
cbef776
fix: remove update functions from TransactionRowView
HashEngineering Dec 17, 2024
a934818
fix: use TransactionRowViewList
HashEngineering Dec 17, 2024
d2a1ea4
fix: improve TX details
HashEngineering Dec 17, 2024
61dc67d
fix: more improvements to MainViewModel
HashEngineering Dec 17, 2024
dce5f3d
fix: problems showing Tx details and going to home screen afterwards
HashEngineering Dec 20, 2024
3188687
Merge branch 'master' of https://github.com/dashevo/dash-wallet into …
HashEngineering Dec 20, 2024
8f31dd7
fix: always submit a new list for the UI
HashEngineering Dec 23, 2024
89ddbd3
fix: add reset listener
HashEngineering Dec 23, 2024
5065024
fix: add reset listener
HashEngineering Dec 23, 2024
2460673
fix: batch updates
HashEngineering Dec 23, 2024
5cf9bfe
fix: replace batch updates method and only process tx confidence chan…
HashEngineering Dec 24, 2024
0b2de89
fix: update dashj to 21.1.5-SNAPSHOT
HashEngineering Dec 24, 2024
63523d0
chore: refactor telephony manager usage
Syn-McJ Dec 26, 2024
d6ba862
chore: upgrade gradle & AGP
Syn-McJ Dec 27, 2024
9614e45
fix: mixing icon and row view id type
Syn-McJ Dec 30, 2024
a9b82e4
chore: upgrade kotlin & ksp to fix deadlock
Syn-McJ Dec 30, 2024
c5237a6
feat: performance, uncoupling metadata & contacts
Syn-McJ Jan 2, 2025
cea69eb
fix: confirmation dialog UI with contact
Syn-McJ Jan 3, 2025
f04c016
fix: observing contacts bugs
Syn-McJ Jan 3, 2025
9b533b0
fix: send to contact from send tab
Syn-McJ Jan 4, 2025
13bc173
fix: sticky info panel on EnterAmountFragment
Syn-McJ Jan 4, 2025
832e61f
chore: cleanup
Syn-McJ Jan 4, 2025
ad09410
fix: improve wipe function
HashEngineering Jan 5, 2025
4673895
chore: update dashj
HashEngineering Jan 5, 2025
586853f
Merge branch 'master' of https://github.com/dashevo/dash-wallet into …
HashEngineering Jan 5, 2025
dcb15c6
fix: update to v11.0.5 sync fix
HashEngineering Jan 5, 2025
70da95a
Rename .java to .kt
HashEngineering Jan 5, 2025
e17c2e1
fix: delete old files
HashEngineering Jan 5, 2025
c2c3b71
Merge branch 'master' into bugfix-observe-tx-improvements
Syn-McJ Jan 5, 2025
377b6d0
fix: more proguard rules
Syn-McJ Jan 5, 2025
3517048
fix: log date format attempted fix
Syn-McJ Jan 5, 2025
473b4e0
fix: attempting to fix log date format
Syn-McJ Jan 5, 2025
a932d19
fix: add logback to proguard
Syn-McJ Jan 5, 2025
1fd0565
chore: cleanup
Syn-McJ Jan 10, 2025
4eb98b1
fix: proper isComplete check for CrowdNode tx set
Syn-McJ Jan 12, 2025
f36d7e3
fix: change the way topup tx observed for CrowdNode
Syn-McJ Jan 13, 2025
b990fa0
fix: build error - missing file
Syn-McJ Jan 13, 2025
c8e1439
Merge branch 'bugfix-observe-tx-improvements' of https://github.com/d…
HashEngineering Jan 13, 2025
4a6107b
fix: update some function calls to include chainLockHeight
HashEngineering Jan 14, 2025
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
kotlin_version = '1.9.23'
coroutinesVersion = '1.6.4'
ok_http_version = '4.9.1'
dashjVersion = '21.1.3'
dashjVersion = '21.1.5-SNAPSHOT'
dppVersion = "1.5.1-SNAPSHOT"
hiltVersion = '2.51'
hiltCompilerVersion = '1.2.0'
Expand Down
2 changes: 1 addition & 1 deletion wallet/res/values-eo/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<string name="blockchain_state_progress_days">%1$s, %2$d tagoj malantaŭ</string>
<string name="blockchain_state_progress_weeks">%1$s, %2$d semajnoj malantaŭ</string>
<string name="blockchain_state_progress_months">%1$s, %2$d monatoj malantaŭ</string>
<string name="blockchain_state_progress_downloading">Sinkronigado kun reto</string>
<string name="blockchain_state_progress_downloading">Sinkronigado kun reto (%1$s%%)</string>
<string name="blockchain_state_progress_stalled">Sinkronigo stagnis</string>
<string name="blockchain_state_progress_problem_storage">Sinkronigado: Stokante problemo</string>
<string name="blockchain_state_progress_problem_network">Sinkronigado: Reta problemo</string>
Expand Down
2 changes: 1 addition & 1 deletion wallet/res/values-he/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<string name="blockchain_state_progress_days">%1$s, %2$d ימי איחור</string>
<string name="blockchain_state_progress_weeks">%1$s, %2$d שבועות איחור</string>
<string name="blockchain_state_progress_months">%1$s, %2$d חודשי איחור</string>
<string name="blockchain_state_progress_downloading">מסנכרן רשת</string>
<string name="blockchain_state_progress_downloading">(%1$s%%) מסנכרן רשת</string>
<string name="blockchain_state_progress_stalled">סינכרון עוקב</string>
<string name="blockchain_state_progress_problem_storage">סינכרון: בעיית אחסון</string>
<string name="blockchain_state_progress_problem_network">סינכרון:בעיית רשת</string>
Expand Down
2 changes: 1 addition & 1 deletion wallet/res/values-hr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<string name="blockchain_state_progress_days">%1$s, %2$d dani iza</string>
<string name="blockchain_state_progress_weeks">%1$s, %2$d tjedana iza</string>
<string name="blockchain_state_progress_months">%1$s, %2$d mjeseci iza</string>
<string name="blockchain_state_progress_downloading">Sinkroniziranje sa mrežom</string>
<string name="blockchain_state_progress_downloading">Sinkroniziranje sa mrežom (%1$s%%)</string>
<string name="blockchain_state_progress_stalled">Sinkronizacija u zastoju</string>
<string name="blockchain_state_progress_problem_storage">Sinkroniziranje: Spremišni problem</string>
<string name="blockchain_state_progress_problem_network">Sinkroniziranje: Mrežni problem</string>
Expand Down
2 changes: 1 addition & 1 deletion wallet/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<string name="blockchain_state_progress_days">%1$s, %2$d ימי איחור</string>
<string name="blockchain_state_progress_weeks">%1$s, %2$d שבועות איחור</string>
<string name="blockchain_state_progress_months">%1$s, %2$d חודשי איחור</string>
<string name="blockchain_state_progress_downloading">מסנכרן רשת</string>
<string name="blockchain_state_progress_downloading">מסנכרן רשת (%1$s%%)</string>
<string name="blockchain_state_progress_stalled">סינכרון עוקב</string>
<string name="blockchain_state_progress_problem_storage">סינכרון: בעיית אחסון</string>
<string name="blockchain_state_progress_problem_network">סינכרון:בעיית רשת</string>
Expand Down
2 changes: 1 addition & 1 deletion wallet/res/values-mk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<string name="blockchain_state_progress_days">%1$s, %2$d денови заостанува</string>
<string name="blockchain_state_progress_weeks">%1$s, %2$d недели заостанува</string>
<string name="blockchain_state_progress_months">%1$s, %2$d месеци заостанува</string>
<string name="blockchain_state_progress_downloading">Се синхронизира со мрежата</string>
<string name="blockchain_state_progress_downloading">Се синхронизира со мрежата (%1$s%%)</string>
<string name="blockchain_state_progress_stalled">Синхронизацијата застана</string>
<string name="blockchain_state_progress_problem_storage">Се синхронизира: Проблем со простор за складирање</string>
<string name="blockchain_state_progress_problem_network">Се синхронизира: Проблем со мрежата</string>
Expand Down
2 changes: 1 addition & 1 deletion wallet/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<string name="blockchain_state_progress_days">siku %1$s, %2$d mwishoni mwa</string>
<string name="blockchain_state_progress_weeks">wiki %1$s, %2$d marehemu</string>
<string name="blockchain_state_progress_months">miezi %1$s, %2$d marehemu</string>
<string name="blockchain_state_progress_downloading">Sambamba na mtandao</string>
<string name="blockchain_state_progress_downloading">Sambamba na mtandao (%1$s%%)</string>
<string name="blockchain_state_progress_stalled">Sambamba kusimamishwa</string>
<string name="blockchain_state_progress_problem_storage">Haitoshi disc nafasi</string>
<string name="blockchain_state_progress_problem_network">Hakuna signal wa mtandao</string>
Expand Down
14 changes: 11 additions & 3 deletions wallet/src/de/schildbach/wallet/WalletApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.bitcoinj.core.TransactionBag;
import org.bitcoinj.core.VerificationException;
import org.bitcoinj.crypto.LinuxSecureRandom;
import org.bitcoinj.manager.DashSystem;
import org.bitcoinj.utils.Threading;
import org.bitcoinj.core.VersionMessage;
import org.bitcoinj.crypto.IKey;
Expand Down Expand Up @@ -90,6 +91,7 @@
import ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy;
import ch.qos.logback.core.util.FileSize;
import de.schildbach.wallet.service.BlockchainStateDataProvider;
import de.schildbach.wallet.service.DashSystemService;
import de.schildbach.wallet.service.PackageInfoProvider;
import de.schildbach.wallet.service.WalletFactory;
import de.schildbach.wallet.transactions.MasternodeObserver;
Expand Down Expand Up @@ -172,7 +174,6 @@ public class WalletApplication extends MultiDexApplication

private File walletFile;
private Wallet wallet;

public static final String ACTION_WALLET_REFERENCE_CHANGED = WalletApplication.class.getPackage().getName()
+ ".wallet_reference_changed";

Expand All @@ -190,6 +191,7 @@ public class WalletApplication extends MultiDexApplication

private AutoLogout autoLogout;
private AnrSupervisor anrSupervisor;
private Function0 afterWipeFunction;

@Inject
RestartService restartService;
Expand All @@ -211,6 +213,8 @@ public class WalletApplication extends MultiDexApplication
PackageInfoProvider packageInfoProvider;
@Inject
WalletFactory walletFactory;
@Inject
DashSystemService dashSystemService;

@Override
protected void attachBaseContext(Context base) {
Expand Down Expand Up @@ -431,7 +435,7 @@ public void saveWalletAndFinalizeInitialization() {
}

public void finalizeInitialization() {
wallet.getContext().initDash(true, true, Constants.SYNC_FLAGS, Constants.VERIFY_FLAGS);
dashSystemService.getSystem().initDash(true, true, Constants.SYNC_FLAGS, Constants.VERIFY_FLAGS);

if (config.versionCodeCrossed(packageInfoProvider.getVersionCode(), VERSION_CODE_SHOW_BACKUP_REMINDER)
&& !wallet.getImportedKeys().isEmpty()) {
Expand Down Expand Up @@ -972,8 +976,9 @@ else if (lastUsedAgo < Constants.LAST_USAGE_THRESHOLD_RECENTLY_MS)
/**
* Removes all the data and restarts the app showing onboarding screen.
*/
public void triggerWipe() {
public void triggerWipe(Function0 afterWipeFunction) {
log.info("Removing all the data and restarting the app.");
this.afterWipeFunction = afterWipeFunction;
startService(new Intent(BlockchainService.ACTION_WIPE_WALLET, null, this, BlockchainServiceImpl.class));
}

Expand Down Expand Up @@ -1016,6 +1021,9 @@ public void finalizeWipe() {
// wallet must be null for the OnboardingActivity flow
log.info("removing wallet from memory during wipe");
wallet = null;
if (afterWipeFunction != null)
afterWipeFunction.invoke();
afterWipeFunction = null;
}

public AnalyticsService getAnalyticsService() {
Expand Down
4 changes: 4 additions & 0 deletions wallet/src/de/schildbach/wallet/di/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,8 @@ abstract class AppModule {
@Binds
@Singleton
abstract fun bindZenLedgerClient(zenLedgerClient: ZenLedgerClient): ZenLedgerApi

@Singleton
@Binds
abstract fun provideDashSystemService(dashSystemService: DashSystemServiceImpl): DashSystemService
}
Loading