Skip to content

Commit

Permalink
1.解决腾讯视频部分网页无法点击的bug
Browse files Browse the repository at this point in the history
2.新增vip播放接口网络爬取的方式
  • Loading branch information
liyiwei committed Sep 6, 2018
1 parent b877886 commit 1657b53
Show file tree
Hide file tree
Showing 38 changed files with 1,358 additions and 386 deletions.
39 changes: 33 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ android {
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.1.0"
versionName "1.1.1"
//指定room.schemaLocation生成的文件路径
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {
release {
Expand All @@ -38,19 +44,40 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:27.1.1'
//设计图标辅助库
//the core iconcis library (without any widgets)
// implementation "com.mikepenz:iconics-core:3.1.0-rc01"
// implementation "androidx.appcompat:appcompat:${versions.androidXVersion}"
// implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
//网页解析
implementation 'org.jsoup:jsoup:1.11.3'
//网络请求
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
//json解析
implementation 'com.google.code.gson:gson:2.8.5'
//动态权限
implementation 'com.yanzhenjie:permission:2.0.0-rc5'
// implementation 'com.github.bumptech.glide:glide:4.8.0'
//二维码生成
implementation 'com.google.zxing:core:3.3.3'
// implementation 'com.google.zxing:android-core:3.3.0'
// implementation 'com.google.zxing:android-integration:3.3.0'
// implementation 'com.google.zxing:javase:3.3.3'
//调试日志打印
implementation 'com.github.zhaokaiqiang.klog:library:1.6.0'
// implementation files('libs/tbs_sdk_thirdapp_v3.6.0.1325_43613_sharewithdownload_withoutGame_obfs_20180807_151115.jar')

//本地存储调试工具:数据库、偏好文件
debugImplementation 'com.facebook.stetho:stetho:1.5.0'
debugImplementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
//RecyclerView辅助工具库
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.38'
implementation 'com.android.support:cardview-v7:27.1.1'

//数据库
// Room components
implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
// Lifecycle components
implementation "android.arch.lifecycle:extensions:1.1.1"
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "7726c27f3d7a40caf099b770ba58e8d4",
"entities": [
{
"tableName": "VipApiUrl",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT, `status` INTEGER NOT NULL, `createTime` INTEGER NOT NULL, `updateTime` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "status",
"columnName": "status",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "createTime",
"columnName": "createTime",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "updateTime",
"columnName": "updateTime",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"7726c27f3d7a40caf099b770ba58e8d4\")"
]
}
}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
<activity
android:name=".activities.BaiduActivity"
android:label="@string/title_activity_baidu"
android:theme="@style/AppTheme.NoActionBar"></activity>
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".activities.ApiManageActivity"></activity>
</application>

</manifest>
37 changes: 37 additions & 0 deletions app/src/main/assets/webpage/fileChooser.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,maximun-scale=1,mininum-scsle=1,user-scale=1">
<title>file chooser</title>
<style>
.filechooser{
width:95%;
height: 50px;
-webkit-background-clip: border-box;

}
</style>
<script >
var display=function (){
var path=document.getElementById("file_chooser").textContent;
document.getElementById("filechooser_display").innerHTML("<b>"+path+"</b>");
}
</script>
</head>
<body>
<ul class="listview">
<li class="listviewItem">
<fieldset class="itemset">
<input class="filechooser" id="file_chooser" type="file" placeholder="file path" onchange="display()" oninput="display()"><br>
<p id="filechooser_display"></p>
<div class="line_black"></div>

</fieldset>
</li>

</ul>

</body>

</html>
52 changes: 52 additions & 0 deletions app/src/main/assets/webpage/fullscreenVideo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, maximum-scale=1, minimum-scale=1, user-scale=1">
<title></title>
<style type="text/css" rel="stylesheet">
.line{
width:100%;
background: #000000;
height: 1px;
margin-top: 5px;
margin-bottom: 5px;
}
</style>
</head>
<body>
<video style="width:100%; height: auto;" controls>
<source src=http://125.64.133.74/data9/userfiles/video02/2014/12/11/2796948-280-068-1452.mp4 >
</video>
<div style="width:100%;height: 25px;"></div>
<button onclick="click_x5()" style="width:50%;height: 50px; float: left"> x5模式全屏</button>
<button onclick="click_normal()" style="width:50%;height: 50px;"> 普通模式全屏</button>
<div class="line"></div>
<button onclick="click_LiteWnd()" style="width:50%;height: 50px; float: left"> 小窗模式</button>
<button onclick="click_normal()" style="width:50%;height: 50px;"> 关闭小窗模式</button>
<div class="line"></div>
<button onclick="click_PageVideo()" style="width:50%;height: 50px; float: left"> 页面内全屏</button>
<button onclick="click_normal()" style="width:50%;height: 50px;"> 关闭页面内全屏</button>
</body>


<script type="text/javascript" >
function click_x5 (){
Android.onX5ButtonClicked();
location.reload(false);

}
function click_normal(){
Android.onCustomButtonClicked();
location.reload(false);
}
function click_LiteWnd(){
Android.onLiteWndButtonClicked();
location.reload(false);
}
function click_PageVideo(){
Android.onPageVideoClicked();
location.reload(false);
}
</script>
</html>
21 changes: 21 additions & 0 deletions app/src/main/assets/webpage/hitTestResult.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" context="width=device-width, maximum-scale=1, minimum-scale=0.5, user-scale=no">
<title><h2>请长按一下html元素</h2></title>
<style type="text/css" rel="stylesheet">
h2,p,input{
font-size: 50px;
}
</style>
</head>
<body>
<h2>请长按一下html元素</h2><br>
<p style="width:100%;">hello world!</p><br>
<input style="width: 100%;" placeholder="文本编辑区" type="text"><br>
<img src="image/nearly.png" style="width: 100% ; height: auto;" ><br>


</body>
</html>
34 changes: 34 additions & 0 deletions app/src/main/assets/webpage/websocket.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h3>WebSocket 测试</h3>
<p id="result"></p>
</body>

<script type="text/javascript">
var my_websocket = new WebSocket("ws://127.0.0.1:55555");
var result = document.getElementById("result");

if(!my_websocket){
result.innerHTML += "无法创建websocket实例<br>";
window.console.log("websocket can not be created!");
}else{
window.console.log("websocket create success!");
}

my_websocket.onerror = function(){
result.innerHTML+="websocket连接失败<br>";
}
my_websocket.onclose = function(){
result.innerHTML+="websocket 关闭<br>";
}

my_websocket.onmessage = function(event){
result.innerHTML+="收到数据:"+event.data+" <br>";
}
</script>
</html>
19 changes: 19 additions & 0 deletions app/src/main/java/group/tonight/vipvideohelper/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

import android.app.Application;

import com.facebook.stetho.Stetho;

import java.util.concurrent.TimeUnit;

import group.tonight.vipvideohelper.dao.AppRoomDatabase;
import group.tonight.vipvideohelper.other.CrashHandler;
import group.tonight.vipvideohelper.other.PrefUtils;
import okhttp3.OkHttpClient;
Expand All @@ -14,13 +17,29 @@ public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
Stetho.initializeWithDefaults(this);
AppRoomDatabase.init(this);
CrashHandler.getInstance().init(this);
PrefUtils.init(this);
okHttpClient = new OkHttpClient.Builder()
.connectTimeout(2000, TimeUnit.MILLISECONDS)
.readTimeout(2000, TimeUnit.MILLISECONDS)
.writeTimeout(2000, TimeUnit.MILLISECONDS)
.build();
//搜集本地tbs内核信息并上报服务器,服务器返回结果决定使用哪个内核。
// QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
// @Override
// public void onViewInitFinished(boolean arg0) {
// //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。
// Log.d("app", " onViewInitFinished is " + arg0);
// }
//
// @Override
// public void onCoreInitFinished() {
// }
// };
// //x5内核初始化接口
// QbSdk.initX5Environment(getApplicationContext(), cb);
}

public static OkHttpClient getOkHttpClient() {
Expand Down
Loading

0 comments on commit 1657b53

Please sign in to comment.