mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98d711e0ca | |||
| 99c848b1b7 | |||
| fe26af88b4 | |||
| 6af6ff80ba | |||
| 76e4c59119 | |||
| 33b69b9f3a |
@@ -6,3 +6,4 @@ find ./src/main/assets/help/ -type f -name '*.html' | xargs sed -i 's/Delta Chat
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/get.delta.chat/github.com\/ArcaneChat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/delta.chat\/donate/arcanechat.me\/#contribute/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/Delta Chat/ArcaneChat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/❤️/💜/g'
|
||||
|
||||
@@ -6,6 +6,7 @@ find ./src/main/assets/help/ -type f -name '*.html' | xargs sed -i 's/ArcaneChat
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/github.com\/ArcaneChat/get.delta.chat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/arcanechat.me\/#contribute/delta.chat\/donate/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/ArcaneChat/Delta Chat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/💜/❤️/g'
|
||||
|
||||
# don't revert the app name
|
||||
sed -i 's/>Delta Chat</>ArcaneChat</g' ./src/main/res/values/strings.xml
|
||||
|
||||
@@ -122,8 +122,26 @@ public class PersistentBlobProvider {
|
||||
}
|
||||
|
||||
public Uri createForExternal(@NonNull Context context, @NonNull String mimeType) throws IOException, IllegalStateException, NullPointerException {
|
||||
File target = new File(getExternalDir(context), System.currentTimeMillis() + "." + getExtensionFromMimeType(mimeType));
|
||||
return FileProviderUtil.getUriFor(context, target);
|
||||
String filename = System.currentTimeMillis() + "." + getExtensionFromMimeType(mimeType);
|
||||
|
||||
// Try external cache first
|
||||
try {
|
||||
File externalDir = getExternalDir(context);
|
||||
File target = new File(externalDir, filename);
|
||||
return FileProviderUtil.getUriFor(context, target);
|
||||
} catch (IllegalArgumentException e) {
|
||||
// FileProvider doesn't support the external cache path (e.g., on removable SD card).
|
||||
// Note: getExternalDir() already falls back to internal cache when external cache is null,
|
||||
// but when external cache exists on a removable SD card, FileProvider may reject it.
|
||||
// In that case, we explicitly use internal cache which FileProvider always supports.
|
||||
Log.w(TAG, "FileProvider doesn't support external cache path, falling back to internal cache", e);
|
||||
File internalDir = context.getCacheDir();
|
||||
if (internalDir == null) {
|
||||
throw new IOException("no cache directory available");
|
||||
}
|
||||
File target = new File(internalDir, filename);
|
||||
return FileProviderUtil.getUriFor(context, target);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean delete(@NonNull Context context, @NonNull Uri uri) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths>
|
||||
<cache-path name="cache" path="." />
|
||||
<external-cache-path name="external_cache" path="." />
|
||||
<external-files-path name="external_files" path="." />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user