69 lines
3.1 KiB
Python
Executable File
69 lines
3.1 KiB
Python
Executable File
import urllib.request
|
|
import json
|
|
import os
|
|
import subprocess
|
|
import shutil
|
|
|
|
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
|
owner_repo = "sanjeok77/ShiftRing"
|
|
tag = "v1.0.2"
|
|
title = "v1.0.2 - Play Protect 유해앱 차단 오진 원인 완벽 제거 및 전체화면 알림 설정 후 원활한 복귀 지원"
|
|
body = """## 🚀 ShiftRing v1.0.2 릴리즈
|
|
|
|
### 🌟 주요 변경 및 보안/권한 개선 사항
|
|
1. **Google Play Protect '유해한 앱 차단됨' 경고 원인 완벽 제거**:
|
|
- 구글 플레이 프로텍트 정적 분석에서 트로이목마/취약점 오진을 유발하는 쉘 명령어/루팅 감지 루틴(`RootUtil`, `Runtime.exec`) 완전 제거
|
|
- 불필요한 고위험 권한(`SYSTEM_ALERT_WINDOW`, `DISABLE_KEYGUARD`) 정리로 안전한 정식 앱 프로필 확보
|
|
2. **전체화면 알림 권한 설정 후 원활한 앱 복귀 처리**:
|
|
- 시스템 설정 인텐트 호출 시 태스크 스택 플래그를 정돈하여 설정 완료 후 뒤로가기 시 자연스럽게 ShiftRing으로 즉시 복귀되도록 개선
|
|
- 불필요한 오버레이 권한 종속성을 제거하고 최신 안드로이드 14/15 표준 `USE_FULL_SCREEN_INTENT` 체계로 일원화
|
|
3. **Android 14/15 호환 및 정식 서명키(release.jks) 적용**"""
|
|
|
|
apk_path = "app/build/outputs/apk/release/app-release.apk"
|
|
if not os.path.exists(apk_path):
|
|
print(f"APK not found at {apk_path}")
|
|
exit(1)
|
|
|
|
print(f"Using APK at: {apk_path}")
|
|
|
|
# Create Gitea Release
|
|
url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases"
|
|
headers = {"Authorization": f"token {token}", "Content-Type": "application/json"}
|
|
|
|
data = json.dumps({"tag_name": tag, "name": title, "body": body, "draft": False, "prerelease": False}).encode()
|
|
req = urllib.request.Request(url, data=data, headers=headers, method="POST")
|
|
with urllib.request.urlopen(req) as response:
|
|
result = json.loads(response.read())
|
|
release_id = result["id"]
|
|
print(f"Created Gitea Release successfully. Release ID: {release_id}")
|
|
|
|
# Upload APK asset
|
|
upload_url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases/{release_id}/assets"
|
|
print(f"Uploading APK to {upload_url}...")
|
|
|
|
curl_cmd = f'curl -s -X POST "{upload_url}?name=app.apk" -H "Authorization: token {token}" -F "attachment=@{apk_path}"'
|
|
upload_result = subprocess.run(curl_cmd, shell=True, capture_output=True, text=True)
|
|
print(f"Upload output: {upload_result.stdout}")
|
|
|
|
upload_json = json.loads(upload_result.stdout)
|
|
apk_uuid = upload_json.get("uuid")
|
|
direct_url = upload_json.get("browser_download_url", f"https://git.webpluss.net/attachments/{apk_uuid}")
|
|
|
|
# Copy APK to project root
|
|
shutil.copy2(apk_path, "app.apk")
|
|
print("Updated app.apk at project root.")
|
|
|
|
# Update version.json
|
|
v_info = {
|
|
"versionCode": 102,
|
|
"versionName": "1.0.2",
|
|
"apkUrl": direct_url,
|
|
"changelog": "v1.0.2: Play Protect 유해앱 차단 오진 원인 완벽 제거, 전체화면 알림 설정 후 앱 복귀 개선",
|
|
"forceUpdate": False
|
|
}
|
|
with open("version.json", "w", encoding="utf-8") as f:
|
|
json.dump(v_info, f, ensure_ascii=False, indent=2)
|
|
|
|
print(f"Updated version.json with apkUrl: {direct_url}")
|
|
print(f"Release {tag} process finished!")
|