Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5a96463
feat: 升级sdk35
goweii Jun 17, 2025
d9b1c1b
feat: l10n模块
goweii Jun 18, 2025
915116c
feat: 提取strings文件
goweii Jun 18, 2025
c5dfb61
feat: 翻译多语言
goweii Jun 18, 2025
d38aee3
feat: 适配rtl
goweii Jun 18, 2025
2b5f5f0
feat: 新增语言选择页面
goweii Jun 18, 2025
836864c
fix: 修复一些显示问题
goweii Jun 18, 2025
1ec22f8
fix: 修复一些显示问题
goweii Jun 18, 2025
e6c62ad
fix: 修复一些显示问题
goweii Jun 18, 2025
6d6fbf6
build: 更新版本2.3.0
goweii Jun 18, 2025
52ee87d
feat: 新增google play渠道包,因为per和com渠道的包名在google play都被占用了
goweii Jun 18, 2025
f8129c1
feat: google play屏蔽应用内版本更新
goweii Jun 18, 2025
3d167d4
feat: 移除tbs
goweii Jun 19, 2025
fa09328
fix: 修复%转义
goweii Jun 19, 2025
02ad204
feat: 适配网页暗色模式
goweii Jun 19, 2025
48dd377
feat: 自定义webview滚动监听
goweii Jun 19, 2025
73cd300
feat: 移除切换主题模式重启app
goweii Jun 20, 2025
d1f9eb5
feat: 优化代码
goweii Jun 20, 2025
9fdf842
feat: 主题和语言切换动画
goweii Jun 20, 2025
9fcc08f
fix: 主题bug
goweii Jun 21, 2025
fb1e68e
feat: 移除bugly
goweii Jun 21, 2025
324e498
fix: 修复sdk35语言页面崩溃bug
goweii Jun 22, 2025
0157662
feat: 添加广告
goweii Jun 22, 2025
cc734d0
fix: 处理部分页面导航栏遮挡问题
goweii Jun 22, 2025
bc65327
build: 更新swipeback
goweii Jun 23, 2025
1b2cdf1
feat: 更新eventbus
goweii Jun 24, 2025
5252016
feat: 移除文章列表广告
goweii Jun 26, 2025
d9156dc
fix: 修复文章列表副标题显示问题
goweii Jun 26, 2025
9481a1f
fix: 修复bug
goweii Aug 30, 2025
b693d5d
build: 升级版本号
goweii Aug 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
app/release/
app/com/
app/per/
app/googlePlay/
*.apk
*.ap_

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## 2.3.0(83)

- 【新增】新增英/法/俄/西班牙/阿拉伯语

## 2.2.9(82)

- 【优化】优化使用体验
Expand Down
12 changes: 9 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ apply from: "${rootDir.path}/gradle/module.gradle"
apply from: "${rootDir.path}/gradle/flavor.gradle"

