Compare commits
No commits in common. "e222867ec6e610dd662e66c3b613652b319664e7" and "ea890bfbcdce72db5f2b0842f95fe65628b0a71e" have entirely different histories.
e222867ec6
...
ea890bfbcd
|
@ -11,7 +11,6 @@
|
||||||
android:theme="@style/Theme.Unshortify">
|
android:theme="@style/Theme.Unshortify">
|
||||||
|
|
||||||
<activity android:name="ShareActivity"
|
<activity android:name="ShareActivity"
|
||||||
android:theme="@android:style/Theme.NoDisplay"
|
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
|
@ -56,8 +56,7 @@ public class ShareActivity extends Activity {
|
||||||
: null;
|
: null;
|
||||||
logVariable("host", host);
|
logVariable("host", host);
|
||||||
if (host == null || (!host.equals("youtube.com") &&
|
if (host == null || (!host.equals("youtube.com") &&
|
||||||
!host.endsWith(".youtube.com") &&
|
!host.endsWith(".youtube.com"))) {
|
||||||
!host.equals("youtu.be"))) {
|
|
||||||
Toast.makeText(getApplicationContext(), R.string.non_youtube_url,
|
Toast.makeText(getApplicationContext(), R.string.non_youtube_url,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
|
@ -70,20 +69,14 @@ public class ShareActivity extends Activity {
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!path.toLowerCase(Locale.ROOT).startsWith("/shorts/")) {
|
||||||
|
Toast.makeText(getApplicationContext(), R.string.non_shorts_url,
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String videoId = null;
|
|
||||||
if (host.equals("youtu.be")) {
|
|
||||||
final String[] pathSegments = urlParsed.getPath().split("/");
|
final String[] pathSegments = urlParsed.getPath().split("/");
|
||||||
if (pathSegments.length == 2) {
|
if (pathSegments.length != 3) {
|
||||||
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 (videoId == null || videoId.isEmpty()) {
|
|
||||||
Toast.makeText(getApplicationContext(), R.string.non_shorts_url,
|
Toast.makeText(getApplicationContext(), R.string.non_shorts_url,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue