mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-11 06:32:19 +00:00
Add canary channels
Only show if user is already on canary channels
This commit is contained in:
@@ -33,6 +33,7 @@ import com.topjohnwu.net.Networking;
|
||||
import com.topjohnwu.superuser.Shell;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
public class SettingsFragment extends BasePreferenceFragment implements Topic.Subscriber {
|
||||
@@ -109,6 +110,15 @@ public class SettingsFragment extends BasePreferenceFragment implements Topic.Su
|
||||
return true;
|
||||
});
|
||||
|
||||
/* We only show canary channels if user is already on canary channel
|
||||
* or the user have already chosen canary channel */
|
||||
if (!BuildConfig.VERSION_NAME.contains("-") &&
|
||||
(int) Config.get(Config.Key.UPDATE_CHANNEL) < Config.Value.CANARY_CHANNEL) {
|
||||
// Remove the last 2 entries
|
||||
CharSequence[] entries = updateChannel.getEntries();
|
||||
updateChannel.setEntries(Arrays.copyOf(entries, entries.length - 2));
|
||||
}
|
||||
|
||||
setSummary();
|
||||
|
||||
// Disable dangerous settings in secondary user
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="request_timeout">
|
||||
@@ -80,6 +81,9 @@
|
||||
<item>@string/settings_update_stable</item>
|
||||
<item>@string/settings_update_beta</item>
|
||||
<item>@string/settings_update_custom</item>
|
||||
<!-- Debug only, don't care to translate -->
|
||||
<item>Canary</item>
|
||||
<item>Canary (Debug)</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="boot_formats">
|
||||
|
||||
Reference in New Issue
Block a user