Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b92b0c3
Update workflows to run on development branch instead of flutter_app
samruddhi-Rahegaonkar Jun 18, 2025
e6430aa
Merge branch 'development' into development
samruddhi-Rahegaonkar Jun 18, 2025
6a4091a
feat: Add multiple badge Sizes
samruddhi-Rahegaonkar Jun 23, 2025
1ba24ff
resolved conflicts and added fetched upstream
samruddhi-Rahegaonkar Aug 29, 2025
9082861
fix: formatted file
samruddhi-Rahegaonkar Aug 29, 2025
a8c36d3
fix: updated test
samruddhi-Rahegaonkar Aug 29, 2025
fa53f47
fix: make the screensize selection less prominent
samruddhi-Rahegaonkar Aug 29, 2025
d1e72e9
fix: updated UI for screensize selection
samruddhi-Rahegaonkar Aug 29, 2025
115a8d0
fix: formated file
samruddhi-Rahegaonkar Aug 29, 2025
61815a9
updated the UI accordingly
samruddhi-Rahegaonkar Aug 30, 2025
4dc91fa
fix: added dialog for screen size while saving
samruddhi-Rahegaonkar Aug 30, 2025
4b84300
fix: added seamless screensize selection throughout app
samruddhi-Rahegaonkar Aug 31, 2025
0d055a6
fix: formated files
samruddhi-Rahegaonkar Aug 31, 2025
a4ff1ca
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Aug 31, 2025
63798ad
Merge branch 'development' into issue1344
mariobehling Sep 1, 2025
b2bfdc8
Merge branch 'development' into issue1344
mariobehling Sep 1, 2025
19a31a9
fix: added upstream
samruddhi-Rahegaonkar Sep 3, 2025
06ef264
fix: the failing build
samruddhi-Rahegaonkar Sep 4, 2025
c2c110a
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Sep 4, 2025
8bbcae7
fix: reduced the extra white space, added error for unequal screens
samruddhi-Rahegaonkar Sep 5, 2025
17a40aa
fix: fixed the character spacing
samruddhi-Rahegaonkar Sep 5, 2025
35f05f0
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Sep 5, 2025
c759e6b
fix: resolved conflicts and formatted files
samruddhi-Rahegaonkar Sep 5, 2025
87c5fc9
fix: failing screenshots
samruddhi-Rahegaonkar Sep 5, 2025
d048fd6
fix: increase font size little bit of select screen size
samruddhi-Rahegaonkar Sep 5, 2025
26f9101
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Sep 5, 2025
d896b84
fix: made a screensize widget more hugged to the badge
samruddhi-Rahegaonkar Sep 7, 2025
6e5d9ec
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Sep 8, 2025
e21d864
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Sep 9, 2025
f1308e8
fix: added required parameter
samruddhi-Rahegaonkar Sep 9, 2025
11d998a
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Sep 18, 2025
b5849af
fix: resolved conflicts but the font rendering has issues
samruddhi-Rahegaonkar Sep 18, 2025
1eb5a0e
fix: message renders according to selected size
samruddhi-Rahegaonkar Sep 19, 2025
fa750a7
fix: added the font related logic still there are some flaws
samruddhi-Rahegaonkar Sep 19, 2025
76b4207
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Sep 26, 2025
54620d1
resolved conflcits
samruddhi-Rahegaonkar Sep 26, 2025
939d799
Merge branch 'development' into issue1344
samruddhi-Rahegaonkar Oct 13, 2025
7387ada
resolved conflicts
samruddhi-Rahegaonkar Oct 13, 2025
9900c17
Update lib/virtualbadge/view/draw_badge.dart
samruddhi-Rahegaonkar Oct 14, 2025
f41eb8b
Update lib/view/homescreen.dart
samruddhi-Rahegaonkar Oct 14, 2025
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
172 changes: 24 additions & 148 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ env:
ANDROID_EMULATOR_ARCH: x86_64
IPHONE_DEVICE_MODEL: iPhone 16 Pro Max
IPAD_DEVICE_MODEL: iPad Pro 13-inch (M4)
BARECHECK_GITHUB_APP_TOKEN: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }}
ENCRYPTED_F10B5E0E5262_IV: ${{ secrets.ENCRYPTED_F10B5E0E5262_IV }}
ENCRYPTED_F10B5E0E5262_KEY: ${{ secrets.ENCRYPTED_F10B5E0E5262_KEY }}
ENCRYPTED_IOS_IV: ${{ secrets.ENCRYPTED_IOS_IV }}
ENCRYPTED_IOS_KEY: ${{ secrets.ENCRYPTED_IOS_KEY }}
STORE_PASS: ${{ secrets.STORE_PASS }}
ALIAS: ${{ secrets.ALIAS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}

jobs:
common:
Expand All @@ -19,7 +29,7 @@ jobs:
VERSION_NAME: ${{ steps.flutter-version.outputs.VERSION_NAME }}
VERSION_CODE: ${{ steps.flutter-version.outputs.VERSION_CODE }}
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4

- name: Common Workflow
uses: ./.github/actions/common
Expand Down Expand Up @@ -71,7 +81,7 @@ jobs:
needs: common
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4

- name: Prepare Build Keys
if: ${{ github.repository == 'fossasia/badgemagic-app' }}
Expand Down Expand Up @@ -121,8 +131,8 @@ jobs:

echo "Copying new build files"

find ../build/app/outputs/flutter-apk -type f \( -name '*release.apk' -o -name '*release.aab' \) -exec cp -v {} . \;
find ../build/app/outputs/bundle -type f \( -name '*release.apk' -o -name '*release.aab' \) -exec cp -v {} . \;
find ../build/app/outputs/flutter-apk -type f \( -name '*.apk' -o -name '*.aab' \) -exec cp -v {} . \;
find ../build/app/outputs/bundle -type f \( -name '*.apk' -o -name '*.aab' \) -exec cp -v {} . \;

ls

Expand Down Expand Up @@ -163,7 +173,7 @@ jobs:
with:
xcode-version: latest-stable

- uses: actions/checkout@v5
- uses: actions/checkout@v4

- name: Prepare Build Keys
if: ${{ github.repository == 'fossasia/badgemagic-app' }}
Expand Down Expand Up @@ -207,7 +217,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download repository
uses: actions/checkout@v5
uses: actions/checkout@v4

- name: Run Release Drafter
id: run-release-drafter
Expand All @@ -226,162 +236,28 @@ jobs:
screenshots-android:
name: Screenshots (Android)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4

- name: Android Screenshot Workflow
uses: ./.github/actions/screenshot-android
with:
ANDROID_EMULATOR_API: ${{ env.ANDROID_EMULATOR_API }}
ANDROID_EMULATOR_ARCH: ${{ env.ANDROID_EMULATOR_ARCH }}

screenshots-iphone:
name: Screenshots (iPhone)
screenshots-ios:
name: Screenshots (iOS)
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable

- uses: actions/checkout@v5
- uses: actions/checkout@v4

- name: iPhone Screenshot Workflow
uses: ./.github/actions/screenshot-iphone
with:
IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }}

