fix crashing

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/102/head
androidacy-user 2 years ago
parent 8d0aa1b698
commit 94c834d938

@ -28,12 +28,11 @@ The Androidacy Module Manager serves as a robust alternative to the official Mag
- **Security:** Automatic VirusTotal scans.
- **Community Engagement:** Module reviews.
- **Revenue Sharing:** Financially rewards module developers.
- **Ad-Supported:** Ads allow us to keep this app and our repository free, but can be removed with a subscription. [Subscribe Now](https://www.androidacy.com/membership-join/?utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme)
- **Ad-Supported:** Ads allow us to keep this app and our repository free while being able to support and maintain it, but can be removed with a subscription. [Subscribe Now](https://www.androidacy.com/membership-join/?utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme)
### Future Updates
- Repository Creation Wizard
- Module Creation Tool
- AMM v3 beta in January
### Screenshots
@ -64,7 +63,7 @@ Join our [Telegram Group](https://telegram.dog/androidacy_discussions?utm_source
## Installation Guidelines
Visit [our website](https://www.androidacy.com/downloads/?view=FoxMMM&utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme) to download the latest `.apk`.
Visit [our website](https://www.androidacy.com/downloads/?view=FoxMMM&utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme) to download the latest `.apk` for your device arch.
## Developer Guidelines
@ -72,17 +71,15 @@ Consult our [Developer Documentation](docs/DEVELOPERS.md?utm_source=fox-readme&u
## Translation Contributions
Visit our [Weblate page](https://translate.nift4.org/engage/foxmmm/?utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme). Advanced users may also send us a pull request on GitHub.
<a href="http://translate.nift4.org/engage/foxmmm/">
<img src="http://translate.nift4.org/widgets/foxmmm/-/287x66-grey.png" alt="Translation status" />
</a>
**WEBLATE NO LONGER AVAILABLE.** Advanced users may also send us a pull request on GitHub.
## Legal and Compliance
By using this application, you agree to abide by our [Terms of Service](https://www.androidacy.com/terms/?utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme), our [LICENSE](LICENCE?utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme) and the [EULA](https://www.androidacy.com/foxmmm-eula/?utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme). **If you do not agree to any of those terms, you are to discontinue usage of the app immediately.**
__The terms of the EULA are in addition to the LGPL, not in replacement or subversion of, regarding your relatiomship with Androidacy. Our Terms apply to usage of any of our services, which this app makes usage of.__
## Disclaimer
@ -93,4 +90,4 @@ THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
<sup><sub>This app was originally known as Fox's Magisk Module Manager (FoxMMM). We thank Fox2Code for the foundational work on this app.</sub></sup>
<sup><sub>This app was originally known as Fox's Magisk Module Manager (FoxMMM). We thank Fox2Code for the foundational work on this app.</sub></sup>

@ -36,7 +36,7 @@ class CustomRepoManager internal constructor(
val applicationContext = mainApplication!!.applicationContext
val db = Room.databaseBuilder(
applicationContext, ReposListDatabase::class.java, "ReposList.db"
).build()
).allowMainThreadQueries().build()
val reposListDao = db.reposListDao()
val reposListList = reposListDao.getAll()
for (reposList in reposListList) {
@ -112,7 +112,7 @@ class CustomRepoManager internal constructor(
val applicationContext = INSTANCE!!.applicationContext
val db = Room.databaseBuilder(
applicationContext, ReposListDatabase::class.java, "ReposList.db"
).build()
).allowMainThreadQueries().build()
val reposListDao = db.reposListDao()
val reposList = ReposList(id, repo, true, donate, support, submitModule, 0, name, website)
reposListDao.insert(reposList)
@ -145,7 +145,7 @@ class CustomRepoManager internal constructor(
repoCount--
val customRepoData = repoManager[oldRepo] as CustomRepoData
if (customRepoData != null) {
customRepoData.isEnabled = false
//customRepoData.isEnabled = false
customRepoData.override = null
}
dirty = true
@ -179,4 +179,4 @@ class CustomRepoManager internal constructor(
const val MAX_CUSTOM_REPOS = 5
private const val AUTO_RECOMPILE = true
}
}
}

@ -415,7 +415,7 @@ class RepoFragment : PreferenceFragmentCompat() {
val customRepoManager = RepoManager.getINSTANCE()!!.customRepoManager
for (i in 0 until custRepoEntries) {
// get the id of the repo at current index in customRepos
val repoData = customRepoManager!!.getRepo(customRepos[i])
val repoData = customRepoManager!!.getRepo(db.reposListDao().getUrl(customRepos[i]))
// convert repoData to a json string for logging
if (MainApplication.forceDebugLogging) Timber.d("RepoData for %d is %s", i, repoData.toJSON())
setRepoData(repoData, "pref_custom_repo_$i")

@ -3,6 +3,8 @@
*/
package com.fox2code.mmm.settings
import android.net.Uri
import com.fox2code.mmm.utils.IntentHelper
import android.annotation.SuppressLint
import android.app.ActivityManager
import android.content.ClipboardManager
@ -240,6 +242,15 @@ class SettingsActivity : AppCompatActivity(), LanguageActivity,
libsBuilder.start(requireContext())
return@OnPreferenceClickListener true
}
findPreference<Preference>("pref_show_apps")!!.onPreferenceClickListener =
Preference.OnPreferenceClickListener { _: Preference? ->
val browserIntent = Intent(
Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/store/apps/dev?id=6763514284252789381")
)
startActivity(browserIntent)
return@OnPreferenceClickListener true
}
}
}
@ -297,4 +308,4 @@ class SettingsActivity : AppCompatActivity(), LanguageActivity,
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).addToBackStack(null).commit()
return true
}
}
}

@ -429,4 +429,5 @@
<string name="install_from_storage_file_not_found">Could not find selected file. Please try again.</string>
<string name="invalid_update_url">No update URL found</string>
<string name="invalid_update_url_message">Could not determine a suitable URL to reinstall or update this module from. Please check with the source you got this module from.</string>
<string name="show_apps">Our other apps</string>
</resources>

@ -76,6 +76,11 @@
app:singleLineTitle="false"
app:title="@string/show_licenses" />
<Preference
app:icon="@drawable/ic_baseline_list_24"
app:key="pref_show_apps"
app:singleLineTitle="false"
app:title="@string/show_apps" />
<Preference
app:enabled="true"

Loading…
Cancel
Save