forked from ReVanced/revanced-integrations
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from crimera/dev
chore: Merge branch `dev` to `main`
- Loading branch information
Showing
7 changed files
with
98 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...app/revanced/integrations/twitter/patches/hook/patch/browserchooser/BrowserChooserHook.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package app.revanced.integrations.twitter.patches.hook.patch.browserchooser | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import app.revanced.integrations.twitter.patches.hook.twifucker.TwiFucker | ||
|
||
|
||
object BrowserChooserHook { | ||
fun open(context: Context, intent: Intent) = TwiFucker.openWithChooser(context, intent) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...in/java/app/revanced/integrations/twitter/patches/links/OpenLinksWithAppChooserPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package app.revanced.integrations.twitter.patches.links; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
|
||
public final class OpenLinksWithAppChooserPatch { | ||
public static void openWithChooser(final Context context, final Intent originalIntent) { | ||
final Intent intent = new Intent("android.intent.action.VIEW", originalIntent.getData()); | ||
context.startActivity(Intent.createChooser(intent, null)); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
app/src/main/java/app/revanced/integrations/twitter/patches/links/UnshortenUrlsPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package app.revanced.integrations.twitter.patches.links; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.util.Log; | ||
|
||
import java.lang.reflect.Field; | ||
|
||
public final class UnshortenUrlsPatch { | ||
private static final String TAG = "030-unshort"; | ||
public static void unshort(Object entity) { | ||
try { | ||
String className = "com.twitter.model.json.core.JsonUrlEntity"; // Replace with your fully qualified class name | ||
Class<?> clazz = Class.forName(className); | ||
|
||
if (!clazz.isInstance(entity)) { | ||
return; | ||
} | ||
|
||
clazz.cast(entity); | ||
Field c = clazz.getDeclaredField("c"); | ||
Field e = clazz.getDeclaredField("e"); | ||
|
||
String cValue = (String) c.get(entity); | ||
e.set(entity, cValue); | ||
} catch (Exception ex) { | ||
Log.e(TAG, ";-;", ex); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
org.gradle.parallel = true | ||
org.gradle.caching = true | ||
android.useAndroidX = true | ||
version = 1.3.0 | ||
version = 1.4.0-dev.2 |