Updated on 2026-08-14
This commit is contained in:
commit
66ee693070
12 changed files with 132 additions and 106 deletions
|
|
@ -20,11 +20,7 @@ import java.util.Objects;
|
|||
|
||||
public class LogFileProvider extends ContentProvider {
|
||||
|
||||
private static final String CLASS_NAME = "LogFileProvider";
|
||||
|
||||
// The authority is the symbolic name for the provider class
|
||||
// public static final String AUTHORITY = "com.tangem.LogFileProvider";
|
||||
// public static final String AUTHORITY = "com.tangem.LogFileProvider";
|
||||
private static final String TAG = LogFileProvider.class.getSimpleName() + "-oF";
|
||||
|
||||
// UriMatcher used to match against incoming requests
|
||||
private UriMatcher uriMatcher;
|
||||
|
|
@ -37,20 +33,15 @@ public class LogFileProvider extends ContentProvider {
|
|||
// 'content://it.my.app.LogFileProvider/*'
|
||||
// and return 1 in the case that the incoming Uri matches this pattern
|
||||
|
||||
// uriMatcher.addURI(Objects.requireNonNull(getContext()).getString(R.string.log_file_provider_authorities), "*", 1);
|
||||
// uriMatcher.addURI(Objects.requireNonNull("com.tangem.data.LogFileProvider"), "*", 1);
|
||||
uriMatcher.addURI(Objects.requireNonNull(getContext()).getString(R.string.log_file_provider_authorities), "*", 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParcelFileDescriptor openFile(Uri uri, String mode)
|
||||
throws FileNotFoundException {
|
||||
public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
|
||||
|
||||
String LOG_TAG = CLASS_NAME + "-oF";
|
||||
|
||||
Log.v(LOG_TAG,
|
||||
"Called with uri: '" + uri + "'." + uri.getLastPathSegment());
|
||||
Log.v(TAG, "Called with uri: '" + uri + "'." + uri.getLastPathSegment());
|
||||
|
||||
// check incoming Uri against the matcher
|
||||
switch (uriMatcher.match(uri)) {
|
||||
|
|
@ -74,9 +65,8 @@ public class LogFileProvider extends ContentProvider {
|
|||
|
||||
// Otherwise unrecognised Uri
|
||||
default:
|
||||
Log.v(LOG_TAG, "Unsupported uri: '" + uri + "'.");
|
||||
throw new FileNotFoundException("Unsupported uri: "
|
||||
+ uri.toString());
|
||||
Log.v(TAG, "Unsupported uri: '" + uri + "'.");
|
||||
throw new FileNotFoundException("Unsupported uri: " + uri.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -317,15 +317,16 @@ public class ServerApiElectrum {
|
|||
// install the all-trusting host verifier
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
|
||||
|
||||
SSLSocket sslSocket;
|
||||
Socket sslSocket = new Socket();
|
||||
|
||||
List<ElectrumRequest> result = new ArrayList<>();
|
||||
Collections.addAll(result, electrumRequest);
|
||||
|
||||
try {
|
||||
Log.i(TAG, host + " " + port);
|
||||
sslSocket = (SSLSocket) sf.createSocket(host, port);
|
||||
sslSocket.connect(new InetSocketAddress(host,port), 3000);
|
||||
sslSocket.setSoTimeout(3000);
|
||||
sslSocket = sf.createSocket(sslSocket, host, port, true);
|
||||
try {
|
||||
OutputStream os = sslSocket.getOutputStream();
|
||||
OutputStreamWriter out = new OutputStreamWriter(os, "UTF-8");
|
||||
|
|
|
|||
|
|
@ -97,6 +97,12 @@ class MainFragment : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
viewModel.getVersionName().observe(this, Observer { text ->
|
||||
(activity as MainActivity).toastHelper.showSnackbarUpdateVersion(context!!, cl, text)
|
||||
})
|
||||
|
||||
val intent = activity?.intent
|
||||
if (intent != null && (NfcAdapter.ACTION_TECH_DISCOVERED == intent.action || NfcAdapter.ACTION_NDEF_DISCOVERED == intent.action)) {
|
||||
val tag = intent.getParcelableExtra<Tag>(NfcAdapter.EXTRA_TAG)
|
||||
onTagDiscovered(tag)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ package com.tangem.wallet.bch
|
|||
|
||||
enum class BitcoinCashNode(val host: String, val port: Int, val proto: String) {
|
||||
N_001("electrumx.hillsideinternet.com", 50002, "ssl"),
|
||||
N_002("dedi.jochen-hoenicke.de", 51002, "ssl"),
|
||||
N_003("crypto.mldlabs.com", 50002, "ssl"),
|
||||
N_004("electroncash.cascharia.com", 50002, "ssl"),
|
||||
N_005("bch.crypto.mldlabs.com", 50002, "ssl"),
|
||||
// N_002("dedi.jochen-hoenicke.de", 51002, "ssl"),
|
||||
// N_003("crypto.mldlabs.com", 50002, "ssl"),
|
||||
// N_004("electroncash.cascharia.com", 50002, "ssl"),
|
||||
// N_005("bch.crypto.mldlabs.com", 50002, "ssl"),
|
||||
N_006("electron.coinucopia.io", 50002, "ssl"),
|
||||
N_007("blackie.c3-soft.com", 50002, "ssl"),
|
||||
N_008("electrum.imaginary.cash", 50002, "ssl"),
|
||||
N_009("bitcoincash.quangld.com", 50002, "ssl"),
|
||||
N_010("bch.stitthappens.com", 50002, "ssl"),
|
||||
// N_009("bitcoincash.quangld.com", 50002, "ssl"),
|
||||
// N_010("bch.stitthappens.com", 50002, "ssl"),
|
||||
}
|
||||
|
|
@ -44,7 +44,8 @@ public class CashAddr {
|
|||
byte[] checksumBytes = calculateChecksumBytesPolymod(allChecksumInput);
|
||||
checksumBytes = convertBits(checksumBytes, 8, 5, true);
|
||||
String cashAddress = BitcoinCashBase32.encode(concatenateByteArrays(payloadBytes, checksumBytes));
|
||||
return prefixString + SEPARATOR + cashAddress;
|
||||
//return prefixString + SEPARATOR + cashAddress;
|
||||
return cashAddress;
|
||||
}
|
||||
|
||||
public static BitcoinCashAddressDecodedParts decodeCashAddress(String bitcoinCashAddress) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue