Skip to content
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
4 changes: 3 additions & 1 deletion .github/actions/cache-gradle/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ inputs:
description: Paths to cache
required: false
default: |
~/.gradle/caches
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
~/.gradle/wrapper
cache-version:
description: Additional cache version segment
Expand Down
23 changes: 23 additions & 0 deletions .github/actions/cleanup-gradle-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Clean Up Gradle Artifacts

description: Clean up unnecessary Gradle build artifacts to save disk space and reduce cache size.

runs:
using: "composite"
steps:
- name: Clean up Gradle build artifacts
shell: bash
run: |
echo "Cleaning up unnecessary build artifacts to save disk space..."
# Remove build outputs (APK/AAB already tested, no need to cache them)
# Find all Android build directories and clean up intermediates and tmp
find . -type d -path "*/android/app/build/intermediates" -exec rm -rf {} + 2>/dev/null || true
find . -type d -path "*/android/app/build/tmp" -exec rm -rf {} + 2>/dev/null || true
# Clean up Gradle daemon logs and lock files
rm -rf ~/.gradle/daemon
rm -rf ~/.gradle/*.lock
# Remove large cache files that aren't needed for subsequent builds
find ~/.gradle/caches -name "*.lock" -delete 2>/dev/null || true
find ~/.gradle/caches -type f -name "gc.properties" -delete 2>/dev/null || true
echo "Disk usage after cleanup:"
df -h
26 changes: 26 additions & 0 deletions .github/actions/free-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Free Disk Space

description: Free up disk space on GitHub Actions runners by removing unnecessary pre-installed tools.

runs:
using: "composite"
steps:
- name: Free up disk space
shell: bash
run: |
echo "Disk usage before cleanup:"
df -h
# Remove unnecessary pre-installed tools to free up space
# These are commonly available on GitHub runners but not needed for most builds
# DO NOT remove $AGENT_TOOLSDIRECTORY as it contains active tools like Node.js
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
# Remove unused languages from hostedtoolcache to save space
# but preserve the directory structure and Node.js
sudo rm -rf /opt/hostedtoolcache/CodeQL 2>/dev/null || true
sudo rm -rf /opt/hostedtoolcache/PyPy 2>/dev/null || true
sudo rm -rf /opt/hostedtoolcache/go 2>/dev/null || true
sudo rm -rf /opt/hostedtoolcache/Ruby 2>/dev/null || true
echo "Disk usage after cleanup:"
df -h
4 changes: 4 additions & 0 deletions .github/workflows/mobile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ jobs:
node_modules
app/node_modules
cache-version: ${{ env.GH_CACHE_VERSION }}-${{ env.NODE_VERSION_SANITIZED }}
- name: Free up disk space
uses: ./.github/actions/free-disk-space
- name: Cache Gradle
uses: ./.github/actions/cache-gradle
with:
Expand Down Expand Up @@ -459,3 +461,5 @@ jobs:
- name: Build Android (with AAPT2 symlink fix)
run: yarn android:ci
working-directory: ./app
- name: Clean up Gradle build artifacts
uses: ./.github/actions/cleanup-gradle-artifacts
8 changes: 7 additions & 1 deletion .github/workflows/mobile-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,8 @@ jobs:
project_id: "plucky-tempo-454713-r0"
workload_identity_provider: "projects/852920390127/locations/global/workloadIdentityPools/gh-self/providers/github-by-repos"
service_account: "[email protected]"
- name: Free up disk space
uses: ./.github/actions/free-disk-space
# Fail fast: set up JDK for keytool and verify Android secrets early
- name: Setup Java environment
if: inputs.platform != 'ios'
Expand Down Expand Up @@ -1178,6 +1180,10 @@ jobs:

echo "✅ Android build output verification passed"

- name: Clean up Gradle build artifacts
if: inputs.platform != 'ios'
uses: ./.github/actions/cleanup-gradle-artifacts

- name: Upload to Google Play Store using WIF
if: inputs.platform != 'ios' && inputs.test_mode != true
timeout-minutes: 10
Expand Down Expand Up @@ -1347,7 +1353,7 @@ jobs:
exit 0
fi

git commit -m "chore: bump mobile app version to $VERSION [skip ci]"
git commit -m "chore: bump mobile app version to $VERSION"

# Create new branch from current HEAD (bump target branch with version bump)
git checkout -b ${BRANCH_NAME}
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ jobs:
- name: Add Maestro to path
if: false # Skip for build-only test - keep logic for future E2E
run: echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
- name: Free up disk space
uses: ./.github/actions/free-disk-space
- name: Setup Java environment
uses: actions/setup-java@v4
with:
Expand All @@ -108,6 +110,9 @@ jobs:
- name: Build dependencies (outside emulator)
run: |
echo "Building dependencies..."
# Ensure Yarn 4.6.0 is active
corepack enable
corepack prepare [email protected] --activate
yarn workspace @selfxyz/mobile-app run build:deps || { echo "❌ Dependency build failed"; exit 1; }
echo "✅ Dependencies built successfully"
- name: Clone android-passport-nfc-reader
Expand All @@ -121,6 +126,8 @@ jobs:
chmod +x app/android/gradlew
(cd app/android && ./gradlew assembleDebug --quiet --parallel --build-cache --no-configuration-cache) || { echo "❌ Android build failed"; exit 1; }
echo "✅ Android build succeeded"
- name: Clean up Gradle build artifacts
uses: ./.github/actions/cleanup-gradle-artifacts
- name: Verify APK and android-passport-nfc-reader integration
run: |
echo "🔍 Verifying build artifacts..."
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/mobile-sdk-demo-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ jobs:
- name: Add Maestro to path
if: false # Skip for build-only test - keep logic for future E2E
run: echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
- name: Free up disk space
uses: ./.github/actions/free-disk-space
- name: Setup Java environment
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -124,6 +126,8 @@ jobs:
chmod +x packages/mobile-sdk-demo/android/gradlew
(cd packages/mobile-sdk-demo/android && ./gradlew assembleDebug --quiet --parallel --build-cache --no-configuration-cache) || { echo "❌ Android build failed"; exit 1; }
echo "✅ Android build succeeded"
- name: Clean up Gradle build artifacts
uses: ./.github/actions/cleanup-gradle-artifacts
- name: Verify APK build
run: |
echo "🔍 Verifying build artifacts..."
Expand Down
6 changes: 2 additions & 4 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ import 'react-native-get-random-values';
import { Buffer } from 'buffer';
import React from 'react';
import { AppRegistry, LogBox } from 'react-native';
import { createTamagui, TamaguiProvider } from 'tamagui';
import { TamaguiProvider } from 'tamagui';

import App from './App';
import { name as appName } from './app.json';
import tamaguiConfig from './tamagui.config';

import './src/utils/ethers';
import 'react-native-gesture-handler';
import { config } from '@tamagui/config/v2-native';

// Set global Buffer before any other imports
global.Buffer = Buffer;

const tamaguiConfig = createTamagui(config);

LogBox.ignoreLogs([
/bad setState/,
'Warning, duplicate ID for input',
Expand Down
6 changes: 5 additions & 1 deletion app/jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: [
'node_modules/(?!(react-native|@react-native|@react-navigation|@react-native-community|@segment/analytics-react-native|@openpassport|react-native-keychain|react-native-check-version|react-native-nfc-manager|react-native-passport-reader|react-native-gesture-handler|uuid|@stablelib|@react-native-google-signin|react-native-cloud-storage|@react-native-clipboard|@react-native-firebase|@selfxyz|@sentry|@anon-aadhaar)/)',
'node_modules/(?!(react-native|@react-native|@react-navigation|@react-native-community|@segment/analytics-react-native|@openpassport|react-native-keychain|react-native-check-version|react-native-nfc-manager|react-native-passport-reader|react-native-gesture-handler|uuid|@stablelib|@react-native-google-signin|react-native-cloud-storage|@react-native-clipboard|@react-native-firebase|@selfxyz|@sentry|@anon-aadhaar|react-native-svg|react-native-svg-circle-country-flags)/)',
],
setupFiles: ['<rootDir>/jest.setup.js'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$',
Expand All @@ -17,8 +17,12 @@ module.exports = {
'^@$': '<rootDir>/src',
'^@tests/(.*)$': '<rootDir>/tests/src/$1',
'^@tests$': '<rootDir>/tests/src',
// Map react-native-svg to app's node_modules for all packages
'^react-native-svg$': '<rootDir>/node_modules/react-native-svg',
'^@selfxyz/mobile-sdk-alpha$':
'<rootDir>/../packages/mobile-sdk-alpha/dist/cjs/index.cjs',
'^@selfxyz/mobile-sdk-alpha/components$':
'<rootDir>/../packages/mobile-sdk-alpha/dist/cjs/components/index.cjs',
'^@selfxyz/mobile-sdk-alpha/onboarding/(.*)$':
'<rootDir>/../packages/mobile-sdk-alpha/dist/cjs/flows/onboarding/$1.cjs',
'^@selfxyz/mobile-sdk-alpha/disclosing/(.*)$':
Expand Down
44 changes: 44 additions & 0 deletions app/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,50 @@ jest.mock('./src/utils/notifications/notificationService', () =>
require('./tests/__setup__/notificationServiceMock.js'),
);

// Mock react-native-svg
jest.mock('react-native-svg', () => {
const React = require('react');

// Mock SvgXml component that handles XML strings
const SvgXml = React.forwardRef(
({ xml, width, height, style, ...props }, ref) => {
return React.createElement('div', {
ref,
style: {
width: width || 'auto',
height: height || 'auto',
display: 'inline-block',
...style,
},
dangerouslySetInnerHTML: { __html: xml },
...props,
});
},
);
SvgXml.displayName = 'SvgXml';

return {
__esModule: true,
default: SvgXml,
SvgXml,
Svg: props => React.createElement('Svg', props, props.children),
Circle: props => React.createElement('Circle', props, props.children),
Path: props => React.createElement('Path', props, props.children),
G: props => React.createElement('G', props, props.children),
Rect: props => React.createElement('Rect', props, props.children),
Defs: props => React.createElement('Defs', props, props.children),
LinearGradient: props =>
React.createElement('LinearGradient', props, props.children),
Stop: props => React.createElement('Stop', props, props.children),
ClipPath: props => React.createElement('ClipPath', props, props.children),
Polygon: props => React.createElement('Polygon', props, props.children),
Polyline: props => React.createElement('Polyline', props, props.children),
Line: props => React.createElement('Line', props, props.children),
Text: props => React.createElement('Text', props, props.children),
TSpan: props => React.createElement('TSpan', props, props.children),
};
});

// Mock React Navigation
jest.mock('@react-navigation/native', () => {
const actualNav = jest.requireActual('@react-navigation/native');
Expand Down
1 change: 0 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
"react-native-screens": "4.15.3",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "15.12.1",
"react-native-svg-circle-country-flags": "^0.2.2",
"react-native-svg-web": "^1.0.9",
"react-native-web": "^0.19.0",
"react-qr-barcode-scanner": "^2.1.8",
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/Disclosures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { XStack, YStack } from 'tamagui';
import type { Country3LetterCode } from '@selfxyz/common/constants';
import { countryCodes } from '@selfxyz/common/constants';
import type { SelfAppDisclosureConfig } from '@selfxyz/common/utils';
import { BodyText } from '@selfxyz/mobile-sdk-alpha/components';

import { BodyText } from '@/components/typography/BodyText';
import CheckMark from '@/images/icons/checkmark.svg';
import { slate200, slate500 } from '@/utils/colors';

Expand Down Expand Up @@ -115,7 +115,7 @@ const DisclosureItem: React.FC<DisclosureItemProps> = ({
paddingHorizontal={10}
>
<CheckMark width={22} />
<BodyText textBreakStrategy="balanced" color={slate500}>
<BodyText textBreakStrategy="balanced" style={{ color: slate500 }}>
{text}
</BodyText>
</XStack>
Expand Down
3 changes: 2 additions & 1 deletion app/src/components/FeedbackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import React, { useState } from 'react';
import { Alert, Modal, StyleSheet, Text, TextInput, View } from 'react-native';
import { Button, XStack, YStack } from 'tamagui';

import { Caption } from '@/components/typography/Caption';
import { Caption } from '@selfxyz/mobile-sdk-alpha/components';

import { black, slate400, white, zinc800, zinc900 } from '@/utils/colors';
import { advercase, dinot } from '@/utils/fonts';

Expand Down
15 changes: 10 additions & 5 deletions app/src/components/FeedbackModalScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import React, { useCallback } from 'react';
import { Modal, StyleSheet } from 'react-native';
import { styled, View, XStack, YStack } from 'tamagui';

import { PrimaryButton } from '@/components/buttons/PrimaryButton';
import { SecondaryButton } from '@/components/buttons/SecondaryButton';
import Description from '@/components/typography/Description';
import { Title } from '@/components/typography/Title';
import {
Description,
PrimaryButton,
SecondaryButton,
Title,
} from '@selfxyz/mobile-sdk-alpha/components';

import ModalClose from '@/images/icons/modal_close.svg';
import LogoInversed from '@/images/logo_inversed.svg';
import { white } from '@/utils/colors';
Expand Down Expand Up @@ -112,7 +115,9 @@ const FeedbackModalScreen: React.FC<FeedbackModalScreenProps> = ({
)}
</XStack>
<YStack gap={20}>
<Title textAlign="left">{modalParams.titleText}</Title>
<Title style={{ textAlign: 'left' }}>
{modalParams.titleText}
</Title>
<Description style={styles.description}>
{modalParams.bodyText}
</Description>
Expand Down
10 changes: 6 additions & 4 deletions app/src/components/NavBar/AadhaarNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ export const AadhaarNavBar = (props: NativeStackHeaderProps) => {
/>

<NavBar.Title
fontSize={16}
color={black}
fontWeight="600"
fontFamily={dinot}
style={{
fontSize: 16,
color: black,
fontWeight: '600',
fontFamily: dinot,
}}
>
AADHAAR REGISTRATION
</NavBar.Title>
Expand Down
5 changes: 3 additions & 2 deletions app/src/components/NavBar/BaseNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import React, { useMemo } from 'react';
import type { TextProps } from 'react-native';
import type { SystemBarStyle } from 'react-native-edge-to-edge';
import { SystemBars } from 'react-native-edge-to-edge';
import type { TextProps, ViewProps, XStackProps } from 'tamagui';
import type { ViewProps, XStackProps } from 'tamagui';
import { Button, View, XStack } from 'tamagui';
import { ChevronLeft, X } from '@tamagui/lucide-icons';

import { Title } from '@/components/typography/Title';
import { Title } from '@selfxyz/mobile-sdk-alpha/components';

interface NavBarProps extends XStackProps {
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/NavBar/DocumentFlowNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const DocumentFlowNavBar = ({
justifyContent="space-between"
>
<NavBar.LeftAction component="back" onPress={() => navigation.goBack()} />
<NavBar.Title fontFamily={titleFontFamily} fontSize={fontSize}>
<NavBar.Title style={{ fontFamily: titleFontFamily, fontSize: fontSize }}>
{title}
</NavBar.Title>
<NavBar.RightAction
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/NavBar/HomeNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const HomeNavBar = (props: NativeStackHeaderProps) => {
</XStack>
}
/>
<NavBar.Title size="large" color={black}>
<NavBar.Title style={{ fontSize: 24, color: black }}>
{props.options.title}
</NavBar.Title>
<NavBar.RightAction
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/NavBar/IdDetailsNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const IdDetailsNavBar = (props: NativeStackHeaderProps) => {
</Button>
}
/>
<NavBar.Title size="large" color={black}>
<NavBar.Title style={{ fontSize: 24, color: black }}>
{props.options.title}
</NavBar.Title>
<NavBar.RightAction
Expand Down
5 changes: 3 additions & 2 deletions app/src/components/Tips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import React from 'react';
import { Text, View } from 'tamagui';

import { Caption } from '@/components/typography/Caption';
import { Caption } from '@selfxyz/mobile-sdk-alpha/components';

import { slate500 } from '@/utils/colors';

export interface TipProps {
Expand Down Expand Up @@ -39,7 +40,7 @@ function Tip({ title, body, icon }: TipProps) {
</View>
)}
<View flex={1}>
<Caption size="large" color={slate500}>
<Caption size="large" style={{ color: slate500 }}>
<Text fontWeight={'bold'}>
{title}
{': '}
Expand Down
Loading
Loading