expo-tiddlywiki-filesystem-android-external-storage 2.2.10 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -463,6 +463,35 @@ class ExternalStorageModule : Module() {
|
|
|
463
463
|
continue
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
// Handle POSIX pax extended header (type 'x' or 'g')
|
|
467
|
+
// pax headers contain key=value pairs, including "path" for long filenames
|
|
468
|
+
if (typeFlag == 'x' || typeFlag == 'g') {
|
|
469
|
+
val paxBuf = ByteArray(fileSize.toInt())
|
|
470
|
+
readFully(bis, paxBuf)
|
|
471
|
+
val paxStr = String(paxBuf, Charsets.UTF_8)
|
|
472
|
+
// Parse pax records: each record is "<length> <key>=<value>\n"
|
|
473
|
+
var paxPos = 0
|
|
474
|
+
while (paxPos < paxStr.length) {
|
|
475
|
+
val spaceAt = paxStr.indexOf(' ', paxPos)
|
|
476
|
+
if (spaceAt < 0) break
|
|
477
|
+
val recLen = paxStr.substring(paxPos, spaceAt).toIntOrNull() ?: break
|
|
478
|
+
val record = paxStr.substring(spaceAt + 1, minOf(paxPos + recLen, paxStr.length)).trimEnd('\n')
|
|
479
|
+
val eqAt = record.indexOf('=')
|
|
480
|
+
if (eqAt >= 0) {
|
|
481
|
+
val key = record.substring(0, eqAt)
|
|
482
|
+
val value = record.substring(eqAt + 1)
|
|
483
|
+
if (key == "path") {
|
|
484
|
+
longName = value
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
paxPos += recLen
|
|
488
|
+
}
|
|
489
|
+
// Skip padding to 512-byte boundary
|
|
490
|
+
val remainder = (512 - (fileSize % 512).toInt()) % 512
|
|
491
|
+
if (remainder > 0) bis.skip(remainder.toLong())
|
|
492
|
+
continue
|
|
493
|
+
}
|
|
494
|
+
|
|
466
495
|
// Determine the file name
|
|
467
496
|
val fileName = longName ?: if (prefix.isNotEmpty()) "$prefix/$rawName" else rawName
|
|
468
497
|
longName = null
|
|
@@ -228,11 +228,6 @@ internal object GitHelper {
|
|
|
228
228
|
|
|
229
229
|
// ─── Private helpers ─────────────────────────────────────────────
|
|
230
230
|
|
|
231
|
-
/** Extensions recognized as wiki content (matches JS-side filter) */
|
|
232
|
-
private val TRACKED_EXTENSIONS = setOf(
|
|
233
|
-
".tid", ".json", ".meta", ".txt", ".css", ".js", ".html", ".svg", ".md"
|
|
234
|
-
)
|
|
235
|
-
|
|
236
231
|
private fun walkWorkDir(dir: File, prefix: String, skipDirs: Set<String>, files: MutableSet<String>) {
|
|
237
232
|
val children = dir.listFiles() ?: return
|
|
238
233
|
for (child in children) {
|
|
@@ -240,12 +235,7 @@ internal object GitHelper {
|
|
|
240
235
|
if (child.isDirectory) {
|
|
241
236
|
if (child.name !in skipDirs) walkWorkDir(child, relPath, skipDirs, files)
|
|
242
237
|
} else {
|
|
243
|
-
|
|
244
|
-
val ext = if (dotIdx >= 0) child.name.substring(dotIdx) else ""
|
|
245
|
-
// Include files with recognized extensions, or files without an extension
|
|
246
|
-
if (ext.isEmpty() || ext in TRACKED_EXTENSIONS) {
|
|
247
|
-
files.add(relPath)
|
|
248
|
-
}
|
|
238
|
+
files.add(relPath)
|
|
249
239
|
}
|
|
250
240
|
}
|
|
251
241
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-tiddlywiki-filesystem-android-external-storage",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"description": "Expo native module for TidGi-Mobile: external storage I/O + TiddlyWiki .tid/.meta/.json batch parsing in Kotlin",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|