Add pattern protection

This commit is contained in:
seven332 committed 2015-04-29 23:00:24 +08:00
1 parent 017ee1c538
commit 65feff57c0
15 files changed
+1594 -6

No files matched your search

@@ -96,6 +96,14 @@ public final class Config {
mConfigPre.edit().putInt(key, value).apply();
}
public static long getLong(String key, long defValue) {
return mConfigPre.getLong(key, defValue);
}
public static void setLong(String key, long value) {
mConfigPre.edit().putLong(key, value).apply();
}
public static String getString(String key, String defValue) {
return mConfigPre.getString(key, defValue);
}
@@ -563,6 +571,9 @@ public final class Config {
private static final String KEY_EH_MIN_INTERVAL = "eh_min_interval";
private static final int DEFAULT_EH_MIN_INTERVAL = 0;
private static final String KEY_PATTERN_PROTECTION = "pattern_protection";
private static final String DEFAULT_PATTERN_PROTECTION = "";
public static int getHttpRetry() {
return getIntFromStr(KEY_HTTP_RETRY, DEFAULT_HTTP_RETRY);
}
@@ -579,6 +590,14 @@ public final class Config {
return getIntFromStr(KEY_EH_MIN_INTERVAL, DEFAULT_EH_MIN_INTERVAL);
}
public static String getPatternProtection() {
return getString(KEY_PATTERN_PROTECTION, DEFAULT_PATTERN_PROTECTION);
}
public static void setPatternProtection(String value) {
setString(KEY_PATTERN_PROTECTION, value);
}
/****** About ******/