Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on alpn index ServerActivity #4326

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Conversation

hossinasaadi
Copy link
Contributor

Utils.arrayFind() in some cases return -1 and it will crash on some devices.

val utlsIndex = sp_stream_fingerprint?.selectedItemPosition ?: 0
val alpnIndex = sp_stream_alpn?.selectedItemPosition ?: 0

config.alpn = alpns[alpnIndex]
config.publicKey = publicKey

Copy link
Contributor

@Alphax-Hue3682 Alphax-Hue3682 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.fingerPrint?.let {
val utlsIndex = Utils.arrayFind(uTlsItems, it)
sp_stream_fingerprint?.run { setSelection(if (utlsIndex >= 0) utlsIndex else 0) }
}

config.alpn?.let {
val alpnIndex = Utils.arrayFind(alpns, it)
sp_stream_alpn?.run { setSelection(if (alpnIndex >= 0) alpnIndex else 0) }
}

@2dust 2dust merged commit d166b03 into 2dust:master Feb 11, 2025
1 check passed
Alphax-Hue3682 added a commit to Alphax-Hue3682/v2rayNG that referenced this pull request Feb 11, 2025
@Alphax-Hue3682
Copy link
Contributor

Hello, there is a problem that before, when someone pr, he could find out whether the build apk was made correctly or not. Now, in the repo or fork of anyone who coit, because of this error, Run timheuer/base64-to-file@v1 with: fileName: android_keystore.jks Env: CURRENT_TAG: v25.2.9 JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.6-7/x64 JAVA_HOME_21_X64: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.6-7/x64 ANDROID_HOME: /usr/local/lib/android/sdk ANDROID_SDK_ROOT: /usr/local/lib/android/sdk Error: encodedString value is not set, it is not possible to properly check your pr for building, so if possible, do something like before so that you can check build apk when building pr
@2dust

@hossinasaadi hossinasaadi deleted the patch-2 branch February 11, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants