| | |
| | | |
| | | public class AppConfigUtil { |
| | | |
| | | /** |
| | | * 浏览器外跳协议 |
| | | * |
| | | * @param context |
| | | * @param content |
| | | */ |
| | | public static void saveBrowserJumpOutProtocolPrefix(Context context, String content) { |
| | | saveConfig("jumpAppProtocolPrefix", content, context); |
| | | public enum ConfigKey { |
| | | kefu, |
| | | unRegister, |
| | | privacyComplain, |
| | | helpLink |
| | | } |
| | | |
| | | public static Set<String> getBrowserJumpOutProtocolPrefix(Context context) { |
| | | try { |
| | | String config = getConfig("jumpAppProtocolPrefix", context); |
| | | if (!StringUtils.isEmpty(config)) { |
| | | Type type = new TypeToken<Set<String>>() { |
| | | }.getType(); |
| | | return new Gson().fromJson(config, type); |
| | | } |
| | | } catch (Exception e) { |
| | | e.getMessage(); |
| | | } |
| | | return new HashSet<>(); |
| | | |
| | | public static void saveConfig(ConfigKey key, String value, Context context) { |
| | | saveConfig(key.name(), value, context); |
| | | } |
| | | |
| | | public static String getConfig(ConfigKey key, Context context) { |
| | | return getConfig(key.name(), context); |
| | | } |
| | | |
| | | |