Compare commits
No commits in common. "42ca1a016c4c853bd6fac4b4165a92d27bb12ec4" and "84d405d5d67579f4c7d0f7be425f6d0d4703b41c" have entirely different histories.
42ca1a016c
...
84d405d5d6
|
@ -27,7 +27,7 @@ stages:
|
||||||
|
|
||||||
assembleDebug:
|
assembleDebug:
|
||||||
stage: build
|
stage: build
|
||||||
script: ./gradlew assembleDebug && mv app/build/outputs/apk/debug/app-debug.apk unshortify.apk
|
script: ./gradlew assembleDebug
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- unshortify.apk
|
- app/build/outputs/apk/debug/*.apk
|
||||||
|
|
|
@ -6,23 +6,12 @@ import android.widget.Toast;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.blankie.unshortify.R;
|
import com.blankie.unshortify.R;
|
||||||
|
|
||||||
public class ShareActivity extends Activity {
|
public class ShareActivity extends Activity {
|
||||||
public static final String TAG = "unshortify";
|
public static final String TAG = "unshortify";
|
||||||
|
|
||||||
private void logVariable(final String name, final String value) {
|
|
||||||
String msg = name + " = ";
|
|
||||||
if (value != null) {
|
|
||||||
msg += "[" + value + "]";
|
|
||||||
} else {
|
|
||||||
msg += "null";
|
|
||||||
}
|
|
||||||
Log.d(TAG, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -30,7 +19,6 @@ public class ShareActivity extends Activity {
|
||||||
try {
|
try {
|
||||||
final Intent intent = getIntent();
|
final Intent intent = getIntent();
|
||||||
final String urlString = intent.getStringExtra(Intent.EXTRA_TEXT);
|
final String urlString = intent.getStringExtra(Intent.EXTRA_TEXT);
|
||||||
logVariable("urlString", urlString);
|
|
||||||
if (urlString == null || urlString == "") {
|
if (urlString == null || urlString == "") {
|
||||||
Toast.makeText(getApplicationContext(), R.string.empty_url,
|
Toast.makeText(getApplicationContext(), R.string.empty_url,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
@ -38,7 +26,6 @@ public class ShareActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Uri urlParsed = Uri.parse(urlString);
|
final Uri urlParsed = Uri.parse(urlString);
|
||||||
logVariable("scheme", urlParsed.getScheme());
|
|
||||||
if (urlParsed.getScheme() != "http" && urlParsed.getScheme() != "https" &&
|
if (urlParsed.getScheme() != "http" && urlParsed.getScheme() != "https" &&
|
||||||
urlParsed.getScheme() != "") {
|
urlParsed.getScheme() != "") {
|
||||||
Toast.makeText(getApplicationContext(), R.string.unknown_scheme,
|
Toast.makeText(getApplicationContext(), R.string.unknown_scheme,
|
||||||
|
@ -46,7 +33,6 @@ public class ShareActivity extends Activity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logVariable("host", urlParsed.getHost());
|
|
||||||
if (urlParsed.getHost() == null || (urlParsed.getHost() != "youtube.com" &&
|
if (urlParsed.getHost() == null || (urlParsed.getHost() != "youtube.com" &&
|
||||||
urlParsed.getHost().endsWith(".youtube.com"))) {
|
urlParsed.getHost().endsWith(".youtube.com"))) {
|
||||||
Toast.makeText(getApplicationContext(), R.string.non_youtube_url,
|
Toast.makeText(getApplicationContext(), R.string.non_youtube_url,
|
||||||
|
@ -54,7 +40,6 @@ public class ShareActivity extends Activity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logVariable("path", urlParsed.getPath());
|
|
||||||
if (urlParsed.getPath() == null) {
|
if (urlParsed.getPath() == null) {
|
||||||
Toast.makeText(getApplicationContext(), R.string.null_path,
|
Toast.makeText(getApplicationContext(), R.string.null_path,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
|
Loading…
Reference in New Issue