Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hv * Change build version
- Loading branch information
Showing
213 changed files
with
23,969 additions
and
669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
android/app/src/main/java/com/cakewallet/haven/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.cakewallet.haven; | ||
|
||
import io.flutter.app.FlutterApplication; | ||
import io.flutter.plugin.common.PluginRegistry; | ||
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback; | ||
import io.flutter.plugins.GeneratedPluginRegistrant; | ||
|
||
public class Application extends FlutterApplication implements PluginRegistrantCallback { | ||
@Override | ||
public void registerWith(PluginRegistry registry) {} | ||
} |
90 changes: 90 additions & 0 deletions
90
android/app/src/main/java/com/cakewallet/haven/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package com.cakewallet.haven; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import io.flutter.embedding.android.FlutterFragmentActivity; | ||
import io.flutter.embedding.engine.FlutterEngine; | ||
import io.flutter.plugins.GeneratedPluginRegistrant; | ||
|
||
import io.flutter.plugin.common.MethodCall; | ||
import io.flutter.plugin.common.MethodChannel; | ||
|
||
import android.os.AsyncTask; | ||
import android.os.Build; | ||
import android.os.Handler; | ||
import android.os.Looper; | ||
import android.view.WindowManager; | ||
|
||
import com.unstoppabledomains.resolution.DomainResolution; | ||
import com.unstoppabledomains.resolution.Resolution; | ||
|
||
import java.security.SecureRandom; | ||
|
||
public class MainActivity extends FlutterFragmentActivity { | ||
final String UTILS_CHANNEL = "com.cake_wallet/native_utils"; | ||
final int UNSTOPPABLE_DOMAIN_MIN_VERSION_SDK = 24; | ||
|
||
@Override | ||
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { | ||
GeneratedPluginRegistrant.registerWith(flutterEngine); | ||
|
||
MethodChannel utilsChannel = | ||
new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), | ||
UTILS_CHANNEL); | ||
|
||
utilsChannel.setMethodCallHandler(this::handle); | ||
} | ||
|
||
private void handle(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { | ||
Handler handler = new Handler(Looper.getMainLooper()); | ||
|
||
try { | ||
switch (call.method) { | ||
case "enableWakeScreen": | ||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | ||
handler.post(() -> result.success(true)); | ||
break; | ||
case "disableWakeScreen": | ||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | ||
handler.post(() -> result.success(true)); | ||
break; | ||
case "sec_random": | ||
int count = call.argument("count"); | ||
SecureRandom random = new SecureRandom(); | ||
byte bytes[] = new byte[count]; | ||
random.nextBytes(bytes); | ||
handler.post(() -> result.success(bytes)); | ||
break; | ||
case "getUnstoppableDomainAddress": | ||
int version = Build.VERSION.SDK_INT; | ||
if (version >= UNSTOPPABLE_DOMAIN_MIN_VERSION_SDK) { | ||
getUnstoppableDomainAddress(call, result); | ||
} else { | ||
handler.post(() -> result.success("")); | ||
} | ||
break; | ||
default: | ||
handler.post(() -> result.notImplemented()); | ||
} | ||
} catch (Exception e) { | ||
handler.post(() -> result.error("UNCAUGHT_ERROR", e.getMessage(), null)); | ||
} | ||
} | ||
|
||
private void getUnstoppableDomainAddress(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { | ||
DomainResolution resolution = new Resolution(); | ||
Handler handler = new Handler(Looper.getMainLooper()); | ||
String domain = call.argument("domain"); | ||
String ticker = call.argument("ticker"); | ||
|
||
AsyncTask.execute(() -> { | ||
try { | ||
String address = resolution.getAddress(domain, ticker); | ||
handler.post(() -> result.success(address)); | ||
} catch (Exception e) { | ||
System.out.println("Expected Address, but got " + e.getMessage()); | ||
handler.post(() -> result.success("")); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- | ||
uri: vault.havenprotocol.org:443 | ||
login: super | ||
password: super | ||
useSSL: true | ||
is_default: true |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import 'package:cw_monero/api/structs/account_row.dart'; | ||
|
||
class Account { | ||
Account({this.id, this.label}); | ||
|
||
Account.fromMap(Map map) | ||
: this.id = map['id'] == null ? 0 : int.parse(map['id'] as String), | ||
this.label = (map['label'] ?? '') as String; | ||
|
||
Account.fromRow(AccountRow row) | ||
: this.id = row.getId(), | ||
this.label = row.getLabel(); | ||
|
||
final int id; | ||
final String label; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import 'package:mobx/mobx.dart'; | ||
|
||
abstract class AccountList<T> { | ||
|
||
ObservableList<T> get accounts; | ||
|
||
void update(); | ||
|
||
List<T> getAll(); | ||
|
||
Future addAccount({String label}); | ||
|
||
Future setLabelAccount({int accountIndex, String label}); | ||
|
||
void refresh(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cw_monero/lib/monero_balance.dart → cw_core/lib/monero_balance.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class Subaddress { | ||
Subaddress({this.id, this.address, this.label}); | ||
|
||
Subaddress.fromMap(Map map) | ||
: this.id = map['id'] == null ? 0 : int.parse(map['id'] as String), | ||
this.address = (map['address'] ?? '') as String, | ||
this.label = (map['label'] ?? '') as String; | ||
|
||
final int id; | ||
final String address; | ||
final String label; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:cw_core/wallet_addresses.dart'; | ||
import 'package:cw_core/account_list.dart'; | ||
import 'package:cw_core/wallet_info.dart'; | ||
|
||
abstract class WalletAddressesWithAccount<T> extends WalletAddresses { | ||
WalletAddressesWithAccount(WalletInfo walletInfo) : super(walletInfo); | ||
|
||
T get account; | ||
|
||
set account(T account); | ||
|
||
AccountList<T> get accountList; | ||
} |
Oops, something went wrong.