screenshots-ipad:
name: Screenshots (iPad)
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: latest-stable

- uses: actions/checkout@v5

- name: iPad Screenshot Workflow
uses: ./.github/actions/screenshot-ipad
with:
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}

debian:
name: Debian Flutter Build
needs: common
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Debian Workflow
uses: ./.github/actions/debian
with:
VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }}
VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }}

- name: Upload Debian Build
uses: actions/upload-artifact@v4
with:
name: Debian Build
path: build/linux/x64/release/bundle/

- name: Push Debian Build to app branch
shell: bash
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} app
cd app
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
cp -r ../build/linux/x64/release/bundle/* .
git checkout --orphan temporary
git add --all
git commit -m "[Auto] Update Debian build from $branch ($(date +%Y-%m-%d.%H:%M:%S))"
git branch -D app
git branch -m app
git push --force origin app

macos:
name: macOS Flutter Build
needs: common
runs-on: macos-latest
steps:
- uses: actions/checkout@v5

- name: macOS Workflow
uses: ./.github/actions/macos
with:
VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }}
VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }}

- name: Upload macOS Build
uses: actions/upload-artifact@v4
with:
name: macOS Build
path: build/macos/Build/Products/Release/

- name: Push macOS Build to app branch
shell: bash
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} app
cd app
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}

# Copy all macOS build artifacts to root
cp -r ../build/macos/Build/Products/Release/* .

git checkout --orphan temporary
git add --all
git commit -m "[Auto] Update macOS build from $branch ($(date +%Y-%m-%d.%H:%M:%S))"
git branch -D app
git branch -m app
git push --force origin app


windows:
name: Windows Flutter Build
needs: common
runs-on: windows-latest
steps:
- uses: actions/checkout@v5

- name: Windows Workflow
uses: ./.github/actions/windows
- name: iOS Screenshot Workflow
uses: ./.github/actions/screenshot-ios
with:
VERSION_NAME: ${{ needs.common.outputs.VERSION_NAME }}
VERSION_CODE: ${{ needs.common.outputs.VERSION_CODE }}

- name: Upload Windows Build
uses: actions/upload-artifact@v4
with:
name: Windows Build
path: build/windows/x64/runner/Release/

- name: Push Windows Build to app branch
shell: bash
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

git clone --branch=app https://${{ github.repository_owner }}:${{ github.token }}@github.com/${{ github.repository }} app
cd app
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}

# Copy all Windows build artifacts to root
cp -r ../build/windows/x64/runner/Release/* .

git checkout --orphan temporary
git add --all
git commit -m "[Auto] Update Windows build from $branch ($(date +%Y-%m-%d.%H:%M:%S))"
git branch -D app
git branch -m app
git push --force origin app

IPHONE_DEVICE_MODEL: ${{ env.IPHONE_DEVICE_MODEL }}
IPAD_DEVICE_MODEL: ${{ env.IPAD_DEVICE_MODEL }}
13 changes: 11 additions & 2 deletions lib/bademagic_module/models/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import 'messages.dart';

class Data {
final List<Message> messages;
Data({required this.messages});
final int? height;
final int? width;

Data({required this.messages, this.height, this.width});

// Convert Data object to JSON
Map<String, dynamic> toJson() => {
'messages': messages.map((message) => message.toJson()).toList(),
if (height != null) 'height': height,
if (width != null) 'width': width,
};

// Convert JSON to Data object
Expand All @@ -32,6 +37,10 @@ class Data {
List<Message> messageList =
messagesFromJson.map((message) => Message.fromJson(message)).toList();

return Data(messages: messageList);
return Data(
messages: messageList,
height: json['height'] as int?,
width: json['width'] as int?,
);
}
}
26 changes: 26 additions & 0 deletions lib/bademagic_module/models/screen_size.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class ScreenSize {
final int width;
final int height;
final String name;

const ScreenSize(
{required this.width, required this.height, required this.name});

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ScreenSize &&
runtimeType == other.runtimeType &&
width == other.width &&
height == other.height &&
name == other.name;

@override
int get hashCode => width.hashCode ^ height.hashCode ^ name.hashCode;
}

const List<ScreenSize> supportedScreenSizes = [
ScreenSize(width: 44, height: 11, name: "Small (44x11)"),
ScreenSize(width: 64, height: 16, name: "Medium (64x16)"),
ScreenSize(width: 128, height: 32, name: "Large (128x32)"),
];
28 changes: 10 additions & 18 deletions lib/bademagic_module/utils/byte_array_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ List<int> hexStringToByteArray(String hexString) {
return data;
}

List<List<bool>> hexStringToBool(String hexString) {
int rows = 11;
List<List<bool>> hexStringToBool(String hexString, int rows) {
if (hexString.length % 2 != 0 || !isValidHex(hexString)) {
throw ArgumentError("Invalid hex string: $hexString");
}
Expand All @@ -39,23 +38,18 @@ List<List<bool>> hexStringToBool(String hexString) {
int rowIndex = 0;

for (int i = 0; i < hexString.length; i += 2) {
// Convert the hex string into a byte (int)
int byte = int.parse(hexString.substring(i, i + 2), radix: 16);

// Convert the byte into a binary representation and then into booleans
for (int bit = 7; bit >= 0; bit--) {
boolArray[rowIndex].add(((byte >> bit) & 1) == 1);
}

// Move to the next row after filling current one
rowIndex = (rowIndex + 1) % rows;
}

return boolArray;
}

List<List<int>> byteArrayToBinaryArray(List<int> byteArray) {
List<List<int>> binaryArray = List.generate(11, (_) => []);
List<List<int>> byteArrayToBinaryArray(List<int> byteArray, int rows) {
List<List<int>> binaryArray = List.generate(rows, (_) => []);

int rowIndex = 0;
for (int byte in byteArray) {
Expand All @@ -66,32 +60,27 @@ List<List<int>> byteArrayToBinaryArray(List<int> byteArray) {

binaryArray[rowIndex].addAll(binaryRepresentation);

rowIndex = (rowIndex + 1) % 11;
rowIndex = (rowIndex + 1) % rows;
}

logger.d(
"binaryArray: $binaryArray"); // Use print instead of logger for standalone example
logger.d("binaryArray: $binaryArray");
return binaryArray;
}

String hexToBin(String hex) {
// Convert hex to binary string
String binaryString = BigInt.parse(hex, radix: 16).toRadixString(2);

// Pad the binary string with leading zeros if necessary to ensure it's a multiple of 8 bits
int paddingLength = (8 - (binaryString.length % 8)) % 8;
binaryString = binaryString.padLeft(binaryString.length + paddingLength, '0');
logger.d("binaryString: $binaryString");
return binaryString;
}

List<List<int>> binaryStringTo2DList(String binaryString) {
int maxHeight = 11;
List<List<int>> binaryStringTo2DList(String binaryString, int maxHeight) {
List<List<int>> binary2DList = List.generate(maxHeight, (_) => []);

for (int x = 0; x < binaryString.length; x++) {
int a = 0;
for (int y = a; y < 11; y++) {
for (int y = a; y < maxHeight; y++) {
for (int z = 0; z < 8; z++) {
binary2DList[y].add(int.parse(binaryString[x++]));
if (x >= binaryString.length) {
Expand All @@ -102,6 +91,9 @@ List<List<int>> binaryStringTo2DList(String binaryString) {
break;
}
}
if (x >= binaryString.length) {
break;
}
}
logger.d("binary2DList: $binary2DList");
return binary2DList;
Expand Down
Loading
Loading