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

bug: App crashes when a corrupted zip file is provided for download #525

Open
suresh-payjustnow opened this issue Jan 22, 2025 · 0 comments

Comments

@suresh-payjustnow
Copy link

Bug Report

Capacitor Version

Latest Dependencies:

@capacitor/cli: 6.2.0
@capacitor/core: 6.2.0
@capacitor/android: 6.2.0
@capacitor/ios: 6.2.0

Installed Dependencies:

@capacitor/core: 6.2.0
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2
@capacitor/cli: 6.2.0

[success] iOS looking great! 👌
[success] Android looking great!

Plugin Version

│
▲   💊   Capgo Doctor  💊
│
●   App Name: PayJustNow
│
●   App ID: com.payjustnow
│
●   App Version: 2.6.6
│
●   Web Dir: dist
│
●   OS: darwin Darwin Kernel Version 24.1.0: Thu Oct 10 21:05:14 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8103
│
●   Node: v21.3.0
│
●   Installed Dependencies:
│
●     @capgo/cli: 4.30.9
│
◇  Latest Dependencies:
│
●     @capgo/cli: 4.30.9
◆  ✅ All dependencies are up to date

context(s)

ManualModel: false
AutoMode: false
CapgoCloud: false
OnPremise: false

Platform(s)

Android

Current Behavior

When the app attempts to download and process a corrupted zip file using the download function, it crashes unexpectedly. Upon investigation, we found that the issue originates in the following block of code:

File: CapacitorUpdater.java
Line: 333
Function: CryptoCipherV2.decryptFile

The current implementation only catches IOException. If we extend the catch block to handle Exception e, the error is caught, and the app can gracefully handle the failure by displaying a failed message instead of crashing.

Steps to Reproduce:

Provide a corrupted zip file to the download function.
Observe the app behavior—crashes without error handling.

Expected Behavior

The app should not crash. Instead, it should catch the exception, log the error, and continue with a failed message.

Proposed Solution:

try {
// Current decryption logic
} catch (IOException e) {
// Existing handling for IO exceptions
} catch (Exception e) {
// New catch block to handle other exceptions gracefully
e.printStackTrace();

}

Other Technical Details

npm --version output:10.2.4

node --version output: v21.3.0

pod --version output (iOS issues only): 1.15.2

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

No branches or pull requests

1 participant