服务器 Http访问验证部分代码整理

This commit is contained in:
ZhanGSKen 2025-04-02 19:43:42 +08:00
parent 7fd10086eb
commit a9ce480f9f
4 changed files with 12 additions and 8 deletions

View File

@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Mon Mar 31 19:41:19 HKT 2025
#Wed Apr 02 11:42:36 GMT 2025
stageCount=5
libraryProject=libaes
baseVersion=15.2
publishVersion=15.2.4
buildCount=0
buildCount=5
baseBetaVersion=15.2.5

View File

@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle
#Mon Mar 31 19:41:08 HKT 2025
#Wed Apr 02 11:42:36 GMT 2025
stageCount=5
libraryProject=libaes
baseVersion=15.2
publishVersion=15.2.4
buildCount=0
buildCount=5
baseBetaVersion=15.2.5

View File

@ -118,7 +118,7 @@ public class AboutView extends LinearLayout {
} else {
mszGitea = "https://gitea.winboll.cc/" + mAPPInfo.getAppGitOwner() + "/" + mszAppGitName + "/src/branch/" + mAPPInfo.getAppGitAPPBranch() + "/" + mAPPInfo.getAppGitAPPSubProjectFolder();
}
if (GlobalApplication.isDebuging()) {
LayoutInflater inflater = LayoutInflater.from(mContext);
@ -150,7 +150,7 @@ public class AboutView extends LinearLayout {
// 初始化标题栏
//setSubtitle(getContext().getString(R.string.text_about));
// LinearLayout llMain = findViewById(R.id.viewaboutLinearLayout1);
// llMain.addView(createAboutPage());
@ -324,14 +324,17 @@ public class AboutView extends LinearLayout {
PrefUtils.saveString(mContext, "metDevUserName", metDevUserName.getText().toString());
PrefUtils.saveString(mContext, "metDevUserPassword", metDevUserPassword.getText().toString());
} else {
credential = Credentials.basic("WinBoll", "WinBollPowerByZhanGSKen");
String username = "WinBoll";
String password = "WinBollPowerByZhanGSKen";
credential = Credentials.basic(username, password);
}
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(szUrl)
.header("Accept", "text/plain") // 设置正确的Content-Type头
.header("Authorization", credential)
.build();
OkHttpClient client = new OkHttpClient();
Call call = client.newCall(request);
call.enqueue(new Callback() {
@Override

View File

@ -252,6 +252,7 @@ public class WinBollServiceStatusView extends LinearLayout {
username = "WinBoll";
password = "WinBollPowerByZhanGSKen";
}
LogUtils.d(TAG, String.format("Connection Start. targetUrl %s", targetUrl));
WinBollServerConnectionThread thread = new WinBollServerConnectionThread(
targetUrl,