Skip to content

Commit

Permalink
1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbxyyx committed Apr 19, 2024
1 parent 39a7747 commit ba5219f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
11 changes: 3 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.github.jsbxyyx.xbook"
minSdk 27
targetSdk 33
versionCode 10
versionName "1.0"
versionCode 11
versionName "1.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -33,8 +33,6 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
Expand All @@ -45,9 +43,6 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
implementation 'com.squareup.picasso:picasso:2.8'

implementation 'org.nanohttpd:nanohttpd:2.3.1'

debugImplementation 'org.mozilla.geckoview:geckoview-nightly:120.0.20231006092133'
releaseImplementation 'org.mozilla.geckoview:geckoview-nightly-armeabi-v7a:120.0.20231006092133'
implementation 'org.mozilla.geckoview:geckoview-nightly:100.0.20220404093932'
}
2 changes: 2 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,6 @@
-dontwarn com.squareup.okhttp3.**
-keep class com.squareup.okhttp3.** { *;}
-dontwarn okio.**
# geckoview
-keep class org.mozilla.geckoview.** { *; }

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class VideoViewActivity2 extends AppCompatActivity {

private GeckoView webView;
private String playUrl;
private static GeckoRuntime runtime;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -27,15 +28,15 @@ protected void onCreate(Bundle savedInstanceState) {

webView = findViewById(R.id.wv_video_view);
GeckoSession session = new GeckoSession();
GeckoRuntime runtime = GeckoRuntime.create(this);
if (runtime == null) {
runtime = GeckoRuntime.create(this);
}
session.open(runtime);
webView.setSession(session);

try {
LogUtil.d(getClass().getSimpleName(), "ua: %s", webView.getSession().getUserAgent().poll());
} catch (Throwable e) {
LogUtil.e(getClass().getSimpleName(), "%s", e);
}
webView.getSession().getUserAgent().accept((a) -> {
LogUtil.d(getClass().getSimpleName(), "ua: %s", a);
});

session.loadUri(playUrl);
}
Expand All @@ -44,7 +45,7 @@ protected void onCreate(Bundle savedInstanceState) {
protected void onDestroy() {
super.onDestroy();
if (webView != null) {
webView.destroyDrawingCache();
webView.releaseSession().close();
}
}
}

0 comments on commit ba5219f

Please sign in to comment.