You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Removed update repos as it can be done via repository
This commit is contained in:
@@ -6,19 +6,11 @@ import com.skoumal.teanity.viewmodel.LoadingViewModel
|
||||
import com.topjohnwu.magisk.model.events.BackPressEvent
|
||||
import com.topjohnwu.magisk.model.events.PermissionEvent
|
||||
import com.topjohnwu.magisk.model.events.ViewActionEvent
|
||||
import com.topjohnwu.magisk.utils.Event
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.subjects.PublishSubject
|
||||
import timber.log.Timber
|
||||
|
||||
|
||||
abstract class MagiskViewModel : LoadingViewModel(), Event.AutoListener {
|
||||
|
||||
@Deprecated("")
|
||||
override fun onEvent(event: Int) = Timber.i("Event of $event was not handled")
|
||||
|
||||
@Deprecated("")
|
||||
override fun getListeningEvents(): IntArray = intArrayOf()
|
||||
abstract class MagiskViewModel : LoadingViewModel() {
|
||||
|
||||
fun withView(action: Activity.() -> Unit) {
|
||||
ViewActionEvent(action).publish()
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.topjohnwu.magisk.data.repository.MagiskRepository
|
||||
import com.topjohnwu.magisk.model.events.*
|
||||
import com.topjohnwu.magisk.model.observer.Observer
|
||||
import com.topjohnwu.magisk.ui.base.MagiskViewModel
|
||||
import com.topjohnwu.magisk.utils.Event
|
||||
import com.topjohnwu.magisk.utils.ISafetyNetHelper
|
||||
import com.topjohnwu.magisk.utils.toggle
|
||||
import com.topjohnwu.superuser.Shell
|
||||
@@ -87,8 +86,6 @@ class HomeViewModel(
|
||||
private val latest = resources.getString(R.string.latest_version)
|
||||
|
||||
init {
|
||||
Event.register(this)
|
||||
|
||||
isForceEncryption.addOnPropertyChangedCallback {
|
||||
Config.keepEnc = it ?: return@addOnPropertyChangedCallback
|
||||
}
|
||||
@@ -99,13 +96,6 @@ class HomeViewModel(
|
||||
refresh()
|
||||
}
|
||||
|
||||
override fun onEvent(event: Int) {
|
||||
updateSelf()
|
||||
ensureEnv()
|
||||
}
|
||||
|
||||
override fun getListeningEvents(): IntArray = intArrayOf(Event.UPDATE_CHECK_DONE)
|
||||
|
||||
fun paypalPressed() = OpenLinkEvent(Const.Url.PAYPAL_URL).publish()
|
||||
fun patreonPressed() = OpenLinkEvent(Const.Url.PATREON_URL).publish()
|
||||
fun twitterPressed() = OpenLinkEvent(Const.Url.TWITTER_URL).publish()
|
||||
|
||||
@@ -79,7 +79,7 @@ public class SettingsFragment extends BasePreferenceFragment {
|
||||
});
|
||||
findPreference("hosts").setOnPreferenceClickListener(pref -> {
|
||||
Shell.su("add_hosts_module").exec();
|
||||
Utils.loadModules();
|
||||
//Utils.loadModules();
|
||||
Utils.toast(R.string.settings_hosts_toast, Toast.LENGTH_SHORT);
|
||||
return true;
|
||||
});
|
||||
@@ -288,11 +288,13 @@ public class SettingsFragment extends BasePreferenceFragment {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void onEvent(int event) {
|
||||
setLocalePreference((ListPreference) findPreference(Config.Key.LOCALE));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int[] getListeningEvents() {
|
||||
return new int[] {Event.LOCALE_FETCH_DONE};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user