Compare commits

..

No commits in common. "e222867ec6e610dd662e66c3b613652b319664e7" and "ea890bfbcdce72db5f2b0842f95fe65628b0a71e" have entirely different histories.

2 changed files with 8 additions and 16 deletions

View File

@ -11,7 +11,6 @@
android:theme="@style/Theme.Unshortify">
<activity android:name="ShareActivity"
android:theme="@android:style/Theme.NoDisplay"
android:exported="true">
<intent-filter>

View File

@ -56,8 +56,7 @@ public class ShareActivity extends Activity {
: null;
logVariable("host", host);
if (host == null || (!host.equals("youtube.com") &&
!host.endsWith(".youtube.com") &&
!host.equals("youtu.be"))) {
!host.endsWith(".youtube.com"))) {
Toast.makeText(getApplicationContext(), R.string.non_youtube_url,
Toast.LENGTH_SHORT).show();
return;
@ -70,20 +69,14 @@ public class ShareActivity extends Activity {
Toast.LENGTH_SHORT).show();
return;
}
String videoId = null;
if (host.equals("youtu.be")) {
final String[] pathSegments = urlParsed.getPath().split("/");
if (pathSegments.length == 2) {
videoId = pathSegments[1];
}
} else if (path.toLowerCase(Locale.ROOT).startsWith("/shorts/")) {
final String[] pathSegments = urlParsed.getPath().split("/");
if (pathSegments.length == 3) {
videoId = pathSegments[2];
}
if (!path.toLowerCase(Locale.ROOT).startsWith("/shorts/")) {
Toast.makeText(getApplicationContext(), R.string.non_shorts_url,
Toast.LENGTH_SHORT).show();
return;
}
if (videoId == null || videoId.isEmpty()) {
final String[] pathSegments = urlParsed.getPath().split("/");
if (pathSegments.length != 3) {
Toast.makeText(getApplicationContext(), R.string.non_shorts_url,
Toast.LENGTH_SHORT).show();
return;