diff --git a/Screenshot_20260306_213814_ .jpg b/Screenshot_20260306_213814_ .jpg new file mode 100644 index 0000000..115847a Binary files /dev/null and b/Screenshot_20260306_213814_ .jpg differ diff --git a/app/src/main/java/com/hotdeal/alarm/presentation/settings/SettingsScreen.kt b/app/src/main/java/com/hotdeal/alarm/presentation/settings/SettingsScreen.kt index 91bfbbc..3c8f3dc 100644 --- a/app/src/main/java/com/hotdeal/alarm/presentation/settings/SettingsScreen.kt +++ b/app/src/main/java/com/hotdeal/alarm/presentation/settings/SettingsScreen.kt @@ -45,6 +45,7 @@ import com.hotdeal.alarm.presentation.components.PermissionDialog import com.hotdeal.alarm.presentation.main.MainUiState import com.hotdeal.alarm.presentation.main.MainViewModel import com.hotdeal.alarm.ui.theme.getSiteColor +import com.hotdeal.alarm.util.ApkDownloadManager import com.hotdeal.alarm.util.PermissionHelper import com.hotdeal.alarm.util.VersionManager import kotlinx.coroutines.launch @@ -477,17 +478,20 @@ private fun MoreTab(viewModel: MainViewModel) { } private fun downloadAndInstallApk(context: Context, updateInfo: com.hotdeal.alarm.util.UpdateInfo) { - val downloadManager = context.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager - val request = DownloadManager.Request(Uri.parse(updateInfo.updateUrl)) - .setTitle("핫딜 알람 업데이트") - .setDescription("버전 ${updateInfo.version} 다운로드 중...") - .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) - .setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "hotdeal_alarm_${updateInfo.version}.apk") - .setAllowedOverMetered(true) - .setAllowedOverRoaming(true) - - downloadManager.enqueue(request) - Toast.makeText(context, "다운로드가 시작되었습니다", Toast.LENGTH_SHORT).show() + // ApkDownloadManager를 사용하여 다운로드 시작 및 자동 설치 + val downloadId = ApkDownloadManager.downloadApk(context, updateInfo) + + // 다운로드 완료 리시버 등록 - 완료 시 자동 설치 + ApkDownloadManager.registerDownloadCompleteReceiver( + context = context, + downloadId = downloadId, + onComplete = { + ApkDownloadManager.installApk(context) + }, + onFailed = { + Toast.makeText(context, "다운로드 실패. 다시 시도해주세요.", Toast.LENGTH_SHORT).show() + } + ) } // ==================== 공통 컴포넌트 ==================== diff --git a/index.html b/index.html new file mode 100644 index 0000000..e025bf0 --- /dev/null +++ b/index.html @@ -0,0 +1,1155 @@ + + + + + + 핫딜 알람 - 실시간 핫딜 모아보기 + + + + + + + +
+ +
+ +
+
+ +
+

핫딜 알람

+ 실시간 핫딜 모아보기 +
+
+
+ + + +
+
+ + +
+ +
+ + +
+
+
+ 📋 0개의 핫딜 +
+
+ + 실시간 업데이트 +
+
+
+ + + + + +
+
+ + +
+
+ + +
+ + + + + + + diff --git a/index.html:Zone.Identifier b/index.html:Zone.Identifier new file mode 100644 index 0000000..d6c1ec6 Binary files /dev/null and b/index.html:Zone.Identifier differ