version 1.8.8 removed old API keys

This commit is contained in:
nuclearfog 2021-01-13 22:23:12 +01:00
parent 9aed5a46b1
commit 7190554af6
No known key found for this signature in database
GPG Key ID: D5490E4A81F97B14
6 changed files with 18 additions and 31 deletions

View File

@ -2,15 +2,15 @@ apply plugin: 'com.android.application'
apply plugin: 'io.michaelrocks.paranoid' apply plugin: 'io.michaelrocks.paranoid'
android { android {
buildToolsVersion '30.0.2' buildToolsVersion '30.0.3'
compileSdkVersion 30 compileSdkVersion 30
defaultConfig { defaultConfig {
applicationId 'org.nuclearfog.twidda' applicationId 'org.nuclearfog.twidda'
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 30 targetSdkVersion 30
versionCode 31 versionCode 32
versionName '1.8.7' versionName '1.8.8'
// limiting language support for smaller APK size // limiting language support for smaller APK size
resConfigs 'en', 'de-rDE' resConfigs 'en', 'de-rDE'
vectorDrawables.useSupportLibrary true vectorDrawables.useSupportLibrary true

View File

@ -399,7 +399,7 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
* @param tag link string * @param tag link string
*/ */
@Override @Override
public void onLinkClick(String tag) { public void onLinkClick(final String tag) {
String shortLink = tag; String shortLink = tag;
int cut = shortLink.indexOf('?'); int cut = shortLink.indexOf('?');
if (cut > 0) { if (cut > 0) {
@ -415,8 +415,8 @@ public class TweetActivity extends AppCompatActivity implements OnClickListener,
startActivity(intent); startActivity(intent);
} else { } else {
// open link in a browser // open link in a browser
Uri link = Uri.parse(tag); Intent intent = new Intent(Intent.ACTION_VIEW);
Intent intent = new Intent(Intent.ACTION_VIEW, link); intent.setData(Uri.parse(tag));
try { try {
startActivity(intent); startActivity(intent);
} catch (ActivityNotFoundException err) { } catch (ActivityNotFoundException err) {

View File

@ -406,7 +406,7 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
@Override @Override
public void onLinkClick(String tag) { public void onLinkClick(final String tag) {
String shortLink; String shortLink;
// remove query from link if exists // remove query from link if exists
int cut = tag.indexOf('?'); int cut = tag.indexOf('?');
@ -423,11 +423,10 @@ public class UserProfile extends AppCompatActivity implements OnClickListener, O
intent.putExtra(KEY_TWEET_ID, id); intent.putExtra(KEY_TWEET_ID, id);
intent.putExtra(KEY_TWEET_NAME, name); intent.putExtra(KEY_TWEET_NAME, name);
startActivity(intent); startActivity(intent);
} } else {
// open link in browser // open link in browser
else { Intent intent = new Intent(Intent.ACTION_VIEW);
Uri link = Uri.parse(tag); intent.setData(Uri.parse(tag));
Intent intent = new Intent(Intent.ACTION_VIEW, link);
try { try {
startActivity(intent); startActivity(intent);
} catch (ActivityNotFoundException err) { } catch (ActivityNotFoundException err) {

View File

@ -1,14 +0,0 @@
package org.nuclearfog.twidda.backend.engine;
import io.michaelrocks.paranoid.Obfuscate;
@Obfuscate
public class Constants {
/**
* add your keys here
*/
public static final String TWITTER_CONSUMER_KEY = "";
public static final String TWITTER_CONSUMER_SECRET = "";
}

View File

@ -30,6 +30,7 @@ import java.net.URL;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import io.michaelrocks.paranoid.Obfuscate;
import twitter4j.DirectMessage; import twitter4j.DirectMessage;
import twitter4j.GeoLocation; import twitter4j.GeoLocation;
import twitter4j.IDs; import twitter4j.IDs;
@ -51,6 +52,7 @@ import twitter4j.conf.ConfigurationBuilder;
/** /**
* Backend for twitter API. * Backend for twitter API.
*/ */
@Obfuscate
public class TwitterEngine { public class TwitterEngine {
private GlobalSettings settings; private GlobalSettings settings;
@ -77,8 +79,8 @@ public class TwitterEngine {
builder.setOAuthConsumerKey(settings.getConsumerKey()); builder.setOAuthConsumerKey(settings.getConsumerKey());
builder.setOAuthConsumerSecret(settings.getConsumerSecret()); builder.setOAuthConsumerSecret(settings.getConsumerSecret());
} else { } else {
builder.setOAuthConsumerKey(Constants.TWITTER_CONSUMER_KEY); builder.setOAuthConsumerKey("");
builder.setOAuthConsumerSecret(Constants.TWITTER_CONSUMER_SECRET); builder.setOAuthConsumerSecret("");
} }
// Twitter4J has its own proxy settings // Twitter4J has its own proxy settings
if (settings.isProxyEnabled()) { if (settings.isProxyEnabled()) {

View File

@ -97,7 +97,7 @@ public class MessageFragment extends ListFragment implements OnItemSelected, OnD
@Override @Override
public void onLinkClick(String tag) { public void onLinkClick(final String tag) {
String shortLink = tag; String shortLink = tag;
int cut = shortLink.indexOf('?'); int cut = shortLink.indexOf('?');
if (cut > 0) { if (cut > 0) {
@ -111,8 +111,8 @@ public class MessageFragment extends ListFragment implements OnItemSelected, OnD
intent.putExtra(KEY_TWEET_NAME, name); intent.putExtra(KEY_TWEET_NAME, name);
startActivity(intent); startActivity(intent);
} else { } else {
Uri link = Uri.parse(tag); Intent intent = new Intent(Intent.ACTION_VIEW);
Intent intent = new Intent(Intent.ACTION_VIEW, link); intent.setData(Uri.parse(tag));
try { try {
startActivity(intent); startActivity(intent);
} catch (ActivityNotFoundException err) { } catch (ActivityNotFoundException err) {