refactor(sdcard): convert SDcard implementation from Java to Kotlin - #2718
refactor(sdcard): convert SDcard implementation from Java to Kotlin#2718batoripX wants to merge 1 commit into
Conversation
batoripX
commented
Aug 11, 2026
- Migrate SDcard file handling and SAF utilities to idiomatic Kotlin
- Convert MyFileObserver to Kotlin secondary constructors
- Use Kotlin bitwise operations and property access syntax
- Migrate SDcard file handling and SAF utilities to idiomatic Kotlin - Convert MyFileObserver to Kotlin secondary constructors - Use Kotlin bitwise operations and property access syntax
Greptile SummaryThe PR attempts to replace the SD-card Cordova implementation with Kotlin, but the new file contains only a small manager/helper subset and is not wired into the native plugin contract.
Confidence Score: 4/5The PR is not safe to merge because the registered native SD-card service is deleted without a buildable Cordova-compatible replacement. Every external-storage and workspace-index bridge call still targets Files Needing Attention: src/plugins/sdcard/src/android/SDcard.kt and src/plugins/sdcard/src/android/SDcard.java Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
JS[sdcard JavaScript API] -->|cordova.exec service SDcard| Registration[plugin.xml: com.foxdebug.sdcard.SDcard]
Registration --> Missing[Deleted SDcard CordovaPlugin]
Kotlin[com.foxbyte.acode.SDCardManager] -. not registered and has no execute dispatcher .-> Registration
Missing --> Failure[Build failure or all native SDcard actions unavailable]
Reviews (1): Last reviewed commit: "refactor(sdcard): convert SDcard impleme..." | Re-trigger Greptile |
| import java.io.OutputStream | ||
|
|
||
| // Assuming context, formatUri, filename, and callback exist in the enclosing scope/class | ||
| class SDCardManager(private val context: Context) { |
There was a problem hiding this comment.
Cordova plugin entry point removed
When JavaScript invokes any SDcard action, Cordova still resolves com.foxdebug.sdcard.SDcard, but this change deletes that plugin and replaces it with an unregistered SDCardManager that neither extends CordovaPlugin nor implements execute. The plugin manifest also still references the deleted Java source, causing the Android build to fail during plugin installation or, if installation proceeds, leaving all external-storage, SAF picker, file-watching, and workspace-index operations unavailable.
Knowledge Base Used: