v1.0.7 - 구글 플레이 프로텍트 유해앱 경고 원인 완벽 제거, 사용 중 전체화면 알람 즉시 표시 보장 및 설정 복귀 처리 개선
This commit is contained in:
@@ -20,8 +20,8 @@ android {
|
||||
applicationId = "com.example.shiftalarm"
|
||||
minSdk = 26
|
||||
targetSdk = 35
|
||||
versionCode = 106
|
||||
versionName = "1.0.6"
|
||||
versionCode = 107
|
||||
versionName = "1.0.7"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -2,21 +2,18 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
|
||||
<!-- Alarm & Full Screen -->
|
||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
|
||||
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
|
||||
|
||||
<!-- Service & Notification -->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
@@ -42,12 +39,11 @@
|
||||
android:name=".AlarmActivity"
|
||||
android:exported="false"
|
||||
android:excludeFromRecents="true"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/Theme.AppCompat.NoActionBar"
|
||||
android:showWhenLocked="true"
|
||||
android:turnScreenOn="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask"
|
||||
android:launchMode="singleInstance"
|
||||
android:documentLaunchMode="never"
|
||||
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||
android:allowEmbedded="false"
|
||||
@@ -94,22 +90,9 @@
|
||||
|
||||
<service
|
||||
android:name=".AlarmForegroundService"
|
||||
android:foregroundServiceType="specialUse"
|
||||
android:exported="false">
|
||||
<property
|
||||
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||
android:value="Alarm playback and ringing notification" />
|
||||
</service>
|
||||
android:foregroundServiceType="mediaPlayback"
|
||||
android:exported="false" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -71,11 +71,18 @@ class AlarmForegroundService : Service() {
|
||||
|
||||
// 4. Foreground 시작
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { // Android 14+
|
||||
startForeground(NOTIFICATION_ID, notification, android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
|
||||
startForeground(NOTIFICATION_ID, notification, android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK)
|
||||
} else {
|
||||
startForeground(NOTIFICATION_ID, notification)
|
||||
}
|
||||
|
||||
// 5. 사용 중일 때도 즉시 전체화면 AlarmActivity 화면 띄우기
|
||||
try {
|
||||
startActivity(fullScreenIntent)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
|
||||
|
||||
@@ -81,32 +81,20 @@ class AlarmReceiver : BroadcastReceiver() {
|
||||
|
||||
Log.d(TAG, "ForegroundService 시작 완료")
|
||||
|
||||
// 2. AlarmActivity 직접 실행 (알람 화면 표시)
|
||||
// 2. AlarmActivity 직접 즉시 실행 (사용 중일 때도 전체화면 알람 창 띄우기)
|
||||
val activityIntent = Intent(context, AlarmActivity::class.java).apply {
|
||||
putExtra("EXTRA_SHIFT", intent?.getStringExtra("EXTRA_SHIFT") ?: "근무")
|
||||
putExtra("EXTRA_SOUND", intent?.getStringExtra("EXTRA_SOUND"))
|
||||
putExtra("EXTRA_SNOOZE", intent?.getIntExtra("EXTRA_SNOOZE", 5) ?: 5)
|
||||
putExtra("EXTRA_SNOOZE_REPEAT", intent?.getIntExtra("EXTRA_SNOOZE_REPEAT", 3) ?: 3)
|
||||
// 중요: 새 태스크로 실행 (FLAG_ACTIVITY_NEW_TASK)
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
// 기존 인스턴스 재사용 및 최상위로 가져오기
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
// 잠금 화면 위에 표시
|
||||
addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT)
|
||||
// 화면 켜기
|
||||
addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or Intent.FLAG_ACTIVITY_NO_USER_ACTION)
|
||||
}
|
||||
try {
|
||||
context.startActivity(activityIntent)
|
||||
Log.d(TAG, "AlarmActivity 즉시 실행 완료")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "AlarmActivity 실행 실패", e)
|
||||
}
|
||||
|
||||
// 지연 후 Activity 시작 (ForegroundService가 알림을 먼저 표시하도록)
|
||||
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
|
||||
try {
|
||||
context.startActivity(activityIntent)
|
||||
Log.d(TAG, "AlarmActivity 실행 완료")
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "AlarmActivity 실행 실패", e)
|
||||
}
|
||||
}, 500)
|
||||
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "알람 실행 실패", e)
|
||||
|
||||
@@ -108,7 +108,16 @@ object AppUpdateManager {
|
||||
|
||||
btnNow.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
downloadAndInstallApk(activity, apkUrl, version)
|
||||
try {
|
||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(apkUrl)).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
}
|
||||
activity.startActivity(intent)
|
||||
Toast.makeText(activity, "최신 버전 다운로드 페이지로 이동합니다.", Toast.LENGTH_SHORT).show()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Toast.makeText(activity, "다운로드 링크 열기 실패: ${e.message}", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
dialog.show()
|
||||
@@ -116,100 +125,4 @@ object AppUpdateManager {
|
||||
val width = (activity.resources.displayMetrics.widthPixels * 0.88).toInt()
|
||||
dialog.window?.setLayout(width, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
}
|
||||
|
||||
private fun downloadAndInstallApk(activity: Activity, apkUrl: String, version: String) {
|
||||
if (activity.isFinishing || activity.isDestroyed) return
|
||||
|
||||
val view = LayoutInflater.from(activity).inflate(R.layout.dialog_update_progress_oneui, null)
|
||||
val tvSub = view.findViewById<TextView>(R.id.tvProgressSub)
|
||||
val progressBar = view.findViewById<ProgressBar>(R.id.downloadProgressBar)
|
||||
val tvPercent = view.findViewById<TextView>(R.id.tvProgressPercent)
|
||||
|
||||
tvSub.text = "v$version 다운로드 중..."
|
||||
|
||||
val progressDialog = AlertDialog.Builder(activity)
|
||||
.setView(view)
|
||||
.setCancelable(false)
|
||||
.create()
|
||||
|
||||
progressDialog.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
progressDialog.show()
|
||||
|
||||
val width = (activity.resources.displayMetrics.widthPixels * 0.88).toInt()
|
||||
progressDialog.window?.setLayout(width, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
|
||||
Thread {
|
||||
try {
|
||||
val url = URL(apkUrl)
|
||||
val connection = url.openConnection() as HttpURLConnection
|
||||
connection.connectTimeout = 15000
|
||||
connection.readTimeout = 15000
|
||||
connection.requestMethod = "GET"
|
||||
connection.connect()
|
||||
|
||||
val fileLength = connection.contentLength
|
||||
val inputStream = BufferedInputStream(connection.inputStream)
|
||||
|
||||
val apkFile = File(activity.cacheDir, "update.apk")
|
||||
val outputStream = FileOutputStream(apkFile)
|
||||
|
||||
val buffer = ByteArray(8192)
|
||||
var total: Long = 0
|
||||
var count: Int
|
||||
|
||||
while (inputStream.read(buffer).also { count = it } != -1) {
|
||||
total += count
|
||||
outputStream.write(buffer, 0, count)
|
||||
|
||||
if (fileLength > 0) {
|
||||
val progress = (total * 100 / fileLength).toInt()
|
||||
activity.runOnUiThread {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
progressBar.setProgress(progress, true)
|
||||
} else {
|
||||
progressBar.progress = progress
|
||||
}
|
||||
tvPercent.text = "$progress%"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outputStream.flush()
|
||||
outputStream.close()
|
||||
inputStream.close()
|
||||
connection.disconnect()
|
||||
|
||||
activity.runOnUiThread {
|
||||
progressDialog.dismiss()
|
||||
installApk(activity, apkFile)
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
activity.runOnUiThread {
|
||||
progressDialog.dismiss()
|
||||
Toast.makeText(activity, "다운로드 실패: ${e.message}", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
private fun installApk(activity: Activity, apkFile: File) {
|
||||
try {
|
||||
val apkUri = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
FileProvider.getUriForFile(activity, "${activity.packageName}.provider", apkFile)
|
||||
} else {
|
||||
Uri.fromFile(apkFile)
|
||||
}
|
||||
|
||||
val intent = Intent(Intent.ACTION_VIEW).apply {
|
||||
setDataAndType(apkUri, "application/vnd.android.package-archive")
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
|
||||
}
|
||||
activity.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Toast.makeText(activity, "설치 실패: ${e.message}", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ class FragmentSettingsBasic : Fragment() {
|
||||
val prefs = requireContext().getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
|
||||
|
||||
binding.btnBatteryOptimize.setOnClickListener {
|
||||
AlarmPermissionUtil.requestBatteryOptimization(requireContext())
|
||||
AlarmPermissionUtil.requestBatteryOptimization(requireActivity())
|
||||
}
|
||||
|
||||
binding.btnExactAlarm.setOnClickListener {
|
||||
@@ -240,23 +240,23 @@ class FragmentSettingsBasic : Fragment() {
|
||||
val intent = Intent(Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM).apply {
|
||||
data = Uri.parse("package:${requireContext().packageName}")
|
||||
}
|
||||
startActivity(intent)
|
||||
requireActivity().startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
binding.btnOverlayPermission.setOnClickListener {
|
||||
AlarmPermissionUtil.requestOverlayPermission(requireContext())
|
||||
AlarmPermissionUtil.requestOverlayPermission(requireActivity())
|
||||
}
|
||||
|
||||
binding.btnFullScreenIntent.setOnClickListener {
|
||||
AlarmPermissionUtil.requestFullScreenIntentPermission(requireContext())
|
||||
AlarmPermissionUtil.requestFullScreenIntentPermission(requireActivity())
|
||||
}
|
||||
|
||||
binding.btnPermissionSettings.setOnClickListener {
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
|
||||
data = Uri.parse("package:${requireContext().packageName}")
|
||||
}
|
||||
startActivity(intent)
|
||||
requireActivity().startActivity(intent)
|
||||
}
|
||||
|
||||
binding.btnCheckUpdate.setOnClickListener {
|
||||
|
||||
+14
-21
@@ -6,25 +6,18 @@ import shutil
|
||||
|
||||
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
||||
owner_repo = "sanjeok77/ShiftRing"
|
||||
tag = "v1.0.6"
|
||||
title = "v1.0.6 - 달력 월간 이동 깜빡임 완전 제거, 하루 메모 고가독성 색상 적용, 부가기능 및 기본 설정(근무 관리) 아이콘/색상 개편"
|
||||
body = """## 🚀 ShiftRing v1.0.6 릴리즈
|
||||
tag = "v1.0.7"
|
||||
title = "v1.0.7 - 구글 플레이 프로텍트 유해앱 경고 원인 완벽 제거, 사용 중 전체화면 알람 즉시 표시 보장 및 설정 복귀 처리 개선"
|
||||
body = """## 🚀 ShiftRing v1.0.7 릴리즈
|
||||
|
||||
### 🌟 주요 변경 및 개선 사항
|
||||
1. **달력 월간 이동 시 깜빡임(Flicker) 완전 제거 (`MainActivity.kt`)**:
|
||||
- 이동 대상 월의 데이터 로딩 및 어댑터 갱신을 슬라이드 애니메이션 시작 전 완벽히 완료하여, 전환 도중의 화면 깜빡임과 데이터 리로드 잔상을 100% 제거
|
||||
2. **하루 메모 가독성 극대화 (`item_day.xml`)**:
|
||||
- 기존 연한 녹색 대신 고대비 볼드 텍스트(`@color/text_primary`, `textStyle="bold"`)를 적용하여 어떤 테마에서도 메모 내용이 선명하게 읽히도록 개선
|
||||
3. **부가기능 탭 아이콘 및 고유 색상 전면 개편 (`fragment_settings_additional.xml`)**:
|
||||
- 물때 정보 표시: 물결 아이콘 (`ic_tide`, 스카이블루 `#0EA5E9`)
|
||||
- 화면 테마 설정: 팔레트 아이콘 (`ic_palette`, 퍼플 `#AF52DE`)
|
||||
- 사용 설명서: 메모 아이콘 (`ic_memo`, 블루 `#0284C7`)
|
||||
- 업데이트 정보: 벨 아이콘 (`ic_bell`, 오렌지 `#FF9500`)
|
||||
- 앱 공유하기: 공유 아이콘 (`ic_share`, 그린 `#34C759`)
|
||||
4. **기본 설정 / 근무 관리 항목 아이콘 및 색상 개편 (`fragment_settings_basic.xml`)**:
|
||||
- 근무 회사: 빌딩/팩토리 아이콘 (`ic_factory`, 블루 `#007AFF`)
|
||||
- 나의 근무 반: 사용자 아이콘 (`ic_user`, 그린 `#34C759`)
|
||||
- 다른 앱 위에 표시: 레이어 아이콘 (`ic_layers`, 시안 `#00C7BE`)"""
|
||||
1. **🛡️ Play Protect '유해한 앱 차단됨' 경고 원인 완벽 제거 (`AndroidManifest.xml`, `AppUpdateManager.kt`)**:
|
||||
- 구글 플레이 프로텍트 자동 탐지 알고리즘에서 오진(Dropper PHA)을 유발하는 `REQUEST_INSTALL_PACKAGES`, `USE_EXACT_ALARM`, `REQUEST_IGNORE_BATTERY_OPTIMIZATIONS` 선언을 완벽히 제거
|
||||
- 앱 업데이트 시 내부 임의 패키지 인스톨러 대신 안전한 표준 브라우저 다이렉트 다운로드 연동으로 전면 개편
|
||||
2. **⏰ 사용 중(화면 켜짐/잠금해제)에도 실제 전체화면 알람 창 즉시 표시 보장 (`AlarmForegroundService.kt`, `AlarmReceiver.kt`, `AndroidManifest.xml`)**:
|
||||
- 폰 사용 중일 때 시스템 팝업 배너로만 뜨고 알람 화면이 가려지던 문제를 해결하여, 포그라운드 서비스 및 리시버에서 `AlarmActivity`를 `singleInstance` 및 최우선 포그라운드로 즉시 띄우도록 개선
|
||||
3. **🔄 전체화면 알림 등 설정 권한 이동 후 원활한 앱 복귀 처리 (`FragmentSettingsBasic.kt`, `AlarmPermissionUtil.kt`)**:
|
||||
- 액티비티 컨텍스트 기반의 네이티브 백스택 유지를 통해 시스템 권한 토글 후 앱으로 자연스럽게 복귀되도록 개선"""
|
||||
|
||||
apk_path = "app/build/outputs/apk/release/app-release.apk"
|
||||
if not os.path.exists(apk_path):
|
||||
@@ -62,10 +55,10 @@ print("Updated app.apk at project root.")
|
||||
|
||||
# Update version.json
|
||||
v_info = {
|
||||
"versionCode": 106,
|
||||
"versionName": "1.0.6",
|
||||
"versionCode": 107,
|
||||
"versionName": "1.0.7",
|
||||
"apkUrl": direct_url,
|
||||
"changelog": "v1.0.6: 월간 이동 깜빡임 완전 제거, 메모 고가독성 텍스트, 부가기능 및 근무 관리 아이콘/색상 개편",
|
||||
"changelog": "v1.0.7: 구글 플레이 프로텍트 유해앱 경고 원인 완벽 제거, 사용 중 전체화면 알람 즉시 표시, 설정 복귀 처리 개선",
|
||||
"forceUpdate": False
|
||||
}
|
||||
with open("version.json", "w", encoding="utf-8") as f:
|
||||
@@ -77,7 +70,7 @@ print(f"Updated version.json with apkUrl: {direct_url}")
|
||||
git_path = r"C:\Users\work\AppData\Roaming\MobaXterm\slash\mx86_64b\bin"
|
||||
os.environ["PATH"] = git_path + os.pathsep + os.environ.get("PATH", "")
|
||||
|
||||
commit_msg = "v1.0.6 - 달력 월간 이동 깜빡임 완전 제거, 하루 메모 고가독성 색상 적용, 부가기능 및 근무 관리 아이콘/색상 개편"
|
||||
commit_msg = "v1.0.7 - 구글 플레이 프로텍트 유해앱 경고 원인 완벽 제거, 사용 중 전체화면 알람 즉시 표시 보장 및 설정 복귀 처리 개선"
|
||||
subprocess.run(["git", "add", "."], check=True)
|
||||
subprocess.run(["git", "commit", "-m", commit_msg], check=True)
|
||||
subprocess.run(["git", "push", "origin", "main"], check=True)
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"versionCode": 106,
|
||||
"versionName": "1.0.6",
|
||||
"apkUrl": "https://git.webpluss.net/attachments/39cd66d9-61cd-442a-8f47-95b967b41bc4",
|
||||
"changelog": "v1.0.6: 월간 이동 깜빡임 완전 제거, 메모 고가독성 텍스트, 부가기능 및 근무 관리 아이콘/색상 개편",
|
||||
"versionCode": 107,
|
||||
"versionName": "1.0.7",
|
||||
"apkUrl": "https://git.webpluss.net/attachments/dcadee3f-c0be-4813-9477-2d3f538a7026",
|
||||
"changelog": "v1.0.7: 구글 플레이 프로텍트 유해앱 경고 원인 완벽 제거, 사용 중 전체화면 알람 즉시 표시, 설정 복귀 처리 개선",
|
||||
"forceUpdate": false
|
||||
}
|
||||
Reference in New Issue
Block a user