mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-31 22:10:18 +02:00
fix: unicode paths
* improve sanitization * Fix InputType to allow negative decimals to properly spoof more locations Co-authored-by: auth <64337177+authorisation@users.noreply.github.com>
This commit is contained in:
parent
e89901a2f6
commit
4182f53f23
@ -99,3 +99,4 @@ When redistributing the software, it must remain under the same [GPLv3](https://
|
|||||||
- [RevealedSoulEven](https://github.com/revealedsouleven)
|
- [RevealedSoulEven](https://github.com/revealedsouleven)
|
||||||
- [iBasim](https://github.com/ibasim)
|
- [iBasim](https://github.com/ibasim)
|
||||||
- [xerta555](https://github.com/xerta555)
|
- [xerta555](https://github.com/xerta555)
|
||||||
|
- [TheVisual](https://github.com/TheVisual)
|
||||||
|
@ -127,7 +127,7 @@ class MediaDownloader : Feature("MediaDownloader", loadParams = FeatureLoadParam
|
|||||||
val downloadOptions = context.config.options(ConfigProperty.DOWNLOAD_OPTIONS)
|
val downloadOptions = context.config.options(ConfigProperty.DOWNLOAD_OPTIONS)
|
||||||
val sanitizedPathPrefix = pathPrefix
|
val sanitizedPathPrefix = pathPrefix
|
||||||
.replace(" ", "_")
|
.replace(" ", "_")
|
||||||
.replace(Regex("[\\\\:*?\"<>|]"), "")
|
.replace(Regex("[\\p{Cntrl}]"), "")
|
||||||
.ifEmpty { hexHash }
|
.ifEmpty { hexHash }
|
||||||
|
|
||||||
val currentDateTime = SimpleDateFormat("yyyy-MM-dd_HH-mm-ss", Locale.ENGLISH).format(System.currentTimeMillis())
|
val currentDateTime = SimpleDateFormat("yyyy-MM-dd_HH-mm-ss", Locale.ENGLISH).format(System.currentTimeMillis())
|
||||||
@ -304,7 +304,7 @@ class MediaDownloader : Feature("MediaDownloader", loadParams = FeatureLoadParam
|
|||||||
if ((snapSource == "PUBLIC_USER" || snapSource == "SAVED_STORY") &&
|
if ((snapSource == "PUBLIC_USER" || snapSource == "SAVED_STORY") &&
|
||||||
(forceDownload || canAutoDownload("public_stories"))) {
|
(forceDownload || canAutoDownload("public_stories"))) {
|
||||||
val userDisplayName = (if (paramMap.containsKey("USER_DISPLAY_NAME")) paramMap["USER_DISPLAY_NAME"].toString() else "").replace(
|
val userDisplayName = (if (paramMap.containsKey("USER_DISPLAY_NAME")) paramMap["USER_DISPLAY_NAME"].toString() else "").replace(
|
||||||
"[^\\x00-\\x7F]".toRegex(),
|
"[\\p{Cntrl}]".toRegex(),
|
||||||
"")
|
"")
|
||||||
|
|
||||||
downloadOperaMedia(provideClientDownloadManager(
|
downloadOperaMedia(provideClientDownloadManager(
|
||||||
@ -336,7 +336,7 @@ class MediaDownloader : Feature("MediaDownloader", loadParams = FeatureLoadParam
|
|||||||
}
|
}
|
||||||
|
|
||||||
val storyName = paramMap["STORY_NAME"].toString().replace(
|
val storyName = paramMap["STORY_NAME"].toString().replace(
|
||||||
"[^\\x00-\\x7F]".toRegex(),
|
"[\\p{Cntrl}]".toRegex(),
|
||||||
"")
|
"")
|
||||||
|
|
||||||
//get the position of the media in the playlist and the duration
|
//get the position of the media in the playlist and the duration
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package me.rhunk.snapenhance.features.impl.tweaks
|
package me.rhunk.snapenhance.features.impl.tweaks
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import me.rhunk.snapenhance.config.ConfigProperty
|
import me.rhunk.snapenhance.config.ConfigProperty
|
||||||
import me.rhunk.snapenhance.data.ContentType
|
import me.rhunk.snapenhance.data.ContentType
|
||||||
import me.rhunk.snapenhance.data.MessageSender
|
import me.rhunk.snapenhance.data.MessageSender
|
||||||
|
@ -11,18 +11,18 @@
|
|||||||
android:id="@+id/dialog_latitude"
|
android:id="@+id/dialog_latitude"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:autofillHints=""
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="Latitude"
|
android:hint="Latitude"
|
||||||
android:autofillHints="" />
|
android:inputType="number|numberDecimal|numberSigned" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/dialog_longitude"
|
android:id="@+id/dialog_longitude"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:autofillHints=""
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType="numberDecimal"
|
|
||||||
android:hint="Longitude"
|
android:hint="Longitude"
|
||||||
android:autofillHints="" />
|
android:inputType="number|numberDecimal|numberSigned" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user