mirror of
https://github.com/revanced/revanced-patches
synced 2024-09-04 13:35:30 +02:00
fix(syncforreddit/change-oauth-client-id): use downloads directory
This fixes permission errors on Android
This commit is contained in:
parent
e099ae90b0
commit
9b5af77a22
@ -3,7 +3,9 @@ package android.os;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public final class Environment {
|
public final class Environment {
|
||||||
public static File getExternalStorageDirectory() {
|
public static String DIRECTORY_DOWNLOADS = "Download";
|
||||||
|
|
||||||
|
public static File getExternalStoragePublicDirectory(final String type) {
|
||||||
throw new UnsupportedOperationException("Stub");
|
throw new UnsupportedOperationException("Stub");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,10 @@ class ChangeOAuthClientIdPatch : BytecodePatch(
|
|||||||
return PatchResultError("No client ID provided")
|
return PatchResultError("No client ID provided")
|
||||||
}
|
}
|
||||||
|
|
||||||
File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also {
|
File(
|
||||||
|
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
|
||||||
|
"reddit_client_id_revanced.txt"
|
||||||
|
).also {
|
||||||
if (it.exists()) return@also
|
if (it.exists()) return@also
|
||||||
|
|
||||||
val error = """
|
val error = """
|
||||||
|
Loading…
Reference in New Issue
Block a user