disable ledger support (#547)

This commit is contained in:
m2049r 2019-03-05 23:35:11 +01:00 committed by GitHub
parent 06456e33e4
commit de8de02f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 26 deletions

View File

@ -7,8 +7,8 @@ android {
applicationId "com.m2049r.xmrwallet" applicationId "com.m2049r.xmrwallet"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 171 versionCode 172
versionName "1.11.1 'Chernushka'" versionName "1.11.2 'Chernushka'"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild { externalNativeBuild {

View File

@ -1361,6 +1361,7 @@ public class LoginActivity extends BaseActivity
}; };
private void connectLedger(UsbManager usbManager, final UsbDevice usbDevice) { private void connectLedger(UsbManager usbManager, final UsbDevice usbDevice) {
if (Ledger.ENABLED)
try { try {
Ledger.connect(usbManager, usbDevice); Ledger.connect(usbManager, usbDevice);
registerDetachReceiver(); registerDetachReceiver();

View File

@ -34,6 +34,7 @@ import java.io.IOException;
import timber.log.Timber; import timber.log.Timber;
public class Ledger { public class Ledger {
static final public boolean ENABLED = false;
// 5:20 is same as wallet2.cpp::restore() // 5:20 is same as wallet2.cpp::restore()
static public final int LOOKAHEAD_ACCOUNTS = 5; static public final int LOOKAHEAD_ACCOUNTS = 5;
static public final int LOOKAHEAD_SUBADDRESSES = 20; static public final int LOOKAHEAD_SUBADDRESSES = 20;
@ -44,6 +45,7 @@ public class Ledger {
public static final int OK[] = {SW_OK}; public static final int OK[] = {SW_OK};
public static UsbDevice findDevice(UsbManager usbManager) { public static UsbDevice findDevice(UsbManager usbManager) {
if (!ENABLED) return null;
return BTChipTransportAndroidHID.getDevice(usbManager); return BTChipTransportAndroidHID.getDevice(usbManager);
} }