Skip to content

Commit

Permalink
Merge remote-tracking branch 'my/development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan1986 committed Jul 3, 2022
2 parents 38def08 + f50b7c3 commit cac0264
Show file tree
Hide file tree
Showing 245 changed files with 5,887 additions and 2,318 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "base/submodules/TorrentStreamServer-Android"]
path = base/submodules/TorrentStreamServer-Android
url = [email protected]:julyworlds/TorrentStreamServer-Android.git
16 changes: 9 additions & 7 deletions base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ android {
def gitBranch = (System.getenv('GIT_BRANCH') == null ? 'local' : System.getenv('GIT_BRANCH').replace('origin/', ''))
def releaseType = (System.getenv('RELEASE_TYPE') == null ? 'NONE' : System.getenv('RELEASE_TYPE'))
def updateUrls = (System.getenv('UPDATE_URLS') == null ? '"https://popcorntime.sh/android-update.json"' : System.getenv('UPDATE_URLS'))
def animeUrls = (System.getenv('ANIME_URLS') == null ? '"https://anime.api-fetch.sh/"' : System.getenv('ANIME_URLS'))
def movieUrls = (System.getenv('MOVIE_URLS') == null ? '"https://movies-v2.api-fetch.sh/"' : System.getenv('MOVIE_URLS'))
def tvUrls = (System.getenv('TV_URLS') == null ? '"https://tv-v2.api-fetch.sh/"' : System.getenv('TV_URLS'))
def animeUrls = (System.getenv('ANIME_URLS') == null ? '"https://popcorn-time.ga/"' : System.getenv('ANIME_URLS'))
def movieUrls = (System.getenv('MOVIE_URLS') == null ? '"https://popcorn-time.ga/"' : System.getenv('MOVIE_URLS'))
def tvUrls = (System.getenv('TV_URLS') == null ? '"https://popcorn-time.ga/"' : System.getenv('TV_URLS'))

defaultConfig {
minSdkVersion rootProject.ext.minSdk
Expand All @@ -25,6 +25,7 @@ android {
buildConfigField 'String[]', 'TV_URLS', '{' + tvUrls + '}'
versionCode buildNumber
multiDexEnabled true
resValue 'string', 'sentry_dsn', rootProject.ext.sentryDsn
}

buildTypes {
Expand Down Expand Up @@ -61,7 +62,7 @@ dependencies {

api 'androidx.legacy:legacy-support-v4:1.0.0'
api 'androidx.palette:palette:1.0.0'
api 'com.google.android.material:material:1.1.0'
api 'com.google.android.material:material:1.3.0'

debugApi 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseApi 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
Expand All @@ -71,8 +72,6 @@ dependencies {
api "com.squareup.picasso:picasso:${rootProject.ext.picassoVersion}"
api "com.jakewharton:butterknife:${rootProject.ext.butterknifeVersion}"

api "com.github.TorrentStream:TorrentStreamServer-Android:${rootProject.ext.torrentstreamServerVersion}"

api 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'

api 'com.koushikdutta.async:androidasync:2.1.9'
Expand All @@ -88,7 +87,10 @@ dependencies {
annotationProcessor "com.google.dagger:dagger-compiler:${rootProject.ext.daggerVersion}"
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.butterknifeVersion}"

compileOnly "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"
implementation "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"
annotationProcessor "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"

implementation 'io.sentry:sentry-android:4.3.0'

api project(":StreamServerTorrent")
}
11 changes: 11 additions & 0 deletions base/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@
# public *;
#}

-keep class com.connectsdk.** { * ; }
-keep class org.eclipse.mat.** { *; }
-keep class com.squareup.leakcanary.** { *; }

-keepclasseswithmembernames,includedescriptorclasses class org.libtorrent4j.swig.libtorrent_jni {
native <methods>;
}
-keep class org.libtorrent4j.swig.** { *; }

-keep class com.github.se_bastiaan.torrentstreamserver.** { *; }
-keep class com.github.se_bastiaan.torrentstream.** { *; }

-keep class libcore.io.** { *; }

-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
Expand Down
2 changes: 2 additions & 0 deletions base/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include ":StreamServerTorrent"
project(":StreamServerTorrent").projectDir = file("./submodules/TorrentStreamServer-Android/library")
2 changes: 2 additions & 0 deletions base/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
android:resource="@xml/provider_paths" />
</provider>

<meta-data android:name="io.sentry.dsn" android:value="@string/sentry_dsn" />
<uses-library android:name="org.apache.http.legacy" android:required="false" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void onCreate() {
}
}

Timber.d("StorageLocations: " + StorageUtils.getAllStorageLocations());
Timber.d("StorageLocations: " + StorageUtils.getAllStorageLocations(this));
Timber.i("Chosen cache location: " + directory);

Picasso.setSingletonInstance(picasso);
Expand Down
21 changes: 17 additions & 4 deletions base/src/main/java/butter/droid/base/beaming/BeamManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import com.connectsdk.core.ImageInfo;
import com.connectsdk.core.MediaInfo;
import com.connectsdk.core.SubtitleInfo;
import com.connectsdk.device.ConnectableDevice;
import com.connectsdk.device.ConnectableDeviceListener;
import com.connectsdk.discovery.CapabilityFilter;
Expand Down Expand Up @@ -245,9 +246,9 @@ public void playVideo(StreamInfo info, final MediaPlayer.LaunchListener listener
TorrentStreamServer.getInstance().setStreamSrtSubtitle(srtFile);
TorrentStreamServer.getInstance().setStreamVttSubtitle(vttFile);

if(mCurrentDevice.hasCapability(MediaPlayer.Subtitles_Vtt)) {
if(mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
subsLocation = location.substring(0, location.lastIndexOf('.')) + ".vtt";
} else if (mCurrentDevice.hasCapability(MediaPlayer.Subtitles_Srt)) {
} else if (mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
subsLocation = location.substring(0, location.lastIndexOf('.')) + ".srt";
}
} else {
Expand All @@ -274,8 +275,20 @@ public void playVideo(StreamInfo info, final MediaPlayer.LaunchListener listener

//String url, String mimeType, String title, String description, String iconSrc, boolean shouldLoop, LaunchListener listener
if (mCurrentDevice != null) {
MediaInfo mediaInfo = new MediaInfo(location, subsLocation, "video/mp4", title, "");
mediaInfo.addImages(new ImageInfo(imageUrl));
MediaInfo.Builder builder = new MediaInfo.Builder(location, "video/mp4");
builder.setTitle(title);
builder.setIcon(new ImageInfo(imageUrl));
if (subsLocation != null) {
SubtitleInfo.Builder sBuilder = new SubtitleInfo.Builder(subsLocation);
sBuilder.setLanguage(info.getSubtitleLanguage());
if(mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
sBuilder.setMimeType(MediaPlayer.Subtitle_WebVTT);
} else if (mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
sBuilder.setMimeType(MediaPlayer.Subtitle_SRT);
}
builder.setSubtitleInfo(sBuilder.build());
}
MediaInfo mediaInfo = builder.build();
mCurrentDevice.getCapability(MediaPlayer.class).playMedia(mediaInfo, false, new MediaPlayer.LaunchListener() {
@Override
public void onSuccess(MediaPlayer.MediaLaunchObject object) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ public static boolean start(Media media, String subLanguage, String location) {
if (media != null) {
if (media.isMovie) {
intent.putExtra("title", media.title);
intent.putExtra("filename", media.title);
} else {
Episode episode = (Episode) media;
intent.putExtra("title", String.format(LocaleUtils.getCurrent(), "%s S%dE%d - %s", episode.showName, episode.season, episode.episode, episode.title));
intent.putExtra("filename", String.format(LocaleUtils.getCurrent(), "%s S%dE%d - %s", episode.showName, episode.season, episode.episode, episode.title));
}
}

Expand Down
Loading

0 comments on commit cac0264

Please sign in to comment.