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

feat: Capacitor v5 upgrade, ionic v7 upgrade #3567

Merged
merged 9 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/appflow-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
build-type: development
certificate: Fyle signing
environment: staging
native-config: prod
native-config: staging
filename: ios.ipa

- name: Move ios.ipa to current directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-appflow-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
build-type: development
certificate: Fyle signing
environment: staging
native-config: prod
native-config: staging
filename: ios.ipa

- name: Move ios.ipa to current directory
Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ captures/
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/deploymentTargetSelector.xml
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
Expand Down
2 changes: 1 addition & 1 deletion android/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion android/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'

android {
namespace "com.ionicframework.fyle595781"
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.ionicframework.fyle595781"
Expand Down
6 changes: 3 additions & 3 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
Comment on lines +5 to +6
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

❓ Verification inconclusive

Java version upgraded to VERSION_17 with heroic flair!

Moving from Java 11 to Java 17 is like my entry in a blockbuster movie! Make sure your development environment is ready for this power-packed version. When Java 17 walks in, the bugs walk out!

Also verify your CI/CD pipeline is using JDK 17 for building the Android application. What's the use of power if the system can't handle it?


🏁 Script executed:

#!/bin/bash
# Check Java version in GitHub Actions workflow files

echo "Checking GitHub Actions workflow files for Java version..."
find .github/workflows -type f -name "*.yml" -o -name "*.yaml" | xargs grep -l "java" | xargs grep -n "java-version"

Length of output: 241


Attention, Brother! Ensure CI/CD Power-Up with JDK 17!

Your upgrade to JavaVersion.VERSION_17 in the gradle build is as stylish as a Rajinikanth entry—pure magic! However, our search through the GitHub Actions workflows didn’t reveal an explicit configuration setting for the JDK, and that's something to watch out for. Please manually verify that your CI/CD pipeline (for example, using actions/setup-java) is indeed configured to use JDK 17. If not explicitly set, the system might not bring the same blockbuster performance when Java 17 takes the stage.

  • Double-check your GitHub Actions workflow files in the .github/workflows directory.
  • Ensure that the setup with actions/setup-java (or an equivalent approach) specifies java-version: '17'.

Keep the power alive wherever you build; when Java 17 walks in, the bugs better walk out!

}
}

Expand All @@ -13,13 +13,13 @@ dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-browser')
implementation project(':capacitor-camera')
implementation project(':capacitor-clipboard')
implementation project(':capacitor-device')
implementation project(':capacitor-geolocation')
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-network')
implementation project(':capacitor-preferences')
implementation project(':capacitor-push-notifications')
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation project(':capacitor-text-zoom')
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?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="com.ionicframework.fyle595781">
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="false"
Expand Down Expand Up @@ -68,6 +67,7 @@
<!-- Camera, Photos, input file -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<!-- Geolocation API -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Expand Down
3 changes: 3 additions & 0 deletions android/app/src/main/assets/capacitor.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"accessOrigins": [
"https://app.fylehq.com"
]
},
"server": {
"androidScheme": "http"
}
Comment on lines +20 to 23
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

HTTP scheme can be security villain! Be careful!

Using "androidScheme": "http" is like fighting without weapons! In production, this could expose user data! HTTP is not secure like HTTPS. If this is for development only, no problem. But for production release, you should use HTTPS like how I use my signature moves - with full power and security!


🌐 Web query:

Is HTTP still considered secure for mobile applications in 2024?

💡 Result:

In 2024, HTTP is not considered secure for mobile applications due to its lack of encryption and vulnerability to data interception. Modern security standards and best practices mandate the use of HTTPS (HTTP Secure) with TLS/SSL encryption for all mobile app communications. Here's why:

Key Risks of Using HTTP

  1. Data Exposure:
    HTTP transmits data in plaintext, making it susceptible to eavesdropping on unsecured networks (e.g., public Wi-Fi). Attackers can intercept sensitive information like login credentials, payment details, or API keys[5][6][10].

  2. Man-in-the-Middle (MitM) Attacks:
    Without encryption, attackers can manipulate HTTP traffic to inject malicious code, redirect users, or steal session tokens[4][10].

  3. Regulatory Non-Compliance:
    Standards like GDPR, PCI-DSS, and industry guidelines (e.g., OWASP Mobile Top 10) require encrypted data transmission, making HTTP non-compliant[6][10].

Best Practices for Secure Communication

  1. Use HTTPS Everywhere:

    • All network requests (APIs, backend servers, third-party services) must use HTTPS to ensure end-to-end encryption[5][7][10].
    • Avoid mixed content (e.g., loading HTTP resources within HTTPS pages)[10].
  2. TLS 1.2/1.3 and Strong Cipher Suites:

    • Deprecated protocols (SSL 3.0, TLS 1.0/1.1) and weak ciphers (e.g., RC4, MD5) should be disabled[6][10].
    • Validate certificates from trusted Certificate Authorities (CAs) and reject self-signed, expired, or mismatched certificates[6][10].
  3. Certificate Pinning:

    • Implement certificate pinning to prevent MitM attacks via malicious proxies or compromised CAs[4][6].
    • Use dynamic pinning to update certificates without app redeployment[4].
  4. Additional Protections:

    • Encrypt sensitive data (e.g., passwords, tokens) before transmission, even over HTTPS[6][10].
    • Avoid alternate insecure channels like SMS/MMS for sensitive data[10].

Consequences of Ignoring HTTPS

  • Data Breaches: Unencrypted transmissions expose user data, leading to reputational damage and legal penalties[8][10].
  • App Store Rejection: Platforms like Google Play and Apple App Store require HTTPS for network traffic[5][10].
  • OWASP Mobile Top 10 Risks: Insecure communication (M3) and insufficient cryptography (M5) are critical vulnerabilities in 2024[4][10].

In summary, HTTP is obsolete for modern mobile app security. Developers must adopt HTTPS with robust encryption, certificate validation, and advanced safeguards like pinning to mitigate risks and comply with evolving standards[4][5][10].

Citations:


Attention: Secure Your App Like a True Superstar!

Hey my friend, just like my signature moves prevent any enemy from coming close, using HTTP in your configuration exposes your app to vulnerabilities. The web experts confirm that in 2024, HTTP is not secure for mobile communications—it’s like going into battle without your armor!

  • File: android/app/src/main/assets/capacitor.config.json (Lines 20-23)
  • Current Snippet:
      },
      "server": {
      	"androidScheme": "http"
      }
  • Recommendation:
    If this configuration is for development, it can stay as is. But for production, switch to HTTPS to safeguard user data from eavesdropping and attacks. Use HTTPS with TLS/SSL encryption—ensure your app fights with full power and all the security moves!

Please update accordingly, boss.

}
4 changes: 4 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"pkg": "@capacitor/camera",
"classpath": "com.capacitorjs.plugins.camera.CameraPlugin"
},
{
"pkg": "@capacitor/clipboard",
"classpath": "com.capacitorjs.plugins.clipboard.ClipboardPlugin"
},
{
"pkg": "@capacitor/device",
"classpath": "com.capacitorjs.plugins.device.DevicePlugin"
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/
include ':capacitor-camera'
project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/camera/android')

include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android')

include ':capacitor-device'
project(':capacitor-device').projectDir = new File('../node_modules/@capacitor/device/android')

Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Apr 23 20:33:12 IST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Gradle upgrade is a powerful leap forward, mind it!

The upgrade from Gradle 7.4.2 to 8.0.2 is like a hero's grand entrance! This change is necessary for Capacitor v5 compatibility, but remember: with great power comes great responsibility. This upgrade might introduce breaking changes in build scripts and plugins, so test thoroughly!

#!/bin/bash
# Check if any plugins or dependencies have compatibility issues with Gradle 8.0.2

# Look for deprecation warnings in build logs
./gradlew build --warning-mode=all | grep -i "deprecated"

# Check Android Gradle plugin compatibility
grep -r "com.android.tools.build:gradle" --include="*.gradle" .

distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
24 changes: 12 additions & 12 deletions android/variables.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ ext {
minSdkVersion = 24
compileSdkVersion = 33
targetSdkVersion = 34
androidxAppCompatVersion = '1.4.2'
androidxCoreVersion = '1.8.0'
androidxMaterialVersion = '1.6.1'
androidxBrowserVersion = '1.4.0'
androidxExifInterfaceVersion = '1.3.3'
playServicesLocationVersion = '20.0.0'
androidxAppCompatVersion = '1.6.1'
androidxCoreVersion = '1.10.0'
androidxMaterialVersion = '1.8.0'
androidxBrowserVersion = '1.5.0'
androidxExifInterfaceVersion = '1.3.6'
playServicesLocationVersion = '21.0.1'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.3'
androidxEspressoCoreVersion = '3.4.0'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
cordovaAndroidVersion = '10.1.1'
androidxActivityVersion = '1.4.0'
androidxActivityVersion = '1.7.0'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxFragmentVersion = '1.4.1'
coreSplashScreenVersion = '1.0.0-rc01'
androidxWebkitVersion = '1.4.0'
androidxFragmentVersion = '1.5.6'
coreSplashScreenVersion = '1.0.0'
androidxWebkitVersion = '1.6.1'
}
3 changes: 3 additions & 0 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const config: CapacitorConfig = {
//It doesn't matter what value is added to access origin - https://capacitorjs.com/docs/v2/cordova/using-cordova-plugins#:~:text=Capacitor%20does%20not%20support%20Cordova,things%20like%20hooks%20are%20unnecessary
accessOrigins: ['https://app.fylehq.com'],
},
server: {
androidScheme: 'http',
},
Comment on lines +23 to +25
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

💡 Verification agent

🧩 Analysis chain

Setting androidScheme to 'http' is like opening a door - mind who you let in!

This configuration allows HTTP connections on Android, which is sometimes necessary for development or certain API connections. However, this is like removing security from a bank vault!

In production builds, you should prefer 'https' for security unless you have specific reasons. If you're accessing non-secure endpoints, consider:

  1. Moving to secure endpoints if possible
  2. Adding network security configuration for Android to whitelist specific domains
  3. Documenting why this exception is necessary

Remember, in my world, "The safety of my users is my first priority!"


🏁 Script executed:

#!/bin/bash
# Check if network security is properly configured

echo "Checking for Network Security Configuration..."
if [ -f "android/app/src/main/res/xml/network_security_config.xml" ]; then
    echo "Network Security Config found. Examining contents:"
    cat android/app/src/main/res/xml/network_security_config.xml
else
    echo "Warning: No network_security_config.xml found. This might be necessary when using http scheme."
    echo "Consider adding one to safely define which domains can use non-secure connections."
fi

Length of output: 546


Secure Your Android Connection, Boss!

The current configuration uses:

server: {
  androidScheme: 'http',
},

While this might be acceptable during development, using HTTP in production is as risky as leaving your vault wide open! Our security check revealed that there's no android/app/src/main/res/xml/network_security_config.xml file. Without this configuration, you might be inviting unwanted guests into your app.

Please consider these actions:

  • Prefer HTTPS: Switch to 'https' in production builds whenever possible.
  • Add Network Security Config: If HTTP is necessary, create a network security configuration file in android/app/src/main/res/xml/network_security_config.xml to whitelist specific, trusted domains.
  • Document Your Reasons: Clearly document why the exception is needed, so that we understand the necessity behind using HTTP.

As I always say, "The safety of my users is my first priority!" Let's secure this door before it swings open to any mischief.

};

export default config;
2 changes: 1 addition & 1 deletion ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
App/build
App/Pods
App/App/public
App/Podfile.lock
App/output
DerivedData
xcuserdata

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
130 changes: 17 additions & 113 deletions ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,116 +1,20 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "[email protected]",
"scale" : "1x"
"images" : [
{
"filename" : "[email protected]",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "[email protected]",
"scale" : "1x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading