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 missing FirewallPolicyError class crash #5454

Merged

Conversation

Pururun
Copy link
Contributor

@Pururun Pururun commented Nov 17, 2023

Also as a bonus fixes missing html support for notification banner message which causes <b> to appear when showing the Always on VPN error banner.


This change is Reviewable

Copy link

linear bot commented Nov 17, 2023

DROID-505 Crash when getting Firewall policy error

Steps to reproduce:

  1. Install two versions of Mullvad VPN
  2. Set one as Always-on VPN and Block connections without VPN
  3. Connect and disconnect in both apps
  4. Eventually the app will crash with the following error:
java.lang.ClassNotFoundException: Didn't find class "net.mullvad.talpid.tunnel.FirewallPolicyError" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib64, /system_ext/lib64, /system/lib64, /system_ext/lib64]]

This crash on Google Play might be related:

https://play.google.com/console/u/0/developers/5618373881393887405/app/4974409703413736415/vitals/crashes/4835e7b4f3849c81a82428227442a9c4/details?days=28

@Pururun Pururun self-assigned this Nov 17, 2023
@Pururun Pururun added the Android Issues related to Android label Nov 17, 2023
Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)


android/lib/talpid/src/main/kotlin/net/mullvad/talpid/tunnel/FirewallPolicyError.kt line 8 at r1 (raw file):

@Parcelize
enum class FirewallPolicyError : Parcelable {
    Generic

Is this the only possible enum type that they can send?

Code quote:

Generic

Copy link
Contributor Author

@Pururun Pururun left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @albin-mullvad)


android/lib/talpid/src/main/kotlin/net/mullvad/talpid/tunnel/FirewallPolicyError.kt line 8 at r1 (raw file):

Previously, albin-mullvad wrote…

Is this the only possible enum type that they can send?

Yes there is another type that one is windows only.

pub enum FirewallPolicyError {
    /// General firewall failure
    #[error(display = "Failed to set firewall policy")]
    Generic,
    /// An application prevented the firewall policy from being set
    #[cfg(windows)]
    #[error(display = "An application prevented the firewall policy from being set")]
    Locked(Option<BlockingApplication>),
}

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Pururun)


android/lib/talpid/src/main/kotlin/net/mullvad/talpid/tunnel/FirewallPolicyError.kt line 8 at r1 (raw file):

Previously, Pururun (Jonatan Rhodin) wrote…

Yes there is another type that one is windows only.

pub enum FirewallPolicyError {
    /// General firewall failure
    #[error(display = "Failed to set firewall policy")]
    Generic,
    /// An application prevented the firewall policy from being set
    #[cfg(windows)]
    #[error(display = "An application prevented the firewall policy from being set")]
    Locked(Option<BlockingApplication>),
}

Perfect! 👍

Copy link
Collaborator

@albin-mullvad albin-mullvad left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@albin-mullvad albin-mullvad force-pushed the crash-when-getting-firewall-policy-error-droid-505 branch from ef67779 to 679cb91 Compare November 17, 2023 13:59
@albin-mullvad albin-mullvad merged commit e45003f into main Nov 17, 2023
28 checks passed
@albin-mullvad albin-mullvad deleted the crash-when-getting-firewall-policy-error-droid-505 branch November 17, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues related to Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants