mirror of https://github.com/m2049r/xmrwallet.git
disable ledger support (#547)
This commit is contained in:
parent
06456e33e4
commit
de8de02f9f
|
@ -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 {
|
||||||
|
|
|
@ -1361,30 +1361,31 @@ public class LoginActivity extends BaseActivity
|
||||||
};
|
};
|
||||||
|
|
||||||
private void connectLedger(UsbManager usbManager, final UsbDevice usbDevice) {
|
private void connectLedger(UsbManager usbManager, final UsbDevice usbDevice) {
|
||||||
try {
|
if (Ledger.ENABLED)
|
||||||
Ledger.connect(usbManager, usbDevice);
|
try {
|
||||||
registerDetachReceiver();
|
Ledger.connect(usbManager, usbDevice);
|
||||||
onLedgerAction();
|
registerDetachReceiver();
|
||||||
runOnUiThread(new Runnable() {
|
onLedgerAction();
|
||||||
@Override
|
runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
Toast.makeText(LoginActivity.this,
|
public void run() {
|
||||||
getString(R.string.toast_ledger_attached, usbDevice.getProductName()),
|
Toast.makeText(LoginActivity.this,
|
||||||
Toast.LENGTH_SHORT)
|
getString(R.string.toast_ledger_attached, usbDevice.getProductName()),
|
||||||
.show();
|
Toast.LENGTH_SHORT)
|
||||||
}
|
.show();
|
||||||
});
|
}
|
||||||
} catch (IOException ex) {
|
});
|
||||||
runOnUiThread(new Runnable() {
|
} catch (IOException ex) {
|
||||||
@Override
|
runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
@Override
|
||||||
Toast.makeText(LoginActivity.this,
|
public void run() {
|
||||||
getString(R.string.open_wallet_ledger_missing),
|
Toast.makeText(LoginActivity.this,
|
||||||
Toast.LENGTH_SHORT)
|
getString(R.string.open_wallet_ledger_missing),
|
||||||
.show();
|
Toast.LENGTH_SHORT)
|
||||||
}
|
.show();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue