mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-02-05 21:43:27 +01:00
bug fix, removed random dictionary generator
This commit is contained in:
parent
2a6e2b8007
commit
1503ab40de
@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'ru.cleverpumpkin.proguard-dictionaries-generator'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -41,13 +40,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
proguardDictionaries {
|
||||
dictionaryNames = ['dict/class-dictionary', 'dict/package-dictionary', 'dict/obfuscation-dictionary']
|
||||
minLineLength 2
|
||||
maxLineLength 8
|
||||
linesCountInDictionary 50000
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.android.material:material:1.8.0'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-ui:2.18.5'
|
||||
|
5
app/proguard-rules.pro
vendored
5
app/proguard-rules.pro
vendored
@ -1,8 +1,3 @@
|
||||
# use dictionaries to create random class/package names
|
||||
-obfuscationdictionary dict/obfuscation-dictionary.txt
|
||||
-classobfuscationdictionary dict/class-dictionary.txt
|
||||
-packageobfuscationdictionary dict/package-dictionary.txt
|
||||
|
||||
-optimizationpasses 5
|
||||
|
||||
# keep these libraries but allow obfuscating
|
||||
|
@ -36,30 +36,35 @@ public class LinkUtils {
|
||||
* @param url url to open
|
||||
*/
|
||||
public static void openLink(Activity activity, String url) {
|
||||
GlobalSettings settings = GlobalSettings.getInstance(activity);
|
||||
if (!url.startsWith("https://"))
|
||||
url = "https://" + url;
|
||||
Uri link = Uri.parse(url);
|
||||
GlobalSettings settings = GlobalSettings.getInstance(activity);
|
||||
// check if the link points to another status
|
||||
|
||||
// if it's a link to a Tweet, open Tweet in an activity
|
||||
if ((settings.getLogin().getConfiguration() == Configuration.TWITTER1 || settings.getLogin().getConfiguration() == Configuration.TWITTER2)
|
||||
&& TWITTER_LINK_PATTERN.matcher(link.getScheme() + "://" + link.getHost() + link.getPath()).matches()) {
|
||||
&& TWITTER_LINK_PATTERN.matcher(url).matches()) {
|
||||
List<String> segments = link.getPathSegments();
|
||||
Intent intent = new Intent(activity, StatusActivity.class);
|
||||
intent.putExtra(StatusActivity.KEY_STATUS_ID, Long.parseLong(segments.get(2)));
|
||||
intent.putExtra(StatusActivity.KEY_STATUS_NAME, segments.get(0));
|
||||
activity.startActivity(intent);
|
||||
return;
|
||||
} else if (url.startsWith("https://twitter.com") && settings.twitterAltSet()) {
|
||||
url = "https://nitter.net" + link.getPath();
|
||||
link = Uri.parse(url);
|
||||
}
|
||||
// open link in a browser
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(link);
|
||||
try {
|
||||
activity.startActivity(intent);
|
||||
} catch (ActivityNotFoundException err) {
|
||||
Toast.makeText(activity.getApplicationContext(), R.string.error_connection_failed, Toast.LENGTH_SHORT).show();
|
||||
else {
|
||||
// replace Twitter link with Nitter if enabled
|
||||
if (settings.twitterAltSet() && (url.startsWith("https://twitter.com") || url.startsWith("https://mobile.twitter.com"))) {
|
||||
url = "https://nitter.net" + link.getPath();
|
||||
link = Uri.parse(url);
|
||||
}
|
||||
// open link in a browser
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(link);
|
||||
try {
|
||||
activity.startActivity(intent);
|
||||
} catch (ActivityNotFoundException err) {
|
||||
Toast.makeText(activity.getApplicationContext(), R.string.error_connection_failed, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ buildscript {
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.4.2'
|
||||
classpath 'gradle.plugin.ru.cleverpumpkin.proguard-dictionaries-generator:plugin:1.0.8'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,3 +16,4 @@ org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1536M"
|
||||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
android.enableR8.fullMode=true
|
||||
android.nonTransitiveRClass=true
|
||||
|
Loading…
x
Reference in New Issue
Block a user