Skip to content

Commit

Permalink
Sync with AmiiboAPI and update camera lib
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Dec 12, 2024
1 parent a6b7a00 commit 4abc04c
Show file tree
Hide file tree
Showing 16 changed files with 4,070 additions and 4,263 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ dependencies {
implementation 'androidx.activity:activity-ktx:1.9.3'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation "androidx.browser:browser:1.8.0"
def androidx_camera = '1.4.0'
def androidx_camera = '1.4.1'
implementation "androidx.camera:camera-core:$androidx_camera"
implementation "androidx.camera:camera-camera2:$androidx_camera"
implementation "androidx.camera:camera-lifecycle:$androidx_camera"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/hiddenramblings/tagmo/TagMo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ class TagMo : Application() {
}
try {
Debug.sendException(this, exception.toString())
} catch (ignored: Exception) { }
} catch (_: Exception) { }
try {
Debug.saveException(this, exception.toString())
} catch (ignored: Exception) { }
} catch (_: Exception) { }
android.os.Process.killProcess(android.os.Process.myPid())
exitProcess(-1)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class GattService : Service() {
descriptor.value = value
mBluetoothGatt?.writeDescriptor(descriptor)
}
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ object Debug {
} catch (ex: ActivityNotFoundException) {
try {
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(ISSUE_URL)))
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class JSONExecutor(activity: Activity, server: String, path: String? = null) {
} catch (ssl: SSLHandshakeException) {
Debug.warn(ssl)
return@launch
} catch (ignored: UnknownHostException) { }
} catch (_: UnknownHostException) { }
try {
var conn = URL(url).asConnection.withToken
var statusCode = conn.responseCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class BrowserFragment : Fragment(), OnFoomiiboClickListener {
resultData[resultData.indexOf(data)] = tagData
break
}
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}
if (!updated) resultData.add(tagData)
}
Expand Down Expand Up @@ -625,14 +625,14 @@ class BrowserFragment : Fragment(), OnFoomiiboClickListener {
tagData = data
break
}
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}
return try {
if (tagData.isEmpty() && null != this)
Foomiibo.getSignedData(Amiibo.idToHex(this.id))
else
TagArray.getValidatedData(keyManager, tagData)
} catch (ignored: Exception) { byteArrayOf() }
} catch (_: Exception) { byteArrayOf() }
}

override fun onFoomiiboClicked(itemView: View, amiibo: Amiibo?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ class EliteBankFragment : Fragment(), EliteBankAdapter.OnAmiiboClickListener {
R.string.bank_stats, eliteBankCount.getValueByPosition(activeBank), bankCount
)
updateNumberedText(bankCount)
} catch (ignored: Exception) {
} catch (_: Exception) {
if (amiibos.isEmpty()) onBottomSheetChanged(SHEET.LOCKED)
}
arguments = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ open class GattSlotFragment : Fragment(), GattSlotAdapter.OnAmiiboClickListener,
try {
requireContext().unbindService(gattServerConn)
requireContext().stopService(Intent(requireContext(), GattService::class.java))
} catch (ignored: IllegalArgumentException) { }
} catch (_: IllegalArgumentException) { }
}

fun disconnectService() {
Expand Down Expand Up @@ -1131,7 +1131,7 @@ open class GattSlotFragment : Fragment(), GattSlotAdapter.OnAmiiboClickListener,
override fun onDestroyView() {
try {
dismissGattDiscovery()
} catch (ignored: NullPointerException) { }
} catch (_: NullPointerException) { }
disconnectService()
bluetoothHandler?.unregisterResultContracts()
super.onDestroyView()
Expand All @@ -1145,7 +1145,7 @@ open class GattSlotFragment : Fragment(), GattSlotAdapter.OnAmiiboClickListener,
extras.getByteArray(NFCIntent.EXTRA_TAG_DATA)?.let {
uploadAmiiboData(AmiiboData(it))
}
} catch (ignored: Exception) { }
} catch (_: Exception) { }
} else {
Toasty(requireActivity()).Long(R.string.fail_no_device)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
try {
withContext(Dispatchers.IO) { Glide.get(activity).clearDiskCache() }
withContext(Dispatchers.Main) { Glide.get(activity).clearMemory() }
} catch (ignored: IllegalStateException) { }
} catch (_: IllegalStateException) { }
if (notify) withContext(Dispatchers.Main) {
buildSnackbar(
activity, R.string.removing_amiibo_info, Snackbar.LENGTH_SHORT
Expand Down Expand Up @@ -574,7 +574,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
buildSnackbar(
activity, R.string.update_amiibo_api, Snackbar.LENGTH_LONG
).setAction(R.string.sync) { onDownloadRequested(lastUpdated) }.show()
} catch (ignored: IllegalStateException) { }
} catch (_: IllegalStateException) { }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ object Flipper {
MediaScannerConnection.scanFile(
TagMo.appContext, arrayOf(nfcFile.canonicalPath), null, null
)
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class NfcActivity : AppCompatActivity() {
private fun closeTagSilently(ntag215: NTAG215?) {
try {
ntag215?.close()
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}

private fun writeCollection(ntag215: NTAG215, command: Intent) {
Expand Down Expand Up @@ -619,7 +619,7 @@ class NfcActivity : AppCompatActivity() {
}
try {
Debug.clipException(this@NfcActivity, exception.toString())
} catch (ignored: Exception) {
} catch (_: Exception) {
}
}
}
Expand All @@ -629,7 +629,7 @@ class NfcActivity : AppCompatActivity() {
showError(getString(R.string.error_unknown))
try {
Debug.processLogcat(this@NfcActivity)
} catch (ignored: IOException) {
} catch (_: IOException) {
}
}
}
Expand Down Expand Up @@ -666,7 +666,7 @@ class NfcActivity : AppCompatActivity() {
showError(getString(R.string.error_unknown))
try {
Debug.processLogcat(this@NfcActivity)
} catch (ignored: IOException) {
} catch (_: IOException) {
}
}
}
Expand Down Expand Up @@ -752,10 +752,10 @@ class NfcActivity : AppCompatActivity() {
private fun stopNfcMonitor() {
try {
nfcAdapter?.disableForegroundDispatch(this)
} catch (ignored: RuntimeException) { }
} catch (_: RuntimeException) { }
try {
unregisterReceiver(mReceiver)
} catch (ignored: IllegalArgumentException) { }
} catch (_: IllegalArgumentException) { }
}

private fun listenForTags() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ScanTag {
private fun closeTagSilently(mifare: NTAG215?) {
try {
mifare?.close()
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}

private suspend fun onTagDiscovered(activity: BrowserActivity, intent: Intent) = withContext(Dispatchers.IO) {
Expand Down Expand Up @@ -180,7 +180,7 @@ class ScanTag {
}
try {
Debug.clipException(activity, exception.toString())
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ object TagArray {
MediaScannerConnection.scanFile(
TagMo.appContext, arrayOf(binFile.canonicalPath), null, null
)
} catch (ignored: Exception) { }
} catch (_: Exception) { }
return binFile.canonicalPath
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class UpdateManager internal constructor(activity: BrowserActivity) {
mySessions.forEach {
try {
abandonSession(it.sessionId)
} catch (ignored: Exception) { }
} catch (_: Exception) { }
}
}
}
Expand Down Expand Up @@ -181,7 +181,7 @@ class UpdateManager internal constructor(activity: BrowserActivity) {
} catch (anf: ActivityNotFoundException) {
try {
startActivity(it.setAction(Intent.ACTION_VIEW))
} catch (ignored: ActivityNotFoundException) { }
} catch (_: ActivityNotFoundException) { }
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class UpdateReceiver : BroadcastReceiver() {
it.toUri(0),
if (Version.isLollipopMR) Intent.URI_ALLOW_UNSAFE else 0
))
} catch (ignored: URISyntaxException) { }
} catch (_: URISyntaxException) { }
}
}
PackageInstaller.STATUS_SUCCESS -> {}
Expand Down
Loading

0 comments on commit 4abc04c

Please sign in to comment.