|
@@ -259,12 +259,12 @@ android {
|
|
resValue "string", "app_name", "O"
|
|
resValue "string", "app_name", "O"
|
|
buildConfigField "String", "BASE_URL", "\"https://india.gdtabletouch.com\""
|
|
buildConfigField "String", "BASE_URL", "\"https://india.gdtabletouch.com\""
|
|
buildConfigField "String", "UPDATE_KEY", "\"87d8f3b8-3e95-47f4-9d9d-b7affd5e997c\""
|
|
buildConfigField "String", "UPDATE_KEY", "\"87d8f3b8-3e95-47f4-9d9d-b7affd5e997c\""
|
|
- buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user10/man/t4/\""
|
|
|
|
|
|
+ buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user10/man/t4/p11081\""
|
|
buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
|
|
buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
|
|
buildConfigField "String", "UPDATE_JSON", "\"config.json\""
|
|
buildConfigField "String", "UPDATE_JSON", "\"config.json\""
|
|
buildConfigField "String", "WEB_URL", "\"\""
|
|
buildConfigField "String", "WEB_URL", "\"\""
|
|
buildConfigField "String", "FRPC_IP", "\"13.212.226.7\""
|
|
buildConfigField "String", "FRPC_IP", "\"13.212.226.7\""
|
|
- buildConfigField "String", "FRPC_PORT", "\"11080\""
|
|
|
|
|
|
+ buildConfigField "String", "FRPC_PORT", "\"11081\""
|
|
manifestPlaceholders = [app_icon: "@mipmap/ic_o"]
|
|
manifestPlaceholders = [app_icon: "@mipmap/ic_o"]
|
|
ndk {
|
|
ndk {
|
|
//noinspection ChromeOsAbiSupport
|
|
//noinspection ChromeOsAbiSupport
|
|
@@ -719,11 +719,10 @@ android {
|
|
// 写入 JSON 文件
|
|
// 写入 JSON 文件
|
|
def jsonFile = file("${apkFilePath}/config.json")
|
|
def jsonFile = file("${apkFilePath}/config.json")
|
|
jsonFile.write(json.toString())
|
|
jsonFile.write(json.toString())
|
|
-
|
|
|
|
def localPathConfig = "${apkFilePath}/config.json"
|
|
def localPathConfig = "${apkFilePath}/config.json"
|
|
def localPathApk = "${apkFilePath}/guy.apk"
|
|
def localPathApk = "${apkFilePath}/guy.apk"
|
|
- def updateUrlConfig = "/data/wwwroot/up.lkluckpanda.online/${variant.productFlavors.get(0).name}/config.json"
|
|
|
|
- def updateUrlApk = "/data/wwwroot/up.lkluckpanda.online/${variant.productFlavors.get(0).name}/guy.apk"
|
|
|
|
|
|
+ def updateUrlConfig = "/data/wwwroot/up.lkluckpanda.online/${variant.productFlavors.get(0).buildConfigFields.get("UPDATE_BASE_URL").value.replace("http://up.lkluckpanda.online/",'').replace('"','')}/config.json"
|
|
|
|
+ def updateUrlApk = "/data/wwwroot/up.lkluckpanda.online/${variant.productFlavors.get(0).buildConfigFields.get("UPDATE_BASE_URL").value.replace("http://up.lkluckpanda.online/",'').replace('"','')}/guy.apk"
|
|
def username ='root'
|
|
def username ='root'
|
|
def host = '13.250.5.181'
|
|
def host = '13.250.5.181'
|
|
def port = '22'
|
|
def port = '22'
|
|
@@ -758,11 +757,35 @@ android {
|
|
" ssh_client.connect(hostname=host, port=port, username=username, password=password)\n" +
|
|
" ssh_client.connect(hostname=host, port=port, username=username, password=password)\n" +
|
|
" # 创建一个SFTP客户端对象\n" +
|
|
" # 创建一个SFTP客户端对象\n" +
|
|
" sftp_client = ssh_client.open_sftp()\n" +
|
|
" sftp_client = ssh_client.open_sftp()\n" +
|
|
|
|
+ "\n" +
|
|
|
|
+ " # 检查远程文件是否存在,如果不存在,则创建路径中的目录和文件\n" +
|
|
|
|
+ " try:\n" +
|
|
|
|
+ " sftp_client.stat(remote_path)\n" +
|
|
|
|
+ " print(f\"远程文件 {remote_path} 已存在\")\n" +
|
|
|
|
+ " except FileNotFoundError:\n" +
|
|
|
|
+ " # 获取远程路径中的目录部分\n" +
|
|
|
|
+ " remote_dir = os.path.dirname(remote_path)\n" +
|
|
|
|
+ " # 创建远程目录\n" +
|
|
|
|
+ " if remote_dir:\n" +
|
|
|
|
+ " try:\n" +
|
|
|
|
+ " sftp_client.stat(remote_dir)\n" +
|
|
|
|
+ " except FileNotFoundError:\n" +
|
|
|
|
+ " sftp_client.mkdir(remote_dir)\n" +
|
|
|
|
+ " print(f\"已在远程服务器上创建目录 {remote_dir}\")\n" +
|
|
|
|
+ " # 创建远程文件\n" +
|
|
|
|
+ " sftp_client.open(remote_path, 'w').close()\n" +
|
|
|
|
+ " print(f\"已在远程服务器上创建文件 {remote_path}\")\n" +
|
|
|
|
+ "\n" +
|
|
" # 上传文件,并传入回调函数来显示传输进度\n" +
|
|
" # 上传文件,并传入回调函数来显示传输进度\n" +
|
|
" sftp_client.put(local_path, remote_path, callback=print_progress)\n" +
|
|
" sftp_client.put(local_path, remote_path, callback=print_progress)\n" +
|
|
" # 输出换行符,以便下一行正常显示\n" +
|
|
" # 输出换行符,以便下一行正常显示\n" +
|
|
" print()\n" +
|
|
" print()\n" +
|
|
" print(f\"文件成功上传\")\n" +
|
|
" print(f\"文件成功上传\")\n" +
|
|
|
|
+ "\n" +
|
|
|
|
+ " # 构建下载路径\n" +
|
|
|
|
+ " download_path = f\"http://{remote_path.replace('/data/wwwroot/', '')}\"\n" +
|
|
|
|
+ " print(f\"文件下载路径: {download_path}\")\n" +
|
|
|
|
+ "\n" +
|
|
" # 关闭SFTP连接\n" +
|
|
" # 关闭SFTP连接\n" +
|
|
" sftp_client.close()\n" +
|
|
" sftp_client.close()\n" +
|
|
" # 关闭SSH连接\n" +
|
|
" # 关闭SSH连接\n" +
|