Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
670848654 committed Nov 27, 2019
1 parent 71244fa commit d6a8f07
Show file tree
Hide file tree
Showing 28 changed files with 337 additions and 157 deletions.
7 changes: 3 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "my.project.sakuraproject"
minSdkVersion 21
targetSdkVersion 29
versionCode 11
versionName "1.8.3"
versionCode 12
versionName "1.8.4"
ndk{abiFilters "armeabi", "armeabi-v7a", "x86"}
resConfigs"zh"
}
Expand Down Expand Up @@ -39,7 +39,6 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
implementation 'pub.devrel:easypermissions:0.1.9'
implementation 'org.jsoup:jsoup:1.11.2'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.r0adkll:slidableactivity:2.0.5'
implementation 'com.jakewharton:butterknife:9.0.0-rc3'
Expand All @@ -51,7 +50,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.android.support:customtabs:29.0.0'
implementation 'com.tencent.tbs.tbssdk:sdk:43697'
implementation 'com.github.fanchen001:Sniffing:1.0.1'
implementation 'com.github.GrenderG:Toasty:1.4.2'
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import android.content.Context;
import android.widget.Button;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import androidx.annotation.Nullable;
import my.project.sakuraproject.R;
import my.project.sakuraproject.bean.AnimeDescBean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import android.view.ViewGroup;

import java.util.HashMap;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.HashMap;

import my.project.sakuraproject.R;
import my.project.sakuraproject.main.home.WeekFragment;
import my.project.sakuraproject.util.Utils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import android.app.Application;
import android.widget.Toast;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.appcompat.app.AppCompatDelegate;

import com.bumptech.glide.Glide;
import com.tencent.smtt.sdk.QbSdk;

Expand All @@ -15,9 +19,6 @@
import java.util.Map;
import java.util.Set;

import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.appcompat.app.AppCompatDelegate;
import cn.jzvd.JzvdStd;
import es.dmoral.toasty.Toasty;
import my.project.sakuraproject.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.view.ViewCompat;
import androidx.core.view.ViewPropertyAnimatorListener;
import androidx.interpolator.view.animation.FastOutSlowInInterpolator;

import com.google.android.material.floatingactionbutton.FloatingActionButton;

import my.project.sakuraproject.R;

public class ScrollAwareBehavior extends FloatingActionButton.Behavior {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.r0adkll.slidr.Slidr;

import org.json.JSONException;
Expand All @@ -22,11 +28,6 @@
import java.util.ArrayList;
import java.util.List;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.OnClick;
import my.project.sakuraproject.R;
Expand Down Expand Up @@ -164,6 +165,7 @@ public void showUpdateLogs() {

public List createUpdateLogList() {
List logsList = new ArrayList();
logsList.add(new LogBean("版本:1.8.3","修复视频播放器白额头的Bug\n增加新的解析方案,尽量减少使用webView(Test)"));
logsList.add(new LogBean("版本:1.8.3","修复一些Bug"));
logsList.add(new LogBean("版本:1.8.2","默认禁用X5内核,X5内核更新后会导致应用闪退(Android 10),你可以在自定义设置中打开,若发生闪退则关闭该选项"));
logsList.add(new LogBean("版本:1.8.1","修复某些设备导航栏的显示问题"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package my.project.sakuraproject.main.about;

import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.r0adkll.slidr.Slidr;

import java.util.ArrayList;
import java.util.List;

import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import butterknife.BindView;
import my.project.sakuraproject.R;
import my.project.sakuraproject.adapter.SourceAdapter;
Expand Down Expand Up @@ -83,6 +84,7 @@ public void initList() {
list.add(new SourceBean("okhttp", "square", "An HTTP+HTTP/2 client for Android and Java applications.", "https://github.com/square/okhttp"));
list.add(new SourceBean("customtabs", "GoogleChrome", "mirrored from https://chromium.googlesource.com/custom-tabs-client", "https://github.com/GoogleChrome/custom-tabs-client"));
list.add(new SourceBean("Toasty","GrenderG","The usual Toast, but with steroids","https://github.com/GrenderG/Toasty"));
list.add(new SourceBean("Sniffing","fanchen001","【次元番】使用的,一个基于webview/x5webview的视频嗅探工具,能准确解析绝大多数手机在线视频网站的视频真实链接。","https://github.com/fanchen001/Sniffing"));
}

public void initAdapter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
import android.view.View;
import android.view.ViewGroup;

import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.r0adkll.slidr.Slidr;

import java.util.ArrayList;
import java.util.List;

import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import butterknife.BindView;
import butterknife.OnClick;
import my.project.sakuraproject.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;

import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
Expand All @@ -15,10 +18,6 @@
import java.util.ArrayList;
import java.util.List;

import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import butterknife.BindView;
import butterknife.OnClick;
import my.project.sakuraproject.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import android.view.WindowManager;
import android.widget.TextView;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.tencent.smtt.sdk.TbsVideo;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.Unbinder;
import my.project.sakuraproject.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,29 @@
import android.widget.Button;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.fanchen.sniffing.SniffingUICallback;
import com.fanchen.sniffing.SniffingVideo;
import com.fanchen.sniffing.web.SniffingUtil;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.r0adkll.slidr.Slidr;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import butterknife.BindView;
import jp.wasabeef.blurry.Blurry;
import my.project.sakuraproject.R;
Expand All @@ -45,15 +49,13 @@
import my.project.sakuraproject.main.base.BaseActivity;
import my.project.sakuraproject.main.video.VideoContract;
import my.project.sakuraproject.main.video.VideoPresenter;
import my.project.sakuraproject.main.webview.normal.DefaultNormalWebActivity;
import my.project.sakuraproject.main.webview.x5.DefaultX5WebActivity;
import my.project.sakuraproject.util.SharedPreferencesUtils;
import my.project.sakuraproject.util.StatusBarUtil;
import my.project.sakuraproject.util.SwipeBackLayoutUtil;
import my.project.sakuraproject.util.Utils;
import my.project.sakuraproject.util.VideoUtils;

public class DescActivity extends BaseActivity<DescContract.View, DescPresenter> implements DescContract.View, VideoContract.View {
public class DescActivity extends BaseActivity<DescContract.View, DescPresenter> implements DescContract.View, VideoContract.View, SniffingUICallback {
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.rv_list)
Expand All @@ -69,7 +71,7 @@ public class DescActivity extends BaseActivity<DescContract.View, DescPresenter>
private List<AnimeDescBean> drama = new ArrayList<>();
@BindView(R.id.title_img)
ImageView imageView;
private String url, diliUrl, dramaUrl;
private String diliUrl, dramaUrl;
private String animeTitle;
private String witchTitle;
private ProgressDialog p;
Expand All @@ -80,6 +82,8 @@ public class DescActivity extends BaseActivity<DescContract.View, DescPresenter>
private AnimeListBean animeListBean = new AnimeListBean();
private List<String> animeUrlList = new ArrayList();
private boolean mIsLoad = false;
//播放网址
private String webUrl;

@Override
protected DescPresenter createPresenter() {
Expand Down Expand Up @@ -223,16 +227,21 @@ private void multipleSource(List<String> list) {
VideoUtils.showMultipleVideoSources(this,
list,
(dialog, index) ->
playAnime(VideoUtils.getVideoUrl(list.get(index)))
playAnime(VideoUtils.getVideoUrl(list.get(index))), (dialog, which) -> {
cancelDialog();
dialog.dismiss();
}, 0
);
}

private void playAnime(String animeUrl) {
if (Patterns.WEB_URL.matcher(animeUrl.replace(" ", "")).matches()) {
if (animeUrl.contains("jx.618g.com")) {
cancelDialog();
animeUrl = animeUrl.replaceAll("http://jx.618g.com/\\?url=", "");
VideoUtils.openWebview(true, this, witchTitle, animeTitle, animeUrl, diliUrl, drama);
} else if (animeUrl.contains(".mp4") || animeUrl.contains(".m3u8")) {
cancelDialog();
switch ((Integer) SharedPreferencesUtils.getParam(getApplicationContext(), "player", 0)) {
case 0:
//调用播放器
Expand All @@ -243,18 +252,14 @@ private void playAnime(String animeUrl) {
break;
}
} else {
webUrl = animeUrl;
Sakura.getInstance().showToastMsg(Utils.getString(R.string.should_be_used_web));
if (Utils.loadX5())
startActivity(new Intent(DescActivity.this, DefaultX5WebActivity.class).putExtra("url", animeUrl));
else
startActivity(new Intent(DescActivity.this, DefaultNormalWebActivity.class).putExtra("url", animeUrl));
SniffingUtil.get().activity(this).referer(webUrl).callback(this).url(webUrl).start();
}
} else {
webUrl = String.format(Api.PARSE_API, animeUrl);
Sakura.getInstance().showToastMsg(Utils.getString(R.string.maybe_can_not_play));
if (Utils.loadX5())
startActivity(new Intent(DescActivity.this, DefaultX5WebActivity.class).putExtra("url",String.format(Api.PARSE_API, animeUrl)));
else
startActivity(new Intent(DescActivity.this, DefaultNormalWebActivity.class).putExtra("url",String.format(Api.PARSE_API, animeUrl)));
SniffingUtil.get().activity(this).referer(webUrl).callback(this).url(webUrl).start();
}
}

Expand Down Expand Up @@ -452,4 +457,34 @@ public void showSuccessDramaView(List<AnimeDescBean> list) {
public void errorDramaView() {

}

@Override
public void onSniffingStart(View webView, String url) {

}

@Override
public void onSniffingFinish(View webView, String url) {
cancelDialog();
}

@Override
public void onSniffingSuccess(View webView, String url, List<SniffingVideo> videos) {
List<String> urls = new ArrayList<>();
for (SniffingVideo video : videos) {
urls.add(video.getUrl());
}
VideoUtils.showMultipleVideoSources(this,
urls,
(dialog, index) -> playAnime(urls.get(index)), (dialog, which) -> {
cancelDialog();
dialog.dismiss();
}, 1);
}

@Override
public void onSniffingError(View webView, String url, int errorCode) {
Sakura.getInstance().showToastMsg(Utils.getString(R.string.open_web_view));
VideoUtils.openDefaultWebview(this, webUrl);
}
}
Loading

0 comments on commit d6a8f07

Please sign in to comment.