2019-01-30 03:10:12 -05:00
|
|
|
package com.topjohnwu.magisk;
|
2017-11-06 04:41:23 +08:00
|
|
|
|
2018-12-02 15:28:18 -05:00
|
|
|
import android.os.Environment;
|
2017-12-12 02:35:00 +08:00
|
|
|
import android.os.Process;
|
2017-11-18 00:04:31 +08:00
|
|
|
|
|
|
|
import java.io.File;
|
2017-11-06 04:41:23 +08:00
|
|
|
|
|
|
|
public class Const {
|
|
|
|
|
|
|
|
public static final String DEBUG_TAG = "MagiskManager";
|
|
|
|
|
|
|
|
// APK content
|
|
|
|
public static final String ANDROID_MANIFEST = "AndroidManifest.xml";
|
|
|
|
|
2018-01-12 01:53:49 +08:00
|
|
|
public static final String SU_KEYSTORE_KEY = "su_key";
|
|
|
|
|
2017-11-06 04:41:23 +08:00
|
|
|
// Paths
|
2018-11-15 13:57:41 -05:00
|
|
|
public static final String MAGISK_PATH = "/sbin/.magisk/img";
|
2018-12-02 15:28:18 -05:00
|
|
|
public static final File EXTERNAL_PATH;
|
2018-06-02 22:00:52 +08:00
|
|
|
public static File MAGISK_DISABLE_FILE;
|
|
|
|
|
2018-06-26 06:04:11 +08:00
|
|
|
static {
|
2018-11-15 13:57:41 -05:00
|
|
|
MAGISK_DISABLE_FILE = new File("xxx");
|
2018-12-02 15:28:18 -05:00
|
|
|
EXTERNAL_PATH = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
|
|
|
EXTERNAL_PATH.mkdirs();
|
2018-06-26 06:04:11 +08:00
|
|
|
}
|
|
|
|
|
2018-11-15 01:36:03 -05:00
|
|
|
public static final String BUSYBOX_PATH = "/sbin/.magisk/busybox";
|
2017-11-06 04:41:23 +08:00
|
|
|
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
|
|
|
public static final String MAGISK_LOG = "/cache/magisk.log";
|
2017-12-08 23:38:03 +08:00
|
|
|
public static final String MANAGER_CONFIGS = ".tmp.magisk.config";
|
2017-11-06 04:41:23 +08:00
|
|
|
|
2017-12-26 18:24:43 +08:00
|
|
|
// Versions
|
|
|
|
public static final int UPDATE_SERVICE_VER = 1;
|
2018-10-28 00:54:56 -04:00
|
|
|
public static final int MIN_MODULE_VER = 1500;
|
2018-12-08 00:43:50 -05:00
|
|
|
public static final int SNET_EXT_VER = 12;
|
2017-12-26 18:24:43 +08:00
|
|
|
|
2017-12-12 02:35:00 +08:00
|
|
|
public static final int USER_ID = Process.myUid() / 100000;
|
|
|
|
|
2018-04-14 15:32:37 +08:00
|
|
|
public static final class MAGISK_VER {
|
2019-02-02 05:30:16 -05:00
|
|
|
public static final int MIN_SUPPORT = 18000;
|
2018-04-14 15:32:37 +08:00
|
|
|
}
|
|
|
|
|
2017-11-06 04:41:23 +08:00
|
|
|
public static class ID {
|
|
|
|
public static final int UPDATE_SERVICE_ID = 1;
|
|
|
|
public static final int FETCH_ZIP = 2;
|
|
|
|
public static final int SELECT_BOOT = 3;
|
2018-07-21 02:59:36 +08:00
|
|
|
public static final int ONBOOT_SERVICE_ID = 6;
|
2017-11-06 04:41:23 +08:00
|
|
|
|
|
|
|
// notifications
|
|
|
|
public static final int MAGISK_UPDATE_NOTIFICATION_ID = 4;
|
|
|
|
public static final int APK_UPDATE_NOTIFICATION_ID = 5;
|
2017-11-15 04:39:05 +08:00
|
|
|
public static final int DTBO_NOTIFICATION_ID = 7;
|
2018-12-03 02:28:20 -05:00
|
|
|
public static final int HIDE_MANAGER_NOTIFICATION_ID = 8;
|
2018-12-02 15:15:42 -05:00
|
|
|
public static final String UPDATE_NOTIFICATION_CHANNEL = "update";
|
|
|
|
public static final String PROGRESS_NOTIFICATION_CHANNEL = "progress";
|
2018-12-27 22:07:47 +08:00
|
|
|
public static final String CHECK_MAGISK_UPDATE_WORKER_ID = "magisk_update";
|
2017-11-06 04:41:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public static class Url {
|
2019-02-03 16:11:47 -05:00
|
|
|
private static String getRaw(String where, String name) {
|
|
|
|
return String.format("https://raw.githubusercontent.com/topjohnwu/magisk_files/%s/%s", where, name);
|
|
|
|
}
|
|
|
|
public static final String STABLE_URL = getRaw("master", "stable.json");
|
|
|
|
public static final String BETA_URL = getRaw("master", "beta.json");
|
2019-03-08 06:23:13 -05:00
|
|
|
public static final String CANARY_URL = getRaw("master", "canary_builds/release.json");
|
|
|
|
public static final String CANARY_DEBUG_URL = getRaw("master", "canary_builds/canary.json");
|
2018-12-12 05:51:45 -05:00
|
|
|
public static final String REPO_URL = "https://api.github.com/users/Magisk-Modules-Repo/repos?per_page=100&sort=pushed&page=%d";
|
2017-11-06 04:41:23 +08:00
|
|
|
public static final String FILE_URL = "https://raw.githubusercontent.com/Magisk-Modules-Repo/%s/master/%s";
|
|
|
|
public static final String ZIP_URL = "https://github.com/Magisk-Modules-Repo/%s/archive/master.zip";
|
2018-10-28 02:48:01 -04:00
|
|
|
public static final String PAYPAL_URL = "https://www.paypal.me/topjohnwu";
|
2018-08-30 05:05:29 -04:00
|
|
|
public static final String PATREON_URL = "https://www.patreon.com/topjohnwu";
|
|
|
|
public static final String TWITTER_URL = "https://twitter.com/topjohnwu";
|
2018-07-05 03:15:10 +08:00
|
|
|
public static final String XDA_THREAD = "http://forum.xda-developers.com/showthread.php?t=3432382";
|
2018-07-19 04:18:08 +08:00
|
|
|
public static final String SOURCE_CODE_URL = "https://github.com/topjohnwu/Magisk";
|
2019-02-03 16:11:47 -05:00
|
|
|
public static final String SNET_URL = getRaw("b66b1a914978e5f4c4bbfd74a59f4ad371bac107", "snet.apk");
|
|
|
|
public static final String BOOTCTL_URL = getRaw("9c5dfc1b8245c0b5b524901ef0ff0f8335757b77", "bootctl");
|
2017-11-06 04:41:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public static class Key {
|
2019-01-21 15:49:03 -05:00
|
|
|
// others
|
|
|
|
public static final String LINK_KEY = "Link";
|
|
|
|
public static final String IF_NONE_MATCH = "If-None-Match";
|
2017-11-06 04:41:23 +08:00
|
|
|
// intents
|
2019-02-02 04:22:25 -05:00
|
|
|
public static final String FROM_SPLASH = "splash";
|
2017-11-06 04:41:23 +08:00
|
|
|
public static final String OPEN_SECTION = "section";
|
2018-12-02 04:47:57 -05:00
|
|
|
public static final String INTENT_SET_NAME = "filename";
|
2017-11-06 04:41:23 +08:00
|
|
|
public static final String INTENT_SET_LINK = "link";
|
|
|
|
public static final String FLASH_ACTION = "action";
|
|
|
|
public static final String FLASH_SET_BOOT = "boot";
|
2018-12-02 16:53:00 -05:00
|
|
|
public static final String BROADCAST_MANAGER_UPDATE = "manager_update";
|
|
|
|
public static final String BROADCAST_REBOOT = "reboot";
|
2017-11-06 04:41:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public static class Value {
|
|
|
|
public static final String FLASH_ZIP = "flash";
|
|
|
|
public static final String PATCH_BOOT = "patch";
|
|
|
|
public static final String FLASH_MAGISK = "magisk";
|
2018-07-29 15:45:04 +08:00
|
|
|
public static final String FLASH_INACTIVE_SLOT = "slot";
|
2018-06-27 05:58:56 +08:00
|
|
|
public static final String UNINSTALL = "uninstall";
|
2017-11-06 04:41:23 +08:00
|
|
|
}
|
2019-01-21 15:49:03 -05:00
|
|
|
|
|
|
|
|
2017-11-06 04:41:23 +08:00
|
|
|
}
|