Compare commits

..

5 Commits

Author SHA1 Message Date
2dust
cbe6c1e3e0 Update build.gradle 2022-09-19 20:25:48 +08:00
2dust
3cd6f12b94 Merge pull request #1639 from zhaoguomanong/master
fix NullPointerException
2022-09-10 19:51:19 +08:00
zhaoguomanong
516235cd6a fix NullPointerException
复现方法:
添加两个订阅A, B -> 选择A中任意节点并启动 -> 删除A订阅, 选中B订阅中任意节点启动 -> crash

09-09 10:53:50.355 18739 18739 D AndroidRuntime: Shutting down VM
09-09 10:53:50.356 18739 18739 E AndroidRuntime: FATAL EXCEPTION: main
09-09 10:53:50.356 18739 18739 E AndroidRuntime: Process: com.v2ray.ang, PID: 18739
09-09 10:53:50.356 18739 18739 E AndroidRuntime: java.lang.NullPointerException
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at com.v2ray.ang.ui.MainRecyclerAdapter.onBindViewHolder$lambda-6(MainRecyclerAdapter.kt:156)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at com.v2ray.ang.ui.MainRecyclerAdapter.$r8$lambda$VmDbsAxtrWNiVtS0BmO3UDui2o4(Unknown Source:0)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at com.v2ray.ang.ui.MainRecyclerAdapter$$ExternalSyntheticLambda2.onClick(Unknown Source:4)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.view.View.performClick(View.java:6597)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.view.View.performClickInternal(View.java:6574)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.view.View.access$3100(View.java:778)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.view.View$PerformClick.run(View.java:25906)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:873)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6718)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
09-09 10:53:50.356 18739 18739 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Signed-off-by: zhaoguomanong <zhaoguomanong@gmail.com>
2022-09-09 13:12:15 +08:00
2dust
236923d0a0 Update build.gradle 2022-08-30 14:53:13 +08:00
2dust
a4816b8251 Update build.gradle 2022-08-30 14:53:06 +08:00
3 changed files with 19 additions and 18 deletions

View File

@@ -18,8 +18,8 @@ android {
minSdkVersion 21
targetSdkVersion Integer.parseInt("$targetSdkVer")
multiDexEnabled true
versionCode 472
versionName "1.7.18"
versionCode 473
versionName "1.7.20"
}
if (props["sign"]) {
@@ -112,15 +112,15 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.fragment:fragment-ktx:1.5.0'
implementation 'androidx.fragment:fragment-ktx:1.5.2'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
// Androidx ktx
implementation 'androidx.activity:activity-ktx:1.5.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.0'
implementation 'androidx.activity:activity-ktx:1.5.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
//kotlin
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
@@ -141,12 +141,11 @@ dependencies {
implementation 'com.blacksquircle.ui:language-json:2.1.1'
}
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
jcenter()
}
}
//buildscript {
// repositories {
// google()
// mavenCentral()
// maven { url 'https://maven.google.com' }
// maven { url 'https://jitpack.io' }
// }
//}

View File

@@ -2,6 +2,7 @@ package com.v2ray.ang.ui
import android.content.Intent
import android.graphics.Color
import android.text.TextUtils
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
@@ -153,7 +154,9 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
val selected = mainStorage?.decodeString(MmkvManager.KEY_SELECTED_SERVER)
if (guid != selected) {
mainStorage?.encode(MmkvManager.KEY_SELECTED_SERVER, guid)
notifyItemChanged(mActivity.mainViewModel.getPosition(selected!!))
if (!TextUtils.isEmpty(selected)) {
notifyItemChanged(mActivity.mainViewModel.getPosition(selected!!))
}
notifyItemChanged(mActivity.mainViewModel.getPosition(guid))
if (isRunning) {
mActivity.showCircle()

View File

@@ -6,7 +6,6 @@ buildscript {
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'