Skip to content

Commit

Permalink
fix crashing
Browse files Browse the repository at this point in the history
Signed-off-by: androidacy-user <opensource@androidacy.com>
  • Loading branch information
androidacy-user committed Dec 10, 2023
1 parent 8d0aa1b commit 94c834d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 16 deletions.
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -64,25 +63,23 @@ 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

Consult our [Developer Documentation](docs/DEVELOPERS.md?utm_source=fox-readme&utm_medium=web&utm_campaign=github-readme).

## 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


Expand All @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -179,4 +179,4 @@ class CustomRepoManager internal constructor(
const val MAX_CUSTOM_REPOS = 5
private const val AUTO_RECOMPILE = true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
}

}
Expand Down Expand Up @@ -297,4 +308,4 @@ class SettingsActivity : AppCompatActivity(), LanguageActivity,
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).addToBackStack(null).commit()
return true
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
5 changes: 5 additions & 0 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 94c834d

Please sign in to comment.