修复SharedPreUtils.getInstance()作为局部变量带来的问题

pull/21/head
fengyuecanzhu 3 years ago
parent c5759ba251
commit 6a10102b7a
  1. 2
      app/build.gradle
  2. 21
      app/src/main/java/xyz/fycz/myreader/application/App.java
  3. 28
      app/src/main/java/xyz/fycz/myreader/model/third3/http/HttpHelper.kt
  4. 14
      app/src/main/java/xyz/fycz/myreader/ui/activity/AdSettingActivity.java
  5. 10
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookstoreActivity.java
  6. 3
      app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java
  7. 8
      app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java
  8. 12
      app/src/main/java/xyz/fycz/myreader/ui/dialog/BookGroupDialog.java
  9. 34
      app/src/main/java/xyz/fycz/myreader/ui/fragment/ProxyFragment.kt
  10. 1
      app/src/main/java/xyz/fycz/myreader/util/SharedPreUtils.java
  11. 7
      app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java
  12. 1
      app/src/main/java/xyz/fycz/myreader/webapi/LanZousApi.java
  13. 18
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java
  14. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QiDianFindCrawler.java
  15. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QiDianMobileRank.java
  16. 2
      app/src/main/res/values/strings.xml

@ -277,7 +277,7 @@ dependencies {
}
greendao {
schemaVersion 34
schemaVersion 35
daoPackage 'xyz.fycz.myreader.greendao.gen'
// targetGenDir 'src/main/java'
}

@ -285,29 +285,28 @@ public class App extends Application {
isForceUpdate = Boolean.parseBoolean(contents[1].substring(contents[1].indexOf(":") + 1));
downloadLink = contents[2].substring(contents[2].indexOf(":") + 1).trim();
updateContent = contents[3].substring(contents[3].indexOf(":") + 1);
SharedPreUtils spu = SharedPreUtils.getInstance();
spu.putString(getmContext().getString(R.string.lanzousKeyStart), contents[4].substring(contents[4].indexOf(":") + 1));
SharedPreUtils.getInstance().putString(getmContext().getString(R.string.lanzousKeyStart), contents[4].substring(contents[4].indexOf(":") + 1));
String newSplashTime = contents[5].substring(contents[5].indexOf(":") + 1);
String oldSplashTime = spu.getString("splashTime");
spu.putBoolean("needUdSI", !oldSplashTime.equals(newSplashTime));
spu.putString("splashTime", contents[5].substring(contents[5].indexOf(":") + 1));
spu.putString("splashImageUrl", contents[6].substring(contents[6].indexOf(":") + 1));
spu.putString("splashImageMD5", contents[7].substring(contents[7].indexOf(":") + 1));
String oldSplashTime = SharedPreUtils.getInstance().getString("splashTime");
SharedPreUtils.getInstance().putBoolean("needUdSI", !oldSplashTime.equals(newSplashTime));
SharedPreUtils.getInstance().putString("splashTime", contents[5].substring(contents[5].indexOf(":") + 1));
SharedPreUtils.getInstance().putString("splashImageUrl", contents[6].substring(contents[6].indexOf(":") + 1));
SharedPreUtils.getInstance().putString("splashImageMD5", contents[7].substring(contents[7].indexOf(":") + 1));
forceUpdateVersion = Integer.parseInt(contents[8].substring(contents[8].indexOf(":") + 1));
spu.putInt("forceUpdateVersion", forceUpdateVersion);
SharedPreUtils.getInstance().putInt("forceUpdateVersion", forceUpdateVersion);
String domain = contents[9].substring(contents[9].indexOf(":") + 1);
spu.putString("domain", domain);
SharedPreUtils.getInstance().putString("domain", domain);
int versionCode = getVersionCode();
isForceUpdate = isForceUpdate && forceUpdateVersion > versionCode;
if (!StringHelper.isEmpty(downloadLink)) {
spu.putString(getmContext().getString(R.string.downloadLink), downloadLink);
SharedPreUtils.getInstance().putString(getmContext().getString(R.string.downloadLink), downloadLink);
} else {
spu.putString(getmContext().getString(R.string.downloadLink), URLCONST.APP_DIR_URL);
SharedPreUtils.getInstance().putString(getmContext().getString(R.string.downloadLink), URLCONST.APP_DIR_URL);
}
String[] updateContents = updateContent.split("/");
for (String string : updateContents) {

@ -1,5 +1,6 @@
package xyz.fycz.myreader.model.third3.http
import android.util.Log
import okhttp3.ConnectionSpec
import okhttp3.Credentials
import okhttp3.Interceptor
@ -47,24 +48,31 @@ val okHttpClient: OkHttpClient by lazy {
builder.build()
}
val globalProxy by lazy {
val spu = SharedPreUtils.getInstance()
val type = if (spu.getInt("proxyType") == 0) {
val globalProxy: String
get() {
val enableProxy = SharedPreUtils.getInstance().getBoolean("enableProxy")
if (!enableProxy) {
return ""
}
val type = if (SharedPreUtils.getInstance().getInt("proxyType") == 0) {
"http"
} else {
"socks5"
}
val host = spu.getString("proxyHost")
val port = spu.getString("proxyPort")
val username = spu.getString("proxyUsername")
val password = spu.getString("proxyPassword")
"$type://$host:$port@$username@$password"
}
val host = SharedPreUtils.getInstance().getString("proxyHost")
val port = SharedPreUtils.getInstance().getString("proxyPort")
val username = SharedPreUtils.getInstance().getString("proxyUsername")
val password = SharedPreUtils.getInstance().getString("proxyPassword")
return "$type://$host:$port@$username@$password"
}
/**
* 缓存代理okHttp
*/
fun getProxyClient(proxy: String? = globalProxy, noProxy: Boolean = false): OkHttpClient {
fun getProxyClient(proxy0: String? = null, noProxy: Boolean = false): OkHttpClient {
var proxy = proxy0
if (proxy.isNullOrEmpty()) proxy = globalProxy
Log.d("getProxyClient", "proxy=$proxy")
if (proxy.isNullOrBlank() || noProxy) {
return okHttpClient
}

@ -30,7 +30,6 @@ import xyz.fycz.myreader.util.utils.FileUtils;
public class AdSettingActivity extends BaseActivity<ActivityAdSettingBinding> {
private LoadingDialog loadingDialog;
private SharedPreUtils spu;
private int curAdTimes;
private int curAdCount;
private boolean bookDetailAd;
@ -51,9 +50,8 @@ public class AdSettingActivity extends BaseActivity<ActivityAdSettingBinding> {
@Override
protected void initData(Bundle savedInstanceState) {
spu = SharedPreUtils.getInstance();
curAdTimes = spu.getInt("curAdTimes", 3);
String splashAdCount = spu.getString("splashAdCount");
curAdTimes = SharedPreUtils.getInstance().getInt("curAdTimes", 3);
String splashAdCount = SharedPreUtils.getInstance().getString("splashAdCount");
String[] splashAdCounts = splashAdCount.split(":");
String today = DateHelper.getYearMonthDay1();
if (today.equals(splashAdCounts[0])){
@ -61,7 +59,7 @@ public class AdSettingActivity extends BaseActivity<ActivityAdSettingBinding> {
}else {
curAdCount = 0;
}
bookDetailAd = spu.getBoolean("bookDetailAd", false);
bookDetailAd = SharedPreUtils.getInstance().getBoolean("bookDetailAd", false);
}
@Override
@ -135,7 +133,7 @@ public class AdSettingActivity extends BaseActivity<ActivityAdSettingBinding> {
.setTitle(getString(R.string.splash_ad_times))
.setSingleChoiceItems(adTimes, checked, (dialog, which) -> {
curAdTimes = ints[which];
spu.putInt("curAdTimes", curAdTimes);
SharedPreUtils.getInstance().putInt("curAdTimes", curAdTimes);
binding.tvSplashCurAdTimes.setText(getString(R.string.splash_cur_ad_times, adTimes[which], curAdCount + "次"));
dialog.dismiss();
}).setNegativeButton("取消", null).show();*/
@ -143,7 +141,7 @@ public class AdSettingActivity extends BaseActivity<ActivityAdSettingBinding> {
.setSelection(checked)
.setOnMenuItemClickListener((dialog, text, which) -> {
curAdTimes = ints[which];
spu.putInt("curAdTimes", curAdTimes);
SharedPreUtils.getInstance().putInt("curAdTimes", curAdTimes);
binding.tvSplashCurAdTimes.setText(getString(R.string.splash_cur_ad_times, adTimes[which], curAdCount + "次"));
return false;
}).setCancelButton(R.string.cancel);
@ -157,7 +155,7 @@ public class AdSettingActivity extends BaseActivity<ActivityAdSettingBinding> {
});
binding.rlBookDetailAd.setOnClickListener(v -> {
bookDetailAd = !bookDetailAd;
spu.putBoolean("bookDetailAd", bookDetailAd);
SharedPreUtils.getInstance().putBoolean("bookDetailAd", bookDetailAd);
binding.scBookDetailAd.setChecked(bookDetailAd);
});
binding.rlDeleteAdFile.setOnClickListener(v -> {

@ -182,12 +182,11 @@ public class BookstoreActivity extends BaseActivity<ActiityBookstoreBinding> {
super.processLogic();
getData();
if (findCrawler3.needSearch()) {
SharedPreUtils spu = SharedPreUtils.getInstance();
boolean isReadTopTip = spu.getBoolean(getString(R.string.isReadTopTip), false);
boolean isReadTopTip = SharedPreUtils.getInstance().getBoolean(getString(R.string.isReadTopTip), false);
if (!isReadTopTip) {
DialogCreator.createCommonDialog(this, "提示", getResources().getString(R.string.top_sort_tip, title),
true, "知道了", "不再提示", null,
(dialog, which) -> spu.putBoolean(getString(R.string.isReadTopTip), true));
(dialog, which) -> SharedPreUtils.getInstance().putBoolean(getString(R.string.isReadTopTip), true));
}
}
}
@ -197,13 +196,12 @@ public class BookstoreActivity extends BaseActivity<ActiityBookstoreBinding> {
*/
private void getData() {
if (findCrawler3 instanceof QiDianMobileRank) {
SharedPreUtils spu = SharedPreUtils.getInstance();
if (spu.getString(getString(R.string.qdCookie), "").equals("")) {
if (SharedPreUtils.getInstance().getString(getString(R.string.qdCookie), "").equals("")) {
((QiDianMobileRank) findCrawler3).initCookie(this, new ResultCallback() {
@Override
public void onFinish(Object o, int code) {
if (App.isDestroy(BookstoreActivity.this)) return;
spu.putString(getString(R.string.qdCookie), (String) o);
SharedPreUtils.getInstance().putString(getString(R.string.qdCookie), (String) o);
mBookTypes = findCrawler3.getBookTypes();
initBooks();
}

@ -485,9 +485,8 @@ public class SearchBookActivity extends BaseActivity<ActivitySearchBookBinding>
mHotKeys.addAll(Arrays.asList(suggestion));
initSuggestionList();
} else {
SharedPreUtils spu = SharedPreUtils.getInstance();
Single.create((SingleOnSubscribe<Boolean>) emitter -> {
String cookie = spu.getString(getString(R.string.qdCookie), "");
String cookie = SharedPreUtils.getInstance().getString(getString(R.string.qdCookie), "");
String url = "https://m.qidian.com/majax/search/auto?kw=&";
if (cookie.equals("")) {
cookie = "_csrfToken=eXRDlZxmRDLvFAmdgzqvwWAASrxxp2WkVlH4ZM7e; newstatisticUUID=1595991935_2026387981";

@ -48,7 +48,6 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding> {
public static final String TAG = SplashActivity.class.getSimpleName();
public static int WAIT_INTERVAL = 0;
private SharedPreUtils spu;
private int todayAdCount;
private int adTimes;
private boolean hasStart = false;
@ -137,9 +136,8 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding> {
@Override
protected void initData(Bundle savedInstanceState) {
startToAd = getIntent().getBooleanExtra(INTENT_TO_AD, false);
spu = SharedPreUtils.getInstance();
String splashAdCount = spu.getString("splashAdCount");
adTimes = spu.getInt("curAdTimes", 3);
String splashAdCount = SharedPreUtils.getInstance().getString("splashAdCount");
adTimes = SharedPreUtils.getInstance().getInt("curAdTimes", 3);
String[] splashAdCounts = splashAdCount.split(":");
String today = DateHelper.getYearMonthDay1();
if (today.equals(splashAdCounts[0])) {
@ -374,6 +372,6 @@ public class SplashActivity extends BaseActivity<ActivitySplashBinding> {
private void countTodayAd() {
String today = DateHelper.getYearMonthDay1();
todayAdCount++;
spu.putString("splashAdCount", today + ":" + todayAdCount);
SharedPreUtils.getInstance().putString("splashAdCount", today + ":" + todayAdCount);
}
}

@ -139,9 +139,8 @@ public class BookGroupDialog {
mBookGroupService.addBookGroup(bookGroup);
} else {
mBookGroupService.updateEntity(bookGroup);
SharedPreUtils spu = SharedPreUtils.getInstance();
if (spu.getString(mContext.getString(R.string.curBookGroupName), "").equals(oldName)) {
spu.putString(mContext.getString(R.string.curBookGroupName), newGroupName);
if (SharedPreUtils.getInstance().getString(mContext.getString(R.string.curBookGroupName), "").equals(oldName)) {
SharedPreUtils.getInstance().putString(mContext.getString(R.string.curBookGroupName), newGroupName);
if (onGroup != null) onGroup.change();
}
}
@ -172,10 +171,9 @@ public class BookGroupDialog {
if (sb.length() > 0) {
sb.deleteCharAt(sb.lastIndexOf("、"));
}
SharedPreUtils spu = SharedPreUtils.getInstance();
if (mBookGroupService.getGroupById(spu.getString(mContext.getString(R.string.curBookGroupId), "")) == null) {
spu.putString(mContext.getString(R.string.curBookGroupId), "");
spu.putString(mContext.getString(R.string.curBookGroupName), "");
if (mBookGroupService.getGroupById(SharedPreUtils.getInstance().getString(mContext.getString(R.string.curBookGroupId), "")) == null) {
SharedPreUtils.getInstance().putString(mContext.getString(R.string.curBookGroupId), "");
SharedPreUtils.getInstance().putString(mContext.getString(R.string.curBookGroupName), "");
onGroup.change();
}
ToastUtils.showSuccess("分组[" + sb.toString() + "]删除成功!");

@ -2,6 +2,7 @@ package xyz.fycz.myreader.ui.fragment
import android.content.DialogInterface
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -37,7 +38,6 @@ class ProxyFragment : BaseFragment() {
private lateinit var proxyPassword: String
private var mNoProxySourcesDia: AlertDialog? = null
private val proxyTypeArr = arrayOf("http", "socks5")
private val spu: SharedPreUtils = SharedPreUtils.getInstance()
override fun bindView(inflater: LayoutInflater, container: ViewGroup?): View {
binding = FragmentProxySettingBinding.inflate(inflater, container, false)
@ -45,12 +45,13 @@ class ProxyFragment : BaseFragment() {
}
override fun initData(savedInstanceState: Bundle?) {
enableProxy = spu.getBoolean("enableProxy")
proxyType = spu.getInt("proxyType")
proxyHost = spu.getString("proxyHost")
proxyPort = spu.getString("proxyHost")
proxyUsername = spu.getString("proxyUsername")
proxyPassword = spu.getString("proxyPassword")
enableProxy = SharedPreUtils.getInstance().getBoolean("enableProxy")
Log.d("ProxyFragment", "enableProxy=$enableProxy")
proxyType = SharedPreUtils.getInstance().getInt("proxyType")
proxyHost = SharedPreUtils.getInstance().getString("proxyHost")
proxyPort = SharedPreUtils.getInstance().getString("proxyPort")
proxyUsername = SharedPreUtils.getInstance().getString("proxyUsername")
proxyPassword = SharedPreUtils.getInstance().getString("proxyPassword")
}
override fun initWidget(savedInstanceState: Bundle?) {
@ -58,16 +59,17 @@ class ProxyFragment : BaseFragment() {
if (enableProxy) binding.llContent.visibility = View.VISIBLE
binding.tvProxyType.text = proxyTypeArr[proxyType]
binding.tvProxyHost.text = proxyHost.ifEmpty { "请输入代理服务器地址" }
binding.tvProxyPort.text = proxyHost.ifEmpty { "输入代理服务器端口" }
binding.tvProxyUsername.text = proxyHost.ifEmpty { "请输入代理认证用户名" }
binding.tvProxyPassword.text = proxyHost.ifEmpty { "请输入代理认证密码" }
binding.tvProxyPort.text = proxyPort.ifEmpty { "选择代理服务器端口" }
binding.tvProxyUsername.text = proxyUsername.ifEmpty { "请输入代理认证用户名" }
binding.tvProxyPassword.text = proxyPassword.ifEmpty { "请输入代理认证密码" }
}
override fun initClick() {
binding.rlEnableProxy.onClick {
enableProxy = !enableProxy
binding.scEnableProxy.isChecked = enableProxy
spu.putBoolean("enableProxy", enableProxy)
SharedPreUtils.getInstance().putBoolean("enableProxy", enableProxy)
Log.d("ProxyFragment", "putBoolean=$enableProxy")
binding.llContent.visibility = if (enableProxy) View.VISIBLE else View.GONE
}
@ -90,7 +92,7 @@ class ProxyFragment : BaseFragment() {
) { dialog: DialogInterface, _: Int ->
proxyHost = tem
binding.tvProxyHost.text = proxyHost
spu.putString("proxyHost", proxyHost)
SharedPreUtils.getInstance().putString("proxyHost", proxyHost)
dialog.dismiss()
}
}
@ -100,14 +102,14 @@ class ProxyFragment : BaseFragment() {
val threadPick = view.findViewById<NumberPicker>(R.id.number_picker)
threadPick.maxValue = 99999
threadPick.minValue = 10
threadPick.value = proxyPort.toInt()
threadPick.value = if (proxyPort.isEmpty()) 1080 else proxyPort.toInt()
threadPick.setOnScrollListener { _: NumberPicker?, _: Int -> }
MyAlertDialog.build(context)
.setTitle(R.string.proxy_port)
.setView(view)
.setPositiveButton(R.string.confirm) { _: DialogInterface?, _: Int ->
proxyPort = threadPick.value.toString()
spu.putString("proxyPort", proxyPort)
SharedPreUtils.getInstance().putString("proxyPort", proxyPort)
binding.tvProxyPort.text = proxyPort
}.setNegativeButton(R.string.cancel, null)
.show()
@ -121,7 +123,7 @@ class ProxyFragment : BaseFragment() {
) { dialog: DialogInterface, _: Int ->
proxyUsername = tem
binding.tvProxyUsername.text = proxyUsername
spu.putString("proxyUsername", proxyUsername)
SharedPreUtils.getInstance().putString("proxyUsername", proxyUsername)
dialog.dismiss()
}
}
@ -134,7 +136,7 @@ class ProxyFragment : BaseFragment() {
) { dialog: DialogInterface, _: Int ->
proxyPassword = tem
binding.tvProxyPassword.text = proxyPassword
spu.putString("proxyPassword", proxyPassword)
SharedPreUtils.getInstance().putString("proxyPassword", proxyPassword)
dialog.dismiss()
}
}

@ -26,6 +26,7 @@ public class SharedPreUtils {
};
}
//不能
public static SharedPreUtils getInstance() {
return getInstance(false);
}

@ -158,10 +158,9 @@ public class AdUtils {
}
public static boolean checkTodayShowAd() {
SharedPreUtils spu = SharedPreUtils.getInstance();
String splashAdCount = spu.getString("splashAdCount");
boolean bookDetailAd = spu.getBoolean("bookDetailAd", true);
int adTimes = spu.getInt("curAdTimes", 3);
String splashAdCount = SharedPreUtils.getInstance().getString("splashAdCount");
boolean bookDetailAd = SharedPreUtils.getInstance().getBoolean("bookDetailAd", true);
int adTimes = SharedPreUtils.getInstance().getInt("curAdTimes", 3);
String[] splashAdCounts = splashAdCount.split(":");
String today = DateHelper.getYearMonthDay1();
int todayAdCount;

@ -155,7 +155,6 @@ public class LanZousApi {
}
private static String getKey(String html) {
//SharedPreUtils spu = SharedPreUtils.getInstance();
String lanzousKeyStart = "var pposturl = '";
String keyName = StringHelper.getSubString(html, "'sign':", ",");
if (keyName.endsWith("'")) {

@ -41,21 +41,20 @@ public class ReadCrawlerUtil {
}
public static ArrayList<ReadCrawler> getReadCrawlers() {
SharedPreUtils spu = SharedPreUtils.getInstance();
String searchSource = spu.getString(App.getmContext().getString(R.string.searchSource), null);
String searchSource = SharedPreUtils.getInstance().getString(App.getmContext().getString(R.string.searchSource), null);
ArrayList<ReadCrawler> readCrawlers = new ArrayList<>();
if (searchSource == null) {
StringBuilder sb = new StringBuilder();
for (LocalBookSource bookSource : LocalBookSource.values()) {
if (bookSource.equals(LocalBookSource.fynovel) || bookSource.equals(LocalBookSource.local))
continue;
sb.append(bookSource.toString());
sb.append(bookSource);
sb.append(",");
readCrawlers.add(getReadCrawler(bookSource.toString()));
}
sb.deleteCharAt(sb.lastIndexOf(","));
searchSource = sb.toString();
spu.putString(App.getmContext().getString(R.string.searchSource), searchSource);
SharedPreUtils.getInstance().putString(App.getmContext().getString(R.string.searchSource), searchSource);
} else if (!"".equals(searchSource)) {
String[] sources = searchSource.split(",");
for (String source : sources) {
@ -76,8 +75,7 @@ public class ReadCrawlerUtil {
}
public static HashMap<CharSequence, Boolean> getDisableSources() {
SharedPreUtils spu = SharedPreUtils.getInstance();
String searchSource = spu.getString(App.getmContext().getString(R.string.searchSource), null);
String searchSource = SharedPreUtils.getInstance().getString(App.getmContext().getString(R.string.searchSource), null);
HashMap<CharSequence, Boolean> mSources = new LinkedHashMap<>();
if (searchSource == null) {
for (LocalBookSource bookSource : LocalBookSource.values()) {
@ -116,8 +114,7 @@ public class ReadCrawlerUtil {
}
public synchronized static void addReadCrawler(LocalBookSource... bookSources) {
SharedPreUtils spu = SharedPreUtils.getInstance();
String searchSource = spu.getString(App.getmContext().getString(R.string.searchSource));
String searchSource = SharedPreUtils.getInstance().getString(App.getmContext().getString(R.string.searchSource));
if ("".equals(searchSource)) {
resetReadCrawlers();
return;
@ -131,8 +128,7 @@ public class ReadCrawlerUtil {
}
public synchronized static void removeReadCrawler(String... bookSources) {
SharedPreUtils spu = SharedPreUtils.getInstance();
String searchSource = spu.getString(App.getmContext().getString(R.string.searchSource), null);
String searchSource = SharedPreUtils.getInstance().getString(App.getmContext().getString(R.string.searchSource), null);
if (searchSource == null) {
return;
}
@ -153,7 +149,7 @@ public class ReadCrawlerUtil {
sb.append(",");
}
sb.deleteCharAt(sb.lastIndexOf(","));
spu.putString(App.getmContext().getString(R.string.searchSource), sb.toString());
SharedPreUtils.getInstance().putString(App.getmContext().getString(R.string.searchSource), sb.toString());
}
public static ReadCrawler getReadCrawler(String bookSource) {

@ -147,8 +147,7 @@ public class QiDianFindCrawler extends BaseFindCrawler {
kind.setMaxPage(5);
}
url = url.replace("{sex}", !isFemale ? sex[0] : sex[1]);
SharedPreUtils spu = SharedPreUtils.getInstance();
String cookie = spu.getString(App.getmContext().getString(R.string.qdCookie), "");
String cookie = SharedPreUtils.getInstance().getString(App.getmContext().getString(R.string.qdCookie), "");
if (!cookie.equals("")) {
url = url.replace("{cookie}", StringHelper.getSubString(cookie, "_csrfToken=", ";"));
} else {

@ -144,8 +144,7 @@ public class QiDianMobileRank extends FindCrawler3 {
url = sortUrl.replace("{catId}", sortName.get(name) + "");
}
url = url.replace("{sex}", !isFemale ? sex[0] : sex[1]);
SharedPreUtils spu = SharedPreUtils.getInstance();
String cookie = spu.getString(App.getmContext().getString(R.string.qdCookie), "");
String cookie = SharedPreUtils.getInstance().getString(App.getmContext().getString(R.string.qdCookie), "");
if (!cookie.equals("")) {
url = url.replace("{cookie}", StringHelper.getSubString(cookie, "_csrfToken=", ";"));
} else {

@ -570,7 +570,7 @@
<string name="net_error_10003">数据解析失败</string>
<!--error string end-->
<string name="proxy_setting">代理设置</string>
<string name="proxy_setting">软件代理设置</string>
<string name="proxy_setting_tip">设置软件及书源代理</string>
<string name="proxy_type">代理类型</string>
<string name="proxy_host">代理服务器地址</string>

Loading…
Cancel
Save