Commit e0b01705 authored by fallenstardust's avatar fallenstardust

更改远端版本获取地址

parent b1a8832b
package cn.garymb.ygomobile.ui.home; package cn.garymb.ygomobile.ui.home;
import static cn.garymb.ygomobile.Constants.ASSET_SERVER_LIST; import static cn.garymb.ygomobile.Constants.ASSET_SERVER_LIST;
import static cn.garymb.ygomobile.Constants.URL_HOME_VERSION;
import static cn.garymb.ygomobile.Constants.URL_YGO233_DATAVER; import static cn.garymb.ygomobile.Constants.URL_YGO233_DATAVER;
import static cn.garymb.ygomobile.Constants.URL_YGO233_DOWNLOAD_LINK;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
...@@ -334,7 +334,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -334,7 +334,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
} }
public void checkUpgrade() { public void checkUpgrade() {
OkhttpUtil.get(URL_YGO233_DOWNLOAD_LINK, new Callback() { OkhttpUtil.get(URL_HOME_VERSION, new Callback() {
@Override @Override
public void onFailure(Call call, IOException e) { public void onFailure(Call call, IOException e) {
Message message = new Message(); Message message = new Message();
...@@ -349,7 +349,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -349,7 +349,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
String json = response.body().string(); String json = response.body().string();
Message message = new Message(); Message message = new Message();
message.what = TYPE_GET_VERSION_OK; message.what = TYPE_GET_VERSION_OK;
message.obj = StringUtils.substringBetween(json, "https://netdisk.link/YGOMobile_", ".apk/links"); message.obj = json;
handler.sendMessage(message); handler.sendMessage(message);
} }
}); });
......
...@@ -33,6 +33,7 @@ import static cn.garymb.ygomobile.Constants.PREF_WINDOW_TOP_BOTTOM; ...@@ -33,6 +33,7 @@ import static cn.garymb.ygomobile.Constants.PREF_WINDOW_TOP_BOTTOM;
import static cn.garymb.ygomobile.Constants.SETTINGS_AVATAR; import static cn.garymb.ygomobile.Constants.SETTINGS_AVATAR;
import static cn.garymb.ygomobile.Constants.SETTINGS_CARD_BG; import static cn.garymb.ygomobile.Constants.SETTINGS_CARD_BG;
import static cn.garymb.ygomobile.Constants.SETTINGS_COVER; import static cn.garymb.ygomobile.Constants.SETTINGS_COVER;
import static cn.garymb.ygomobile.Constants.URL_HOME_VERSION;
import static cn.garymb.ygomobile.Constants.URL_YGO233_DOWNLOAD_LINK; import static cn.garymb.ygomobile.Constants.URL_YGO233_DOWNLOAD_LINK;
import static cn.garymb.ygomobile.ui.home.ResCheckTask.getDatapath; import static cn.garymb.ygomobile.ui.home.ResCheckTask.getDatapath;
...@@ -253,7 +254,7 @@ public class SettingFragment extends PreferenceFragmentPlus { ...@@ -253,7 +254,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
joinQQGroup(groupkey); joinQQGroup(groupkey);
} }
if (PREF_CHECK_UPDATE.equals(key)) { if (PREF_CHECK_UPDATE.equals(key)) {
OkhttpUtil.get(URL_YGO233_DOWNLOAD_LINK, new Callback() { OkhttpUtil.get(URL_HOME_VERSION, new Callback() {
@Override @Override
public void onFailure(Call call, IOException e) { public void onFailure(Call call, IOException e) {
Message message = new Message(); Message message = new Message();
...@@ -268,7 +269,7 @@ public class SettingFragment extends PreferenceFragmentPlus { ...@@ -268,7 +269,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
String json = response.body().string(); String json = response.body().string();
Message message = new Message(); Message message = new Message();
message.what = TYPE_SETTING_GET_VERSION_OK; message.what = TYPE_SETTING_GET_VERSION_OK;
message.obj = StringUtils.substringBetween(json, "https://netdisk.link/YGOMobile_", ".apk/links"); message.obj = json;
handler.sendMessage(message); handler.sendMessage(message);
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment