Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
gedoor committed Jul 3, 2019
1 parent c824662 commit c792a1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class AppConstant {

public static final String DEFAULT_WEB_DAV_URL = "https://dav.jianguoyun.com/dav/";

public static final String DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; WOW64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3100.0 Safari/537.36";

public static final Pattern JS_PATTERN = Pattern.compile("(<js>[\\w\\W]*?</js>|@js:[\\w\\W]*$)", Pattern.CASE_INSENSITIVE);
public static final Pattern EXP_PATTERN = Pattern.compile("\\{\\{([\\w\\W]*?)\\}\\}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Map;

import static android.text.TextUtils.isEmpty;
import static com.kunfei.bookshelf.constant.AppConstant.DEFAULT_USER_AGENT;

/**
* Created by GKF on 2018/3/2.
Expand All @@ -38,7 +39,6 @@ public static Map<String, String> getMap(BookSourceBean bookSourceBean) {
}

private static String getDefaultUserAgent() {
return preferences.getString(MApplication.getInstance().getString(R.string.pk_user_agent),
MApplication.getInstance().getString(R.string.pv_user_agent));
return preferences.getString(MApplication.getInstance().getString(R.string.pk_user_agent), DEFAULT_USER_AGENT);
}
}
2 changes: 0 additions & 2 deletions app/src/main/res/values/pref_key_value.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
<string name="icon_main">ic_launcher_round</string>
<string name="icon_book">book_launcher_round</string>

<string name="pv_user_agent">Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.2357.134 Safari/537.36</string>

<string name="source_rule_url">https://gedoor.github.io/MyBookshelf/sourcerule.html</string>
<string name="this_github_url">https://github.com/gedoor/MyBookshelf</string>
<string name="disclaimer_url">https://gedoor.github.io/MyBookshelf/disclaimer.html</string>
Expand Down

0 comments on commit c792a1e

Please sign in to comment.