From ec99dfa367668c2bf2c454bcb1d5d1d6158982dd Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 23 Apr 2019 12:39:57 +0300 Subject: [PATCH] Updated on 2026-08-14 --- app/src/main/AndroidManifest.xml | 13 ++-- .../com/tangem/ui/fragment/MainFragment.kt | 59 ++++++++++--------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 07226da19f..c62a9f553b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -29,12 +29,13 @@ android:supportsRtl="true" android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"> - - - - - - + + { -// if (zipFile != null) { -// zipFile!!.delete() -// zipFile = null -// } -// } + Constant.REQUEST_CODE_SEND_EMAIL -> { + if (zipFile != null) { + zipFile!!.delete() + zipFile = null + } + } Constant.REQUEST_CODE_ENTER_PIN_ACTIVITY -> { if (resultCode == Activity.RESULT_OK && lastTag != null) onTagDiscovered(lastTag!!) @@ -275,22 +280,22 @@ class MainFragment : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.sendLogs -> { -// var f: File? = null -// try { -// f = Logger.collectLogs(this) -// if (f != null) { -// LOG.e(TAG, String.format("Collect %d log bytes", f.length())) -// CommonUtil.sendEmail(this, zipFile, TAG, "Logs", UtilHelper.getDeviceInfo(), arrayOf(f)) -// } else { -// LOG.e(TAG, "Can't create temporarily log file") -// } -// } catch (e: Exception) { -// e.printStackTrace() -// } finally { -// if (f != null && f.exists()) -// f.delete() -// } -// return true + var f: File? = null + try { + f = Logger.collectLogs(activity) + if (f != null) { + LOG.e(TAG, String.format("Collect %d log bytes", f.length())) + CommonUtil.sendEmail(activity, zipFile, TAG, "Logs", UtilHelper.getDeviceInfo(), arrayOf(f)) + } else { + LOG.e(TAG, "Can't create temporarily log file") + } + } catch (e: Exception) { + e.printStackTrace() + } finally { + if (f != null && f.exists()) + f.delete() + } + return true } R.id.managePIN -> { (activity as MainActivity).navigator.showPinSave(activity!!, false)