Updated on 2026-08-14

This commit is contained in:
Tangem 2018-06-01 13:28:12 +03:00
parent e8c6dfadee
commit 9a3107a395
8 changed files with 20 additions and 8 deletions

View file

@ -8,8 +8,11 @@ import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import com.tangem.wallet.R;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Objects;
/**
* Created by dvol on 15.02.2018.
@ -20,7 +23,8 @@ 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";
// public static final String AUTHORITY = "com.tangem.LogFileProvider";
// UriMatcher used to match against incoming requests
private UriMatcher uriMatcher;
@ -32,7 +36,8 @@ public class LogFileProvider extends ContentProvider {
// Add a URI to the matcher which will match against the form
// 'content://it.my.app.LogFileProvider/*'
// and return 1 in the case that the incoming Uri matches this pattern
uriMatcher.addURI(AUTHORITY, "*", 1);
uriMatcher.addURI(Objects.requireNonNull(getContext()).getString(R.string.log_file_provider_authorities), "*", 1);
return true;
}

View file

@ -1,5 +1,6 @@
package com.tangem.presentation.activity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
@ -35,13 +36,19 @@ public class LogoActivity extends AppCompatActivity {
imgLogo.setOnClickListener(view -> hide());
}
@SuppressLint("SetTextI18n")
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// trigger the initial hide() shortly after the activity has been created, to briefly hint to the user that UI controls are available.
TextView AppVersion = findViewById(R.id.AppVersion);
AppVersion.setText("BETA v." + BuildConfig.VERSION_NAME);
if (BuildConfig.DEBUG)
AppVersion.setText("BETA v." + BuildConfig.VERSION_NAME + "\n" + "dev" + "\n" + "build " + BuildConfig.VERSION_CODE);
else
AppVersion.setText("BETA v." + BuildConfig.VERSION_NAME);
if (!getIntent().getBooleanExtra("skipAutoHide", false)) {
delayedHide(1000);
}

View file

@ -30,7 +30,6 @@ import android.widget.TextView;
import com.scottyab.rootbeer.RootBeer;
import com.skyfishjy.library.RippleBackground;
import com.tangem.data.LogFileProvider;
import com.tangem.domain.wallet.DeviceNFCAntennaLocation;
import com.tangem.domain.wallet.LastSignStorage;
import com.tangem.domain.wallet.Logger;
@ -294,8 +293,7 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
Compress compress = new Compress(fileNames, zipFile.getAbsolutePath());
compress.zip();
Log.e(logTag, String.format("Send %d bytes zip with logs", zipFile.length()));
Uri attachment = Uri.parse("content://" + LogFileProvider.AUTHORITY + "/"
+ zipFile.getName());
Uri attachment = Uri.parse("content://" + getString(R.string.log_file_provider_authorities) + "/" + zipFile.getName());
intent.putExtra(Intent.EXTRA_STREAM, attachment);
zipFile.deleteOnExit();