2 Commits
12 changed files with 61 additions and 99 deletions
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -20,8 +20,8 @@ android {
applicationId = "com.example.shiftalarm"
minSdk = 26
targetSdk = 35
versionCode = 100
versionName = "1.0.0"
versionCode = 102
versionName = "1.0.2"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
-2
View File
@@ -12,8 +12,6 @@
<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" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- Service & Notification -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
@@ -175,7 +175,9 @@ object AlarmPermissionUtil {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION).apply {
data = Uri.parse("package:${context.packageName}")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
if (context !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
}
@@ -186,13 +188,17 @@ object AlarmPermissionUtil {
try {
val intent = Intent("android.settings.MANAGE_APP_USE_FULL_SCREEN_INTENT").apply {
data = Uri.parse("package:${context.packageName}")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
if (context !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
} catch (e: Exception) {
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
data = Uri.parse("package:${context.packageName}")
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
if (context !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
}
@@ -211,7 +217,6 @@ object AlarmPermissionUtil {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
val pm = context.getSystemService(Context.POWER_SERVICE) as PowerManager
allGranted = allGranted && pm.isIgnoringBatteryOptimizations(context.packageName)
allGranted = allGranted && Settings.canDrawOverlays(context)
}
if (Build.VERSION.SDK_INT >= 34) {
val nm = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
@@ -247,16 +247,31 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
visibility = if (isCollapsed) View.GONE else View.VISIBLE
}
// Click header to collapse/expand
// Click header to collapse/expand with smooth accordion animation
headerView.setOnClickListener {
if (collapsedGroups.contains(category)) {
val willExpand = collapsedGroups.contains(category)
// 1. Smooth accordion expand/collapse transition
val transition = android.transition.AutoTransition().apply {
duration = 250
interpolator = android.view.animation.AccelerateDecelerateInterpolator()
}
android.transition.TransitionManager.beginDelayedTransition(container, transition)
// 2. Smooth rotation between '+' (0 deg) and 'x' (45 deg)
val targetRotation = if (willExpand) 45f else 0f
ivExpand.animate()
.rotation(targetRotation)
.setDuration(250)
.setInterpolator(androidx.core.view.animation.PathInterpolatorCompat.create(0.22f, 1.0f, 0.36f, 1.0f))
.start()
if (willExpand) {
collapsedGroups.remove(category)
childrenContainer.visibility = View.VISIBLE
ivExpand.rotation = 45f
} else {
collapsedGroups.add(category)
childrenContainer.visibility = View.GONE
ivExpand.rotation = 0f
}
}
@@ -511,6 +526,13 @@ class FragmentSettingsAlarm : Fragment(), SharedPreferences.OnSharedPreferenceCh
btn.setTextColor(if (isSelected) ContextCompat.getColor(requireContext(), R.color.white) else ContextCompat.getColor(requireContext(), R.color.text_secondary))
}
}
updateRepeatUI()
repeatButtons.forEachIndexed { i, btn ->
btn.setOnClickListener {
selectedRepeat = repeatValues[i]
updateRepeatUI()
}
}
// Pre-Alarm Buttons
var selectedPreAlarm = 15
val preAlarmButtons = listOf(
@@ -214,10 +214,8 @@ class FragmentSettingsBasic : Fragment() {
binding.dividerExact.visibility = View.GONE
}
// 3. 다른 앱 위에 표시 (Overlay)
val isOverlayGranted = AlarmPermissionUtil.getOverlayStatus(context)
binding.tvOverlayStatus.text = if (isOverlayGranted) "[설정 완료: 화면 우위]" else "필수: 알람창 노출을 위해 허용하세요"
binding.tvOverlayStatus.setTextColor(ContextCompat.getColor(context, if (isOverlayGranted) R.color.primary else R.color.shift_red))
// 3. 다른 앱 위에 표시 (Overlay - 레거시)
binding.btnOverlayPermission.visibility = View.GONE
// 4. 전체화면 알림 (Full Screen Intent) - Android 14+
if (Build.VERSION.SDK_INT >= 34) {
@@ -68,7 +68,6 @@ class MainActivity : AppCompatActivity() {
setupWorker()
setupSwipeGesture()
AppUpdateManager.checkUpdate(this, silent = true)
checkRoot()
val prefs = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
currentViewTeam = prefs.getString(KEY_TEAM, "A") ?: "A"
@@ -717,11 +716,6 @@ class MainActivity : AppCompatActivity() {
return java.time.Duration.between(now, midnight).toMillis()
}
private fun checkRoot() {
if (RootUtil.isDeviceRooted()) {
Toast.makeText(this, "⚠️ 루팅된 기기에서 시각적 오류나 알람 불안정이 발생할 수 있습니다.", Toast.LENGTH_LONG).show()
}
}
private fun animateMonthTransition(direction: Int) {
val card = binding.calendarCard
val width = card.width.toFloat()
@@ -1,46 +1,5 @@
package com.example.shiftalarm
import java.io.File
object RootUtil {
fun isDeviceRooted(): Boolean {
return checkRootMethod1() || checkRootMethod2() || checkRootMethod3()
}
private fun checkRootMethod1(): Boolean {
val buildTags = android.os.Build.TAGS
return buildTags != null && buildTags.contains("test-keys")
}
private fun checkRootMethod2(): Boolean {
val paths = arrayOf(
"/system/app/Superuser.apk",
"/sbin/su",
"/system/bin/su",
"/system/xbin/su",
"/data/local/xbin/su",
"/data/local/bin/su",
"/system/sd/xbin/su",
"/system/bin/failsafe/su",
"/data/local/su",
"/su/bin/su"
)
for (path in paths) {
if (File(path).exists()) return true
}
return false
}
private fun checkRootMethod3(): Boolean {
var process: Process? = null
return try {
process = Runtime.getRuntime().exec(arrayOf("/system/xbin/which", "su"))
val reader = process.inputStream.bufferedReader()
reader.readLine() != null
} catch (t: Throwable) {
false
} finally {
process?.destroy()
}
}
fun isDeviceRooted(): Boolean = false
}
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#20FF3B30" />
<solid android:color="#205856D6" />
<corners android:radius="12dp" />
<stroke
android:width="0.5dp"
android:color="#40FF3B30" />
android:color="#405856D6" />
</shape>
+1 -1
View File
@@ -269,7 +269,7 @@
android:textSize="10.5sp"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/shift_red"
android:textColor="#5856D6"
android:background="@drawable/bg_chip_soft_overtime"/>
</LinearLayout>
+14 -28
View File
@@ -6,32 +6,18 @@ import shutil
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
owner_repo = "sanjeok77/ShiftRing"
tag = "v1.0.0"
title = "v1.0.0 - ShiftRing 정식 첫 릴리즈"
body = """## 🚀 ShiftRing v1.0.0 정식 첫 릴리즈
tag = "v1.0.2"
title = "v1.0.2 - Play Protect 유해앱 차단 오진 원인 완벽 제거 및 전체화면 알림 설정 후 원활한 복귀 지원"
body = """## 🚀 ShiftRing v1.0.2 릴리즈
현대자동차 / 다양한 교대근무자를 위한 스마트 교대근무 캘린더 & 맞춤 알람 솔루션
### 🌟 주요 기능 및 탑재 사항
1. **One UI 8.5 라운드 카드 디자인 시스템**:
- 24dp 라운드 카드, 36dp 스퀘어클 Soft-tint 아이콘 시스템
- 20dp 라운드 팝업창 및 12dp 알약 선택자 One UI 드롭다운(Spinner) 전면 통일
2. **대한민국 법정 대체공휴일 100% 정밀 수식**:
- 대통령령 관공서 공휴일 개정안 정밀 적용 (현충일/신정 제외, 주요 공휴일 및 설날/추석 대체공휴일 연동)
3. **이달의 누적 연장근무 복합 정산**:
- 토요일 기본 특근(2h) + 주맞(4h) + 야맞(4h) + 교육(2h) 자동 누적 합산
4. **알람 하이브리드 그룹화 & 순서 자동 정렬**:
- `주간(주) -> 석간(석) -> 야간(야) -> 주간 맞교대(주맞) -> 야간 맞교대(야맞) -> 기타` 고정 정렬
- 그룹 마스터 On/Off 스위치 및 아코디언 접기/펼치기
- 6개 근무 선택(주/석/야/주맞/야맞/기타), 알람 라벨 및 15분전 사전 알림 지원
5. **삼성 캘린더 동일 수평 유체 슬라이드 모션 & 요약 칩 바**:
- 삼성 One UI 8.5 캘린더 동일 전체 폭 수평 슬라이드 애니메이션 (`PathInterpolator(0.22, 1, 0.36, 1)`)
- 실시간 요약 칩 바 (`주간 N일 | 석간 N일 | 야간 N일 | 연장 N시간`)
- 하루 메모 3줄 직관 표시 및 달력 5줄 고정 / 6줄 스크롤 최적화
- 상단 알람 시간 단일행 간결 표시 (`오늘: 07:00 | 내일: 15:00`)
6. **배터리 최적화 4-Tier 다중 폴백 & One UI 업데이트 다이얼로그**:
- Samsung Device Care 연동 및 부드러운 프로그레스 애니메이션
7. **Android 14/15 호환 및 정식 서명키(release.jks) 적용**"""
### 🌟 주요 변경 및 보안/권한 개선 사항
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):
@@ -69,10 +55,10 @@ print("Updated app.apk at project root.")
# Update version.json
v_info = {
"versionCode": 100,
"versionName": "1.0.0",
"versionCode": 102,
"versionName": "1.0.2",
"apkUrl": direct_url,
"changelog": "v1.0.0: ShiftRing 정식 첫 릴리즈 - One UI 8.5 디자인 시스템, 교대근무 캘린더, 맞춤 알람 및 법정 공휴일/연장근무 자동 계산",
"changelog": "v1.0.2: Play Protect 유해앱 차단 오진 원인 완벽 제거, 전체화면 알림 설정 후 앱 복귀 개선",
"forceUpdate": False
}
with open("version.json", "w", encoding="utf-8") as f:
+4 -4
View File
@@ -1,7 +1,7 @@
{
"versionCode": 100,
"versionName": "1.0.0",
"apkUrl": "https://git.webpluss.net/attachments/b1ec7eac-997c-4a33-bbb5-91a0f11ce9cf",
"changelog": "v1.0.0: ShiftRing 정식 첫 릴리즈 - One UI 8.5 디자인 시스템, 교대근무 캘린더, 맞춤 알람 및 법정 공휴일/연장근무 자동 계산",
"versionCode": 102,
"versionName": "1.0.2",
"apkUrl": "https://git.webpluss.net/attachments/16044f88-ebaf-4623-9e5f-af9cc98f4e36",
"changelog": "v1.0.2: Play Protect 유해앱 차단 오진 원인 완벽 제거, 전체화면 알림 설정 후 앱 복귀 개선",
"forceUpdate": false
}