mirror of
https://framagit.org/tom79/nitterizeme
synced 2025-02-17 20:20:59 +01:00
Release 1.6.0
This commit is contained in:
parent
83c6ea584b
commit
8238ba4320
@ -7,8 +7,8 @@ android {
|
||||
applicationId "app.fedilab.nitterizeme"
|
||||
minSdkVersion 15
|
||||
targetSdkVersion 29
|
||||
versionCode 9
|
||||
versionName "1.5.2"
|
||||
versionCode 10
|
||||
versionName "1.6.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
lintOptions {
|
||||
|
@ -12,7 +12,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
@ -147,6 +147,54 @@
|
||||
android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- ow.ly -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="ow.ly"
|
||||
android:pathPattern=".*"
|
||||
android:scheme="https" />
|
||||
<data
|
||||
android:host="ow.ly"
|
||||
android:pathPattern=".*"
|
||||
android:scheme="http" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data
|
||||
android:host="ow.ly"
|
||||
android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- bl.ink -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:host="bl.ink"
|
||||
android:pathPattern=".*"
|
||||
android:scheme="https" />
|
||||
<data
|
||||
android:host="bl.ink"
|
||||
android:pathPattern=".*"
|
||||
android:scheme="http" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEND" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data
|
||||
android:host="bl.ink"
|
||||
android:mimeType="text/plain" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- INSTAGRAM URLs -->
|
||||
<!-- instagram.com -->
|
||||
<intent-filter>
|
||||
|
@ -24,10 +24,10 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -87,6 +87,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
"bit.ly",
|
||||
"tinyurl.com",
|
||||
"goo.gl",
|
||||
"ow.ly",
|
||||
"bl.ink"
|
||||
};
|
||||
private AppInfoAdapter appInfoAdapter;
|
||||
private RecyclerView list_apps;
|
||||
@ -331,7 +333,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
if (geouri_enabled) {
|
||||
osm_current_group.setVisibility(View.GONE);
|
||||
osm_custom_group.setVisibility(View.GONE);
|
||||
} else if (osm_enabled){
|
||||
} else if (osm_enabled) {
|
||||
osm_current_group.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
osm_custom_group.setVisibility(View.GONE);
|
||||
|
@ -93,6 +93,7 @@ public class TransformActivity extends Activity {
|
||||
|
||||
AlertDialog.Builder unshortenAlertBuilder = new AlertDialog.Builder(TransformActivity.this);
|
||||
unshortenAlertBuilder.setTitle(R.string.shortened_detected);
|
||||
unshortenAlertBuilder.setOnDismissListener(dialog -> finish());
|
||||
View view = getLayoutInflater().inflate(R.layout.popup_unshorten, new LinearLayout(getApplicationContext()), false);
|
||||
unshortenAlertBuilder.setView(view);
|
||||
unshortenAlertBuilder.setIcon(R.mipmap.ic_launcher);
|
||||
@ -116,6 +117,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
@ -135,6 +137,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
@ -154,6 +157,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
@ -167,6 +171,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -223,6 +228,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
@ -241,6 +247,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
@ -260,6 +267,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
@ -279,6 +287,7 @@ public class TransformActivity extends Activity {
|
||||
delegate.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
if (delegate.resolveActivity(getPackageManager()) != null) {
|
||||
startActivity(delegate);
|
||||
finish();
|
||||
}
|
||||
} else {
|
||||
forwardToBrowser(intent);
|
||||
@ -380,9 +389,9 @@ public class TransformActivity extends Activity {
|
||||
while (matcher.find()) {
|
||||
final String bibliogram_directory = matcher.group(2);
|
||||
String bibliogramHost = sharedpreferences.getString(MainActivity.SET_BIBLIOGRAM_HOST, MainActivity.DEFAULT_BIBLIOGRAM_HOST).toLowerCase();
|
||||
if( bibliogram_directory != null && bibliogram_directory.compareTo("privacy") != 0 ) {
|
||||
if (bibliogram_directory != null && bibliogram_directory.compareTo("privacy") != 0) {
|
||||
newUrl = "https://" + bibliogramHost + "/u" + bibliogram_directory;
|
||||
}else{
|
||||
} else {
|
||||
newUrl = "https://" + bibliogramHost + bibliogram_directory;
|
||||
}
|
||||
}
|
||||
@ -513,9 +522,9 @@ public class TransformActivity extends Activity {
|
||||
while (matcher.find()) {
|
||||
final String bibliogram_directory = matcher.group(2);
|
||||
String bibliogramHost = sharedpreferences.getString(MainActivity.SET_BIBLIOGRAM_HOST, MainActivity.DEFAULT_BIBLIOGRAM_HOST).toLowerCase();
|
||||
if( bibliogram_directory != null && bibliogram_directory.compareTo("privacy") != 0 ) {
|
||||
if (bibliogram_directory != null && bibliogram_directory.compareTo("privacy") != 0) {
|
||||
newUrl = "https://" + bibliogramHost + "/u" + bibliogram_directory;
|
||||
}else{
|
||||
} else {
|
||||
newUrl = "https://" + bibliogramHost + bibliogram_directory;
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ package app.fedilab.nitterizeme;
|
||||
* You should have received a copy of the GNU General Public License along with NitterizeMe; if not,
|
||||
* see <http://www.gnu.org/licenses>. */
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URL;
|
||||
@ -33,7 +34,32 @@ class Utils {
|
||||
static final Pattern urlPattern = Pattern.compile(
|
||||
"(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,10}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))",
|
||||
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL);
|
||||
private static final String[] UTM_PARAMS = {
|
||||
"utm_\\w+",
|
||||
"ga_source",
|
||||
"ga_medium",
|
||||
"ga_term",
|
||||
"ga_content",
|
||||
"ga_campaign",
|
||||
"ga_place",
|
||||
"yclid",
|
||||
"_openstat",
|
||||
"fb_action_ids",
|
||||
"fb_action_types",
|
||||
"fb_source",
|
||||
"fb_ref",
|
||||
"fbclid",
|
||||
"action_object_map",
|
||||
"action_type_map",
|
||||
"action_ref_map",
|
||||
"gs_l",
|
||||
"mkt_tok",
|
||||
"hmb_campaign",
|
||||
"hmb_medium",
|
||||
"hmb_source",
|
||||
"[\\?|&]ref[\\_]?"
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the unshortened URL
|
||||
@ -61,8 +87,9 @@ class Utils {
|
||||
if (entry.toString().toLowerCase().startsWith("location")) {
|
||||
Matcher matcher = urlPattern.matcher(entry.toString());
|
||||
if (matcher.find()) {
|
||||
urls.add(matcher.group(1));
|
||||
newURL = matcher.group(1);
|
||||
newURL = remove_tracking_param(matcher.group(1));
|
||||
urls.add(newURL);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -101,4 +128,24 @@ class Utils {
|
||||
}
|
||||
return timeDifference;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean URLs from utm parameters
|
||||
*
|
||||
* @param url String URL
|
||||
* @return cleaned URL String
|
||||
*/
|
||||
private static String remove_tracking_param(String url) {
|
||||
if (url != null) {
|
||||
for (String utm : UTM_PARAMS) {
|
||||
url = url.replaceAll("&" + utm + "=[0-9a-zA-Z._-]*", "");
|
||||
url = url.replaceAll("&" + utm + "=[0-9a-zA-Z._-]*", "");
|
||||
url = url.replaceAll("\\?" + utm + "=[0-9a-zA-Z._-]*", "?");
|
||||
}
|
||||
}
|
||||
if (url != null && url.endsWith("?")) {
|
||||
url = url.substring(0, url.length() - 1);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
6
fastlane/metadata/android/en-US/changelogs/10.txt
Normal file
6
fastlane/metadata/android/en-US/changelogs/10.txt
Normal file
@ -0,0 +1,6 @@
|
||||
Added:
|
||||
- Unshorten support: ow.ly, bl.ink (Think to allow the app for opening them)
|
||||
- Remove tracking parameters after unshorteninng URLs
|
||||
|
||||
Fixed:
|
||||
- Fix transparent background when dismissing
|
Loading…
x
Reference in New Issue
Block a user