-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Codex/list main activities, services, and nfc utilities #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sanghanpark
wants to merge
16
commits into
ikarus23:master
Choose a base branch
from
sanghanpark:codex/list-main-activities,-services,-and-nfc-utilities
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c1e5c5b
docs: explain ModuKey workflow and Korean support
sanghanpark c994568
Add Korean step messages for clone process
sanghanpark 95acd87
Add Korean strings and ModuKey workflow
sanghanpark c002cb2
docs: explain ModuKey workflow and Korean support
sanghanpark 5b76847
Merge pull request #4 from sanghanpark/t93lkn-codex/update-readme-and…
sanghanpark 3ec1359
Merge pull request #3 from sanghanpark/codex/add-korean-translations-…
sanghanpark dc3caba
Merge pull request #2 from sanghanpark/codex/add-korean-localization-…
sanghanpark 54c5359
Merge pull request #1 from sanghanpark/codex/update-readme-and-help-f…
sanghanpark e19bc53
docs: add build instructions
sanghanpark 566d1e6
Merge pull request #5 from sanghanpark/codex/안드로이드-스튜디오에서-코드-동기화-문제-수정
sanghanpark b2025da
fix: remove duplicate wizard strings
sanghanpark dde6cb0
Merge pull request #6 from sanghanpark/codex/fix-duplicate-string-res…
sanghanpark f405a90
Update build.gradle
sanghanpark 81d3595
Merge branch 'master' of https://github.com/sanghanpark/MifareClassic…
sanghanpark 3e557c3
Add basic ViewModel unit test placeholder
sanghanpark e877314
Add ConstraintLayout dependency
sanghanpark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Mifare Classic Tool/app/src/main/java/de/svws_nfc/simpleclone/CloneService.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| // Service 코드. READ → 덤프 생성, WRITE → 제조사 블록 쓰기까지 자동 실행. | ||
| // 콜백으로 ViewModel에 단계별 이벤트 전달. |
43 changes: 43 additions & 0 deletions
43
Mifare Classic Tool/app/src/main/java/de/svws_nfc/simpleclone/CloneViewModel.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package de.svws_nfc.simpleclone | ||
|
|
||
| import android.app.Application | ||
| import android.nfc.Tag | ||
| import androidx.lifecycle.AndroidViewModel | ||
| import androidx.lifecycle.MutableLiveData | ||
|
|
||
| class CloneViewModel(app: Application) : AndroidViewModel(app) { | ||
|
|
||
| enum class Phase { WAIT_READ, READ_RUNNING, WAIT_WRITE, WRITE_RUNNING, DONE, ERROR } | ||
|
|
||
| data class UiState( | ||
| val phase: Phase = Phase.WAIT_READ, | ||
| val message: String = "", | ||
| val progress: Int = 0 | ||
| ) | ||
|
|
||
| val uiState = MutableLiveData(UiState()) | ||
|
|
||
| fun onTagScanned(tag: Tag) { | ||
| when (uiState.value?.phase) { | ||
| Phase.WAIT_READ -> { | ||
| service?.startRead(tag) | ||
| } | ||
| Phase.WAIT_WRITE -> { | ||
| service?.startWrite(tag) | ||
| } | ||
| else -> {} // DONE, ERROR 일 땐 무시 | ||
| } | ||
| } | ||
|
|
||
| /** Service 콜백이 호출할 메서드 */ | ||
| fun update(phase: CloneService.Phase, msg: String) { | ||
| when (phase) { | ||
| CloneService.Phase.READ -> | ||
| uiState.postValue(uiState.value?.copy(phase = Phase.READ_RUNNING, message = msg)) | ||
| CloneService.Phase.WRITE -> | ||
| uiState.postValue(uiState.value?.copy(phase = Phase.WRITE_RUNNING, message = msg)) | ||
| } | ||
| } | ||
|
|
||
| // ...추가 로직 | ||
| } |
35 changes: 35 additions & 0 deletions
35
Mifare Classic Tool/app/src/main/java/de/svws_nfc/simpleclone/SimpleCloneActivity.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package de.svws_nfc.simpleclone; | ||
|
|
||
| import android.content.Intent; | ||
| import android.nfc.NfcAdapter; | ||
| import android.nfc.Tag; | ||
| import android.os.Bundle; | ||
| import androidx.lifecycle.ViewModelProvider; | ||
|
|
||
| import de.syss.MifareClassicTool.Activities.BasicActivity; | ||
|
|
||
| /** | ||
| * 단순 2-단계 카드 복제를 위한 전용 화면. | ||
| * READ 단계 → WRITE 단계로만 흐르며, 나머지 세부 옵션은 자동 처리된다. | ||
| */ | ||
| public class SimpleCloneActivity extends BasicActivity { | ||
| private CloneViewModel viewModel; | ||
|
|
||
| @Override | ||
| protected void onCreate(Bundle savedInstanceState) { | ||
| super.onCreate(savedInstanceState); | ||
| setContentView(R.layout.activity_simple_clone); // layout 은 다음 단계에서 생성 | ||
| viewModel = new ViewModelProvider(this).get(CloneViewModel.class); | ||
|
|
||
| viewModel.getUiState().observe(this, state -> { | ||
| // TODO: 단계별 메시지/버튼 상태 업데이트 | ||
| }); | ||
| } | ||
|
|
||
| @Override | ||
| protected void onNewIntent(Intent intent) { | ||
| super.onNewIntent(intent); | ||
| Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG); | ||
| if (tag != null) viewModel.onTagScanned(tag); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Mifare Classic Tool/app/src/main/res/layout/activity_modukey.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="match_parent" | ||
| android:orientation="vertical" | ||
| android:padding="16dp"> | ||
|
|
||
| <TextView | ||
| android:id="@+id/textHoldExistingCard" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:text="@string/text_hold_existing_card" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/textModukeyPresent" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="@string/text_modukey_present" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/textCopyStep" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="16dp" | ||
| android:text="@string/text_copy_step1" /> | ||
|
|
||
| <Button | ||
| android:id="@+id/buttonStartCopy" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="16dp" | ||
| android:text="@string/action_start_copy" /> | ||
|
|
||
| <Button | ||
| android:id="@+id/buttonStartCopyStep2" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="@string/action_start_copy_step2" /> | ||
|
|
||
| </LinearLayout> |
28 changes: 28 additions & 0 deletions
28
Mifare Classic Tool/app/src/main/res/layout/activity_simple_clone.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <androidx.constraintlayout.widget.ConstraintLayout | ||
| xmlns:android="http://schemas.android.com/apk/res/android" | ||
| xmlns:app="http://schemas.android.com/apk/res-auto" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="match_parent"> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tvMessage" | ||
| android:layout_width="0dp" | ||
| android:layout_height="wrap_content" | ||
| android:text="카드키를 스마트폰 뒷면에 인식하세요" | ||
| android:textSize="18sp" | ||
| app:layout_constraintTop_toTopOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| android:padding="16dp"/> | ||
|
|
||
| <Button | ||
| android:id="@+id/btnAction" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:text="복사시작" | ||
| app:layout_constraintTop_toBottomOf="@id/tvMessage" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintEnd_toEndOf="parent"/> | ||
|
|
||
| </androidx.constraintlayout.widget.ConstraintLayout> |
11 changes: 11 additions & 0 deletions
11
Mifare Classic Tool/app/src/main/res/values-ko/strings.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <resources> | ||
| <string name="app_name">MIFARE 클래식 툴</string> | ||
| <string name="app_version">앱 버전</string> | ||
| <string name="text_hold_existing_card">기존 카드키를 스마트폰 뒷면에 인식한 채로 유지하세요</string> | ||
| <string name="text_modukey_present">모두키를 스마트폰 뒷면에 인식시켜주세요</string> | ||
| <string name="text_copy_step1">복사1단계 진행중</string> | ||
| <string name="text_copy_step2">복사2단계 진행중</string> | ||
| <string name="action_start_copy">복사시작</string> | ||
| <string name="action_start_copy_step2">복사2단계 시작</string> | ||
| </resources> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Mifare Classic Tool/app/src/test/java/de/svws_nfc/simpleclone/CloneViewModelTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| // JUnit 테스트: Phase 전이, 에러 처리 확인 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go