Skip to content

Add Base64 compat helper - #9

Open
wemotion-team wants to merge 2 commits into
Malik12tree:mainfrom
wemotion-team:feature/base64-compat
Open

Add Base64 compat helper#9
wemotion-team wants to merge 2 commits into
Malik12tree:mainfrom
wemotion-team:feature/base64-compat

Conversation

@wemotion-team

Copy link
Copy Markdown

Android Base64 Compatibility

  • Add decodeBase64Compat inside CapacitorThermalPrinterPlugin that prefers java.util.Base64 on API 26+ and falls back to android.util.Base64 below that, so Android 7 devices can still decode print payloads.
  • Update image and raw handlers to use the helper, removing API-level annotations/imports tied to java.util.Base64.

Copilot AI review requested due to automatic review settings November 18, 2025 16:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds backward compatibility for Base64 decoding to support Android 7 (API < 26) devices by introducing a compatibility helper method that switches between java.util.Base64 (API 26+) and android.util.Base64 (older versions).

Key Changes:

  • Added decodeBase64Compat helper method that handles API level branching for Base64 decoding
  • Updated image and raw methods to use the compatibility helper instead of java.util.Base64
  • Removed @RequiresApi annotations and java.util.Base64 import that were tying the code to API 26+

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…rThermalPrinterPlugin.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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