mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-24 06:48:38 +02:00
feat: use better embedded Tor (#2453)
* feat: use better embedded Tor * update docs [skip ci] * fix: update torch properly add minimum os version for iOS * fix: use of invalid thread api on iOS * fix: disable use of lzma and zstd system libraries * fix: update torch_dart to work on linux
This commit is contained in:
@@ -8,7 +8,7 @@ class FeatureFlag {
|
||||
static const bool isCakePayRedemptionFlowEnabled = false;
|
||||
static const bool isExolixEnabled = true;
|
||||
static const bool isBackgroundSyncEnabled = true;
|
||||
static final bool isInAppTorEnabled = CakeTor.instance is! CakeTorDisabled;
|
||||
static bool get isInAppTorEnabled => CakeTor.instance is! CakeTorDisabled;
|
||||
static const int verificationWordsCount = kDebugMode ? 0 : 2;
|
||||
static const bool hasDevOptions = bool.fromEnvironment('hasDevOptions', defaultValue: kDebugMode);
|
||||
static const bool hasBitcoinViewOnly = true;
|
||||
|
||||
@@ -13,7 +13,7 @@ class ImageUtil {
|
||||
}) {
|
||||
bool isNetworkImage = imagePath.startsWith('http') || imagePath.startsWith('https');
|
||||
|
||||
if (CakeTor.instance.enabled && isNetworkImage) {
|
||||
if (CakeTor.instance!.enabled && isNetworkImage) {
|
||||
imagePath = "assets/images/tor_logo.svg";
|
||||
isNetworkImage = false;
|
||||
}
|
||||
|
||||
+6
-6
@@ -15,7 +15,7 @@ Future<void> ensureTorStopped({required BuildContext? context}) async {
|
||||
if (context != null) dialogContext = await showFullscreenDialog(context);
|
||||
didTorStart = false;
|
||||
printV("Stopping tor");
|
||||
await CakeTor.instance.stop();
|
||||
await CakeTor.instance!.stop();
|
||||
printV("Tor stopped");
|
||||
if (context != null) dismissFullscreenDialog(dialogContext!);
|
||||
}
|
||||
@@ -32,20 +32,20 @@ Future<void> ensureTorStarted({required BuildContext? context}) async {
|
||||
// var rootToken = RootIsolateToken.instance!;
|
||||
// await Isolate.run(() async {
|
||||
// BackgroundIsolateBinaryMessenger.ensureInitialized(rootToken);
|
||||
// await CakeTor.instance.start();
|
||||
// await CakeTor.instance!.start();
|
||||
// });
|
||||
// second start is fast but populates the values on current thread
|
||||
await CakeTor.instance.start();
|
||||
await CakeTor.instance!.start();
|
||||
printV("Tor started");
|
||||
while (!CakeTor.instance.started) {
|
||||
while (!CakeTor.instance!.started) {
|
||||
printV("Waiting for tor to start (part 1)");
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
}
|
||||
while (CakeTor.instance.port == -1) {
|
||||
while (CakeTor.instance!.port == -1) {
|
||||
printV("Waiting for tor to start (listening on port)");
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
}
|
||||
printV("Tor started on port ${CakeTor.instance.port}");
|
||||
printV("Tor started on port ${CakeTor.instance!.port}");
|
||||
if (context != null) dismissFullscreenDialog(dialogContext!);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user