android {
namespace "per.goweii.wanandroid"
defaultConfig {
renderscriptTargetApi rootProject.ext.android.minSdkVersion
renderscriptSupportModeEnabled true
Expand All @@ -17,7 +18,13 @@ android {
}
}
}
lint {
disable "NullSafeMutableLiveData"
}
resourcePrefix ""
androidResources {
generateLocaleConfig true
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionName = variant.versionName
Expand Down Expand Up @@ -53,10 +60,8 @@ dependencies {
implementation rootProject.ext.dependencies.swipelayout
implementation rootProject.ext.dependencies.disklrucache
implementation rootProject.ext.dependencies.multiStateView
implementation rootProject.ext.dependencies.buglyCrashreport
implementation rootProject.ext.dependencies.buglyNativeCrashreport
implementation rootProject.ext.dependencies.heartView
implementation rootProject.ext.dependencies.tbs
// implementation rootProject.ext.dependencies.tbs
implementation rootProject.ext.dependencies.webkit
implementation rootProject.ext.dependencies.photoView
implementation rootProject.ext.dependencies.roomRuntime
Expand All @@ -76,4 +81,5 @@ dependencies {
implementation rootProject.ext.dependencies.cropImageView
implementation rootProject.ext.dependencies.biometric
implementation 'com.github.donkingliang:ConsecutiveScroller:4.6.4'
implementation project(':component:ad')
}
47 changes: 41 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="per.goweii.wanandroid">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<uses-permission
android:name="${REQUEST_INSTALL_PACKAGES_PERMISSION}"
tools:node="replace" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission
android:name="android.permission.READ_LOGS"
Expand All @@ -20,7 +25,7 @@
android:name=".common.WanApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/label"
android:label="@string/app_label"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
Expand All @@ -40,6 +45,7 @@
<activity
android:name=".module.main.activity.RouterActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/AppTheme.Router">
<intent-filter>
Expand All @@ -48,7 +54,9 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data
android:scheme="https"
tools:ignore="AppLinkUrlError" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
Expand All @@ -69,6 +77,7 @@
<activity
android:name=".module.main.activity.MainActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:exported="true"
android:theme="@style/AppTheme.Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -79,6 +88,7 @@
android:name=".module.main.activity.theme.MainActivityRed"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_red"
android:roundIcon="@mipmap/ic_launcher_red_round"
android:theme="@style/AppTheme.Main.Red">
Expand All @@ -91,6 +101,7 @@
android:name=".module.main.activity.theme.MainActivityGreen"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_green"
android:roundIcon="@mipmap/ic_launcher_green_round"
android:theme="@style/AppTheme.Main.Green">
Expand All @@ -103,6 +114,7 @@
android:name=".module.main.activity.theme.MainActivityPink"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_pink"
android:roundIcon="@mipmap/ic_launcher_pink_round"
android:theme="@style/AppTheme.Main.Pink">
Expand All @@ -115,6 +127,7 @@
android:name=".module.main.activity.theme.MainActivityGold"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_launcher_gold"
android:roundIcon="@mipmap/ic_launcher_gold_round"
android:theme="@style/AppTheme.Main.Gold">
Expand Down Expand Up @@ -190,7 +203,7 @@
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation" />
<activity
android:name=".module.mine.activity.SettingActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation|uiMode" />
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation" />
<activity
android:name=".module.mine.activity.AboutActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation" />
Expand All @@ -217,6 +230,15 @@
android:name=".module.book.activity.BookDetailsActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".module.mine.activity.LanguageActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation"
android:windowSoftInputMode="adjustResize" />
<activity
android:name=".utils.recreate_anim.RecreateAnimActivity"
android:configChanges="keyboard|keyboardHidden|screenSize|fontScale|density|orientation|uiMode|locale|screenLayout|colorMode|layoutDirection|smallestScreenSize|fontWeightAdjustment|grammaticalGender|navigation|mnc|mcc|touchscreen"
android:theme="@style/AppTheme.RecreateAnim"
android:windowSoftInputMode="adjustNothing" />

<provider
android:name="androidx.core.content.FileProvider"
Expand All @@ -227,6 +249,19 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_path" />
</provider>

<service
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
android:enabled="false"
android:exported="false">
<meta-data
android:name="autoStoreLocales"
android:value="true" />
</service>

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="${GOOGLE_AD_APP_ID}" />
</application>

</manifest>
74 changes: 6 additions & 68 deletions app/src/main/java/per/goweii/wanandroid/common/InitTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@ import android.app.Application
import android.os.Bundle
import com.scwang.smart.refresh.footer.ClassicsFooter
import com.scwang.smart.refresh.layout.SmartRefreshLayout
import com.tencent.bugly.crashreport.CrashReport
import com.tencent.bugly.crashreport.CrashReport.CrashHandleCallback
import com.tencent.bugly.crashreport.CrashReport.UserStrategy
import com.tencent.smtt.sdk.QbSdk
import com.tencent.smtt.sdk.QbSdk.PreInitCallback
import com.tencent.smtt.sdk.WebView
import per.goweii.basic.core.CoreInit
import per.goweii.basic.utils.AsyncInitTask
import per.goweii.basic.utils.DebugUtils
import per.goweii.basic.utils.LogUtils
import per.goweii.basic.utils.SyncInitTask
import per.goweii.basic.utils.listener.SimpleCallback
import per.goweii.burred.Blurred
import per.goweii.ponyo.crash.Crash
import per.goweii.rxhttp.core.RxHttp
import per.goweii.swipeback.SwipeBack
import per.goweii.swipeback.SwipeBackDirection
import per.goweii.wanandroid.BuildConfig
import per.goweii.wanandroid.db.WanDb
import per.goweii.wanandroid.http.RxHttpRequestSetting
import per.goweii.wanandroid.http.WanCache
import per.goweii.wanandroid.module.main.activity.CrashActivity
import per.goweii.wanandroid.utils.*
import per.goweii.wanandroid.utils.ConfigUtils
import per.goweii.wanandroid.utils.CookieUtils
import per.goweii.wanandroid.utils.DarkModeUtils
import per.goweii.wanandroid.utils.GrayFilterHelper
import per.goweii.wanandroid.utils.UserUtils
import per.goweii.wanandroid.utils.web.cache.ReadingModeManager
import per.goweii.wanandroid.widget.refresh.ShiciRefreshHeader
import java.util.*

/**
* @author CuiZhen
Expand Down Expand Up @@ -68,7 +62,7 @@ class CookieManagerInitTask : SyncInitTask() {

class NightModeInitTask : SyncInitTask() {
override fun init(application: Application) {
DarkModeUtils.initDarkMode()
DarkModeUtils.initDarkMode(application)
}

override fun onlyMainProcess(): Boolean {
Expand Down Expand Up @@ -237,28 +231,6 @@ class CrashInitTask : SyncInitTask() {
}
}

class X5InitTask : AsyncInitTask() {
override fun init(application: Application) {
QbSdk.initX5Environment(application, object : PreInitCallback {
override fun onCoreInitFinished() {
LogUtils.d("x5", "initX5Environment->onCoreInitFinished")
}

override fun onViewInitFinished(b: Boolean) {
LogUtils.d("x5", "initX5Environment->onViewInitFinished=$b")
}
})
}

override fun onlyMainProcess(): Boolean {
return false
}

override fun level(): Int {
return 0
}
}

class ReadingModeTask : AsyncInitTask() {
override fun init(application: Application) {
ReadingModeManager.setup()
Expand All @@ -268,40 +240,6 @@ class ReadingModeTask : AsyncInitTask() {
return true
}

override fun level(): Int {
return 3
}
}

class BuglyInitTask : SyncInitTask() {
override fun init(application: Application) {
if (DebugUtils.isDebug()) return
CrashReport.setIsDevelopmentDevice(application, DebugUtils.isDebug())
val strategy = UserStrategy(application)
strategy.setCrashHandleCallback(object : CrashHandleCallback() {
override fun onCrashHandleStart(crashType: Int, errorType: String, errorMessage: String, errorStack: String): Map<String, String> {
val map = LinkedHashMap<String, String>()
val x5CrashInfo = WebView.getCrashExtraMessage(application)
map["x5crashInfo"] = x5CrashInfo
return map
}

override fun onCrashHandleStart2GetExtraDatas(crashType: Int, errorType: String, errorMessage: String, errorStack: String): ByteArray? {
return try {
"Extra data.".toByteArray(charset("UTF-8"))
} catch (e: Exception) {
null
}
}
})
strategy.isUploadProcess = WanApp.isMainProcess()
CrashReport.initCrashReport(application, BuildConfig.APPID_BUGLY, DebugUtils.isDebug(), strategy)
}

override fun onlyMainProcess(): Boolean {
return false
}

override fun level(): Int {
return 3
}
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/per/goweii/wanandroid/common/WanApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public void onCreate() {
.add(new WanDbInitTask())
.add(new WanCacheInitTask())
.add(new BlurredInitTask())
.add(new X5InitTask())
.add(new BuglyInitTask())
.add(new CrashInitTask())
.add(new ReadingModeTask())
.run();
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/per/goweii/wanandroid/http/WanCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void init() {

public static WanCache getInstance() {
if (INSTANCE == null) {
throw new RuntimeException("WanCache未初始化");
throw new RuntimeException("WanCache is not initialized");
}
return INSTANCE;
}
Expand All @@ -60,7 +60,7 @@ private WanCache() {

private DiskLruCache getDiskLruCache() {
if (mDiskLruCache == null) {
throw new RuntimeException("WanCache未初始化或初始化失败");
throw new RuntimeException("WanCache is not initialized");
}
return mDiskLruCache;
}
Expand Down
Loading
Loading