From 18ec8f46dd32639f0885e47fe5fac00b822636a0 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 12 Jun 2023 23:21:20 +0200 Subject: [PATCH] chore(syncforreddit/change-oauth-client-id): revert using downloads directory --- dummy/src/main/java/android/os/Environment.java | 4 +--- .../syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dummy/src/main/java/android/os/Environment.java b/dummy/src/main/java/android/os/Environment.java index 7db13dcb..5d58fc31 100644 --- a/dummy/src/main/java/android/os/Environment.java +++ b/dummy/src/main/java/android/os/Environment.java @@ -3,9 +3,7 @@ package android.os; import java.io.File; public final class Environment { - public static String DIRECTORY_DOWNLOADS = "Download"; - - public static File getExternalStoragePublicDirectory(final String type) { + public static File getExternalStorageDirectory() { throw new UnsupportedOperationException("Stub"); } } diff --git a/src/main/kotlin/app/revanced/patches/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt b/src/main/kotlin/app/revanced/patches/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt index 12b3c6c3..2e81de61 100644 --- a/src/main/kotlin/app/revanced/patches/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/syncforreddit/api/patch/ChangeOAuthClientIdPatch.kt @@ -39,10 +39,7 @@ class ChangeOAuthClientIdPatch : BytecodePatch( return PatchResultError("No client ID provided") } - File( - Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), - "reddit_client_id_revanced.txt" - ).also { + File(Environment.getExternalStorageDirectory(), "reddit_client_id_revanced.txt").also { if (it.exists()) return@also val error = """