Skip to content

Commit

Permalink
modify escape system to enable prefix specify
Browse files Browse the repository at this point in the history
  • Loading branch information
puutaro committed Jun 17, 2024
1 parent ca73318 commit eeaa97d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
preferenceDir/settings/fannelStateStock.tsv
preferenceDir/hideSettingVals/recentSettingHideVals.js
preferenceDir/settings/homeScriptUrlsPath.txt
preferenceDir/longPressMenuDir
preference.js 1
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ object CmdClickSystemAppDir {
// escapeFilePath
// ).split("\n").filter { it.isNotEmpty() }
withContext(Dispatchers.IO) {
FileSystems.updateFile(
File(UsePath.cmdclickDefaultAppDirPath, "escape.txt").absolutePath,
listOf(
"${escapeMapList}"
).joinToString("\n\b") + "\n-------------\n\n"
)
// FileSystems.updateFile(
// File(UsePath.cmdclickDefaultAppDirPath, "escape.txt").absolutePath,
// listOf(
// "${escapeMapList}"
// ).joinToString("\n\b") + "\n-------------\n\n"
// )
AssetsFileManager.copyFileOrDirFromAssets(
context,
fannelRawDirAssetsPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.puutaro.commandclick.util.file

import android.content.Context
import android.util.Log
import com.puutaro.commandclick.common.variable.path.UsePath
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
Expand Down Expand Up @@ -161,9 +160,13 @@ object AssetsFileManager {
// "contain: ${escapeRelativeAssetsPathList.contains(assetsRelativeFilePath)}",
// ).joinToString("\n\n") + "\n------\n"
// )
val isContainEscapeRelativePathList = escapeRelativeAssetsPathList.any {
escapeRelativePath ->
assetsRelativeFilePath.startsWith(escapeRelativePath)
}
if(
newFilePathObj.isFile
&& escapeRelativeAssetsPathList.contains(assetsRelativeFilePath)
&& isContainEscapeRelativePathList
) return
val newFilePath = newFilePathObj.absoluteFile
val assetManager = context?.getAssets()
Expand Down

0 comments on commit eeaa97d

Please sign in to comment.