开发站与公开站API接口调试完成
This commit is contained in:
parent
b1e2a018d8
commit
d474eb6158
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 29 16:59:59 GMT 2025
|
#Sat Mar 29 17:35:04 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=15.2
|
||||||
publishVersion=15.2.1
|
publishVersion=15.2.1
|
||||||
buildCount=25
|
buildCount=38
|
||||||
baseBetaVersion=15.2.2
|
baseBetaVersion=15.2.2
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<network-security-config>
|
<network-security-config>
|
||||||
<domain-config cleartextTrafficPermitted="true">
|
<domain-config cleartextTrafficPermitted="true">
|
||||||
<domain includeSubdomains="false">www.winboll.cc</domain>
|
<domain includeSubdomains="true">winboll.cc</domain>
|
||||||
<domain includeSubdomains="false">dev.winboll.cc</domain>
|
|
||||||
</domain-config>
|
</domain-config>
|
||||||
</network-security-config>
|
</network-security-config>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Mar 29 16:59:59 GMT 2025
|
#Sat Mar 29 17:35:04 GMT 2025
|
||||||
stageCount=2
|
stageCount=2
|
||||||
libraryProject=libaes
|
libraryProject=libaes
|
||||||
baseVersion=15.2
|
baseVersion=15.2
|
||||||
publishVersion=15.2.1
|
publishVersion=15.2.1
|
||||||
buildCount=25
|
buildCount=38
|
||||||
baseBetaVersion=15.2.2
|
baseBetaVersion=15.2.2
|
||||||
|
@ -27,7 +27,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
MyServiceConnection mMyServiceConnection;
|
MyServiceConnection mMyServiceConnection;
|
||||||
volatile boolean mIsWinBollClientThreadRunning;
|
volatile boolean mIsWinBollClientThreadRunning;
|
||||||
volatile boolean mIsEnableService;
|
volatile boolean mIsEnableService;
|
||||||
WinBollClientThread mWinBollClientThread;
|
volatile WinBollClientThread mWinBollClientThread;
|
||||||
|
|
||||||
public boolean isWinBollClientThreadRunning() {
|
public boolean isWinBollClientThreadRunning() {
|
||||||
return mIsWinBollClientThreadRunning;
|
return mIsWinBollClientThreadRunning;
|
||||||
@ -80,7 +80,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
return mIsEnableService ? Service.START_STICKY: super.onStartCommand(intent, flags, startId);
|
return mIsEnableService ? Service.START_STICKY: super.onStartCommand(intent, flags, startId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void runMainThread() {
|
synchronized void runMainThread() {
|
||||||
if (mWinBollClientThread == null) {
|
if (mWinBollClientThread == null) {
|
||||||
ToastUtils.show("runMainThread()");
|
ToastUtils.show("runMainThread()");
|
||||||
mWinBollClientThread = new WinBollClientThread();
|
mWinBollClientThread = new WinBollClientThread();
|
||||||
@ -163,7 +163,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
// 设置运行状态
|
// 设置运行状态
|
||||||
mIsWinBollClientThreadRunning = true;
|
mIsWinBollClientThreadRunning = true;
|
||||||
|
|
||||||
ToastUtils.show("run()");
|
LogUtils.d(TAG, "WinBollClientThread run()");
|
||||||
|
|
||||||
// 唤醒守护进程
|
// 唤醒守护进程
|
||||||
//wakeupAndBindAssistant();
|
//wakeupAndBindAssistant();
|
||||||
@ -178,7 +178,7 @@ public class WinBollClientService extends Service implements IWinBollClientServi
|
|||||||
username = "WinBoll";
|
username = "WinBoll";
|
||||||
password = "WinBollPowerByZhanGSKen";
|
password = "WinBollPowerByZhanGSKen";
|
||||||
}
|
}
|
||||||
targetUrl = "https://" + (GlobalApplication.isDebuging() ?"dev": "www") + ".winboll.cc/api"; // 替换为实际测试的URL
|
targetUrl = "https://" + (GlobalApplication.isDebuging() ?"dev.winboll": "winboll") + ".cc/api/"; // 替换为实际测试的URL
|
||||||
|
|
||||||
while (mIsEnableService) {
|
while (mIsEnableService) {
|
||||||
// 显示运行状态
|
// 显示运行状态
|
||||||
|
@ -7,14 +7,12 @@ package cc.winboll.studio.libaes.winboll;
|
|||||||
*/
|
*/
|
||||||
import cc.winboll.studio.libappbase.LogUtils;
|
import cc.winboll.studio.libappbase.LogUtils;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import okhttp3.Authenticator;
|
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Callback;
|
import okhttp3.Callback;
|
||||||
import okhttp3.Credentials;
|
import okhttp3.Credentials;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
import okhttp3.Route;
|
|
||||||
|
|
||||||
public class WinBollServerConnectionTestThread extends Thread {
|
public class WinBollServerConnectionTestThread extends Thread {
|
||||||
|
|
||||||
@ -45,23 +43,17 @@ public class WinBollServerConnectionTestThread extends Thread {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
LogUtils.d(TAG, String.format("run() url %s\nusername %s\npassword %s", url, username, password));
|
LogUtils.d(TAG, String.format("run() url %s\nusername %s\npassword %s", url, username, password));
|
||||||
OkHttpClient client = new OkHttpClient.Builder()
|
// 构建包含认证信息的请求
|
||||||
.connectTimeout(connectTimeout, java.util.concurrent.TimeUnit.MILLISECONDS)
|
String credential = Credentials.basic(username, password);
|
||||||
.readTimeout(readTimeout, java.util.concurrent.TimeUnit.MILLISECONDS)
|
LogUtils.d(TAG, String.format("credential %s", credential));
|
||||||
.authenticator(new Authenticator() {
|
|
||||||
@Override
|
|
||||||
public Request authenticate(Route route, Response response) throws IOException {
|
|
||||||
return response.request().newBuilder()
|
|
||||||
.header("Authorization", Credentials.basic(username, password))
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.build();
|
|
||||||
|
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
|
.header("Accept", "text/plain") // 设置正确的Content-Type头
|
||||||
|
.header("Authorization", credential)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Call call = client.newCall(request);
|
Call call = client.newCall(request);
|
||||||
call.enqueue(new Callback() {
|
call.enqueue(new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user