Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Youtube Multi Profile log in #757

Open
wants to merge 32 commits into
base: main-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0b2066e
Performance improvement
selectee May 9, 2020
367a8e2
Merge branch 'selectee-performance-improvement' into new-exo-player
yuliskov May 9, 2020
551d2d5
bump to 6.17.563
yuliskov May 9, 2020
c8ab284
bump to 6.17.564
yuliskov May 9, 2020
a543bdc
bump to 6.17.565
yuliskov May 9, 2020
5ad01ac
Remove multiple pattern compilation
selectee May 10, 2020
5e42714
Merge branch 'selectee-remove-patterns' into new-exo-player
yuliskov May 10, 2020
79d63de
Add state of loading scripts
selectee May 10, 2020
c492c23
Merge branch 'script-load-state' of https://github.com/selectee/Smart…
yuliskov May 10, 2020
1d08086
Merge branch 'selectee-script-load-state' into new-exo-player
yuliskov May 10, 2020
d88148d
repo sync
yuliskov May 10, 2020
dcaa5d2
Update languages.xml
WaggBR May 10, 2020
8fbdd4d
Add interceptor for filtering PNG, JPG, ICO and TTF files.
selectee May 11, 2020
318bef5
experiments icon fix
yuliskov May 12, 2020
2a62954
experiments default settings
yuliskov May 12, 2020
d7ba02b
experiments icon fix2
yuliskov May 12, 2020
c92a729
experiments icon fix: fin
yuliskov May 12, 2020
e51b0d4
bump to 6.17.566
yuliskov May 12, 2020
be2e353
bump to 6.17.568
yuliskov May 12, 2020
aebae64
pull fix
yuliskov May 11, 2020
5c5c5f6
Merge branch 'experiments' of https://github.com/selectee/SmartYouTub…
yuliskov May 11, 2020
b190976
Merge branch 'selectee-experiments' into experiments
yuliskov May 11, 2020
87fbcf3
bump to 6.17.569
yuliskov May 11, 2020
bda4790
experiments icon fix
yuliskov May 12, 2020
c489180
experiments default settings
yuliskov May 12, 2020
3e0e9a3
experiments icon fix2
yuliskov May 12, 2020
8f219db
experiments icon fix: fin
yuliskov May 12, 2020
dc36e82
bump to 6.17.566
yuliskov May 12, 2020
9901274
bump to 6.17.568
yuliskov May 12, 2020
31544fe
refactor + logging
yuliskov May 11, 2020
2df3b6e
Merge branch 'experiments' of https://github.com/WaggBR/SmartYouTubeT…
yuliskov May 12, 2020
0954e9e
Merge branch 'WaggBR-experiments' into experiments
yuliskov May 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SharedUtils
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebChromeClient.FileChooserParams;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import java.util.Map;

Expand Down Expand Up @@ -108,14 +105,20 @@ Tab openTab(String url, Tab parent, boolean setActive,
boolean shouldCaptureThumbnails();

// My Custom Methods

void setListener(Controller.EventListener listener);

void onControllerStart();

void onSaveControllerState(Bundle state);

void onRestoreControllerState(Bundle state);

void setDefaultUrl(Uri url);

void setDefaultHeaders(Map<String, String> headers);
Map<String,String> getDefaultHeaders();

Map<String, String> getDefaultHeaders();

// End My Custom Methods
}
1 change: 1 addition & 0 deletions common/src/main/res/values/languages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<item>Arabic|ar</item>
<item>Hebrew|he</item>
<item>Spanish|es</item>
<item>Português Brasileiro|pt_BR</item>
<item>Français|fr</item>
<item>Nederlands|nl</item>
<item>Czech|cs</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
Expand All @@ -21,7 +21,6 @@
import com.liskovsoft.sharedutils.dialogs.CombinedChoiceSelectorDialog;
import com.liskovsoft.sharedutils.dialogs.SingleChoiceSelectorDialog;
import com.liskovsoft.sharedutils.helpers.Helpers;
import com.liskovsoft.sharedutils.helpers.KeyHelpers;
import com.liskovsoft.sharedutils.mylogger.Log;
import com.liskovsoft.smartyoutubetv.flavors.exoplayer.player.dialogs.afr.AfrDialogSource;
import com.liskovsoft.smartyoutubetv.flavors.exoplayer.player.dialogs.restrictcodec.RestrictFormatDialogSource;
Expand Down Expand Up @@ -90,7 +89,6 @@ public abstract class ExoPlayerBaseFragment extends PlayerCoreFragment {
private PlayerStateManager mStateManager;
private VideoZoomManager mVideoZoomManager;
private List<PlayerEventListener> mListeners;
private List<String> mRestore;
private boolean mIsAfrApplying;
private boolean mPlaybackStopped;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.liskovsoft.smartyoutubetv.flavors.exoplayer.player.dialogs.speed;

import android.content.Context;

import com.google.android.exoplayer2.SimpleExoPlayer;
import com.liskovsoft.exoplayeractivity.R;
import com.liskovsoft.sharedutils.dialogs.GenericSelectorDialog.CombinedDialogSource;
Expand All @@ -12,31 +13,29 @@

public class SpeedDialogSource implements CombinedDialogSource {
private final Context mContext;
private final SimpleExoPlayer mPlayer;
private final ArrayList<DialogItem> mItems;
private final ExoPreferences mPrefs;
private final List<DialogItem> mItems;

public SpeedDialogSource(ExoPlayerFragment playerFragment) {
mContext = playerFragment.getActivity();
mPlayer = playerFragment.getPlayer();
mPrefs = ExoPreferences.instance(mContext);
SimpleExoPlayer player = playerFragment.getPlayer();
ExoPreferences preferences = ExoPreferences.instance(mContext);

mItems = new ArrayList<>();
mItems.add(new SaveSpeedDialogItem(mContext.getString(R.string.checkbox_save_speed), mPrefs));
mItems.add(new SpeedDialogItem("0.25", "0.25", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("0.5", "0.5", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("0.75", "0.75", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem(mContext.getString(R.string.normal), "1.0", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("1.25", "1.25", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("1.5", "1.5", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("1.75", "1.75", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("2", "2.0", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("2.25", "2.25", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("2.5", "2.5", mPlayer, mPrefs));
mItems.add(new SpeedDialogItem("2.75", "2.75", mPlayer, mPrefs));

if (mPlayer != null) {
SpeedDialogItem.sCurrentSpeed = String.valueOf(mPlayer.getPlaybackParameters().speed);
mItems.add(new SaveSpeedDialogItem(mContext.getString(R.string.checkbox_save_speed), preferences));
mItems.add(new SpeedDialogItem("0.25", "0.25", player, preferences));
mItems.add(new SpeedDialogItem("0.5", "0.5", player, preferences));
mItems.add(new SpeedDialogItem("0.75", "0.75", player, preferences));
mItems.add(new SpeedDialogItem(mContext.getString(R.string.normal), "1.0", player, preferences));
mItems.add(new SpeedDialogItem("1.25", "1.25", player, preferences));
mItems.add(new SpeedDialogItem("1.5", "1.5", player, preferences));
mItems.add(new SpeedDialogItem("1.75", "1.75", player, preferences));
mItems.add(new SpeedDialogItem("2", "2.0", player, preferences));
mItems.add(new SpeedDialogItem("2.25", "2.25", player, preferences));
mItems.add(new SpeedDialogItem("2.5", "2.5", player, preferences));
mItems.add(new SpeedDialogItem("2.75", "2.75", player, preferences));

if (player != null) {
SpeedDialogItem.sCurrentSpeed = String.valueOf(player.getPlaybackParameters().speed);
}
}

Expand Down
12 changes: 10 additions & 2 deletions smartyoutubetv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ android {
minSdkVersion project.properties.minSdkVersion
targetSdkVersion project.properties.targetSdkVersion
applicationId "com.liskovsoft.videomanager"
versionCode 1142
versionName "6.17.562"
versionCode 1149
versionName "6.17.569"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"

Expand Down Expand Up @@ -88,6 +88,10 @@ android {
orig {
matchingFallbacks = ['lite']
}
experiments {
matchingFallbacks = ['lite']
applicationIdSuffix ".experiments"
}
// Vtesting {
// matchingFallbacks = ['lite']
// applicationIdSuffix ".testing"
Expand Down Expand Up @@ -170,6 +174,9 @@ android {
orig {
java.srcDirs('src/commonSrc/crashHandler/java')
}
experiments {
java.srcDirs('src/commonSrc/crashHandler/java')
}
// Vtesting {
// java.srcDirs = commonDirs
// }
Expand Down Expand Up @@ -220,6 +227,7 @@ dependencies {

// ATV INSTALL_FAILED_CONFLICTING_PROVIDER fix
origImplementation project(path: ':leanbackassistant')
experimentsImplementation project(path: ':leanbackassistant')

implementation project(path: ':common')

Expand Down
189 changes: 189 additions & 0 deletions smartyoutubetv/src/experiments/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"
package="com.liskovsoft.smartyoutubetv">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>

<!-- NOTE: use older sdk -->
<uses-sdk tools:overrideLibrary="
org.xwalk.core,
com.algolia.instantsearch.voice,
androidx.leanback, androidx.tvprovider,
com.github.rubensousa.previewseekbar,
com.github.rubensousa.previewseekbar.exoplayer,
com.google.android.exoplayer2.ext.vp9,
com.google.android.exoplayer2.testutil,
com.google.android.exoplayer2.ext.okhttp"/>

<!-- Leanback required fields -->
<uses-feature
android:name="android.software.leanback"
android:required="false"/>
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false"/>
<uses-feature
android:name="android.hardware.faketouch"
android:required="false"/>
<uses-feature
android:name="android.hardware.location.gps"
android:required="false"/>
<uses-feature
android:name="android.hardware.microphone"
android:required="false"/>
<uses-feature
android:name="android.hardware.sensor"
android:required="false"/>
<uses-feature
android:name="android.hardware.camera"
android:required="false"/>
<!-- End Leanback required fields -->

<!-- NOTE: ExoApplication: exoplayer specific params -->
<application
android:name="com.liskovsoft.browser.Browser"
android:allowBackup="true"
android:banner="@mipmap/ic_banner_main"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher_main"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:largeHeap="true"
android:supportsRtl="true"
tools:node="merge"
tools:replace="android:name">

<!-- allow to use repacked XWalk's apk -->
<meta-data android:name="xwalk_verify" android:value="disable" />

<!-- NOTE: Screen Mirror (e.g. DIAL) for Amazon TV -->
<meta-data android:name="whisperplay" android:resource="@xml/whisperplay"/>

<!-- Root (bootstrap) Activity -->
<!-- NOTE: avoid setting launchMode or you will get new activity every time from launcher -->
<!-- NOTE: also, you'll got problems with activity restarting (System.exit) -->
<activity android:name=".bootstrap.BootstrapActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|fontScale"
android:windowSoftInputMode="adjustResize"
android:noHistory="true"
android:excludeFromRecents="true"
android:taskAffinity="com.liskovsoft.smartyoutubetv.orig"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
<!-- Pass url from other apps -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>

<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>

<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="youtube.com"/>
<data android:host="www.youtube.com"/>
<data android:host="m.youtube.com"/>
<data android:host="youtu.be"/>
<data android:pathPattern=".*"/>
<data android:host="search" android:scheme="youtube"/>
<data android:host="play" android:scheme="youtube"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>

<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>

<data android:scheme="vnd.youtube"/>
<data android:scheme="vnd.youtube.launch"/>
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.CLEAR_CACHE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<!-- End Pass url from other apps -->
</activity>
<!-- End Root Activity -->

<!-- Flavours -->
<activity
android:name=".flavors.webview.SmartYouTubeTV1080Activity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|fontScale"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:excludeFromRecents="false"
android:alwaysRetainTaskState="true"
tools:node="replace">
</activity>
<activity
android:name=".flavors.xwalk.SmartYouTubeTV1080AltActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|fontScale"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:excludeFromRecents="false"
android:alwaysRetainTaskState="true"
tools:node="replace">
</activity>
<activity
android:name=".flavors.exoplayer.SmartYouTubeTV4K"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|fontScale"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true"
android:excludeFromRecents="false"
android:alwaysRetainTaskState="true"
tools:node="replace">
</activity>
<activity
android:name=".flavors.exoplayer.SmartYouTubeTV4KAlt"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|fontScale"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:excludeFromRecents="false"
android:alwaysRetainTaskState="true"
tools:node="replace">
</activity>
<!-- End Flavours -->

<!-- Amazon Launcher for official YouTube -->
<!-- WARN: for compatibility with bridge try to not rename the activity -->
<activity-alias
android:targetActivity=".bootstrap.BootstrapActivity"
android:name=".flavors.exoplayer.SmartYouTubeTV4KAmazon"
android:taskAffinity="com.liskovsoft.smartyoutubetv.orig"
android:noHistory="true"
android:excludeFromRecents="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|fontScale"
android:windowSoftInputMode="adjustResize"
android:exported="true"
tools:node="replace">
</activity-alias>

<receiver
android:name=".receivers.ClearCacheReceiver"
android:exported="true"
tools:node="replace">
<intent-filter>
<action android:name="android.intent.action.CLEAR_CACHE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</receiver>
</application>

</manifest>
9 changes: 9 additions & 0 deletions smartyoutubetv/src/experiments/assets/service.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# avoid resume playback after app exit
main_page_persistent = true
main_page_url = https://www.youtube.com/tv
music_page_url = https://www.youtube.com/tv#/surface?c=FEtopics&params=-gIFbXVzaWM%253D&resume
subscriptions_page_url = https://www.youtube.com/tv#/surface?c=FEsubscriptions
history_page_url = https://www.youtube.com/tv#/surface?c=FEmy_youtube
watch_later_page_url = https://www.youtube.com/tv#/surface?c=FEmy_youtube&params=cAc%253D&resume
stable_urls.github = https://github.com/yuliskov/SmartYouTubeTV/releases/download/experiments/smartyoutubetv.json
beta_urls.github = https://github.com/yuliskov/SmartYouTubeTV/releases/download/experiments/smartyoutubetv.json
Loading