diff --git a/app/src/main/kotlin/org/fossify/messages/activities/MainActivity.kt b/app/src/main/kotlin/org/fossify/messages/activities/MainActivity.kt index fdf98661..1f2db669 100644 --- a/app/src/main/kotlin/org/fossify/messages/activities/MainActivity.kt +++ b/app/src/main/kotlin/org/fossify/messages/activities/MainActivity.kt @@ -101,9 +101,12 @@ class MainActivity : SimpleActivity() { loadMessages() } - if (checkAppSideloading()) { - return - } + // [fork] checkAppSideloading() shows a "this app is corrupted, get the + // original" dialog when the applicationId differs from the official + // Fossify one. Suppressed here because this is intentionally a fork. + // if (checkAppSideloading()) { + // return + // } } override fun onResume() { @@ -215,28 +218,11 @@ class MainActivity : SimpleActivity() { } private fun loadMessages() { - if (isQPlus()) { - val roleManager = getSystemService(RoleManager::class.java) - if (roleManager!!.isRoleAvailable(RoleManager.ROLE_SMS)) { - if (roleManager.isRoleHeld(RoleManager.ROLE_SMS)) { - askPermissions() - } else { - val intent = roleManager.createRequestRoleIntent(RoleManager.ROLE_SMS) - startActivityForResult(intent, MAKE_DEFAULT_APP_REQUEST) - } - } else { - toast(org.fossify.commons.R.string.unknown_error_occurred) - finish() - } - } else { - if (Telephony.Sms.getDefaultSmsPackage(this) == packageName) { - askPermissions() - } else { - val intent = Intent(Telephony.Sms.Intents.ACTION_CHANGE_DEFAULT) - intent.putExtra(Telephony.Sms.Intents.EXTRA_PACKAGE_NAME, packageName) - startActivityForResult(intent, MAKE_DEFAULT_APP_REQUEST) - } - } + // [fork] Don't force the user to make this app the default SMS app + // on first launch. Read-only access via permissions is enough to + // browse and translate; the user can opt in to be the default + // through the system settings later if they want. + askPermissions() } // while SEND_SMS and READ_SMS permissions are mandatory, READ_CONTACTS is optional.