chore: implement google play suggestions (#997)

* google play suggestions

* update gitguardian ignore

* remove unused
This commit is contained in:
Justin Hernandez
2025-09-03 21:38:18 -07:00
committed by GitHub
parent ec732da157
commit 5a6142515c
15 changed files with 92 additions and 31 deletions

View File

@@ -1,4 +1,68 @@
version: 2
# Ignore specific file patterns (newer format)
ignore:
# Mock certificates for testing (these are intentionally committed test data)
- "**/mock_certificates/**/*.key"
- "**/mock_certificates/**/*.crt"
- "**/mock_certificates/**/*.pem"
- "**/constants/mockCertificates.ts"
# Test data files
- "**/test/**/*.key"
- "**/test/**/*.crt"
- "**/test/**/*.pem"
- "**/tests/**/*.key"
- "**/tests/**/*.crt"
- "**/tests/**/*.pem"
# Mock data files
- "**/mock/**/*.key"
- "**/mock/**/*.crt"
- "**/mock/**/*.pem"
# Demo app test data
- "**/demo-app/**/mock/**"
- "**/demo-app/**/test-data/**"
# Keep the old format for backward compatibility
exclusion_globs:
# Mock certificates for testing (these are intentionally committed test data)
- "common/src/mock_certificates/**"
- "common/src/constants/mockCertificates.ts"
- "**/test-data/**"
- "**/mock-data/**"
# Test files with mock certificates
- "**/test/**/*.key"
- "**/test/**/*.crt"
- "**/test/**/*.pem"
- "**/tests/**/*.key"
- "**/tests/**/*.crt"
- "**/tests/**/*.pem"
# Demo app test data
- "**/demo-app/**/mock/**"
- "**/demo-app/**/test-data/**"
# Generated test files
- "**/generated/**/*.key"
- "**/generated/**/*.crt"
- "**/generated/**/*.pem"
# Ignore specific secret types for mock files
ignore_secrets:
- "Generic Private Key" # For mock certificate keys
- "Generic Certificate" # For mock certificates
- "RSA Private Key" # For mock RSA keys
- "EC Private Key" # For mock EC keys
# Advanced: Ignore based on file content patterns
ignore_patterns:
# Ignore files that contain "mock" in the path and have key/cert content
- pattern: "mock.*\\.(key|crt|pem)$"
reason: "Mock certificate files for testing"
# Ignore TypeScript files that export mock data
- pattern: ".*mock.*\\.ts$"
reason: "Mock data export files for testing"

View File

@@ -25,8 +25,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1152.0)
aws-sdk-core (3.231.0)
aws-partitions (1.1154.0)
aws-sdk-core (3.232.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
@@ -46,7 +46,7 @@ GEM
babosa (1.0.4)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
bigdecimal (3.2.3)
claide (1.1.0)
cocoapods (1.16.2)
addressable (~> 2.8)
@@ -90,7 +90,7 @@ GEM
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.3.5)
connection_pool (2.5.3)
connection_pool (2.5.4)
declarative (0.0.20)
digest-crc (0.7.0)
rake (>= 12.0.0, < 14.0.0)

View File

@@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.5.2'

View File

@@ -24,17 +24,14 @@
android:value="ocr" />
<activity android:name=".ui.activities.CameraActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
android:windowSoftInputMode="stateAlwaysHidden" />
<activity android:name=".ui.activities.NfcActivity"
android:screenOrientation="nosensor"
android:keepScreenOn="true" />
<activity android:name=".ui.activities.SelectionActivity"
android:screenOrientation="nosensor" />
<activity android:name=".ui.activities.SelectionActivity" />
</application>
</manifest>

View File

@@ -177,8 +177,8 @@ android {
exclude 'META-INF/versions/9/OSGI-INF/MANIFEST.MF'
pickFirst '**/libc++_shared.so'
jniLibs {
// Legacy packaging keeps page alignment for 16k page size devices
useLegacyPackaging true
// Use modern packaging so AGP can 16 KB-align uncompressed .so files
useLegacyPackaging false
}
}
}

View File

@@ -27,7 +27,6 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:exported="true">

View File

@@ -6,6 +6,7 @@ import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.content.pm.ActivityInfo
import androidx.core.view.WindowCompat
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
@@ -29,12 +30,22 @@ class MainActivity : ReactActivity() {
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
Log.d("MAIN_ACTIVITY", "onNewIntent: " + intent.action)
RNPassportReaderModule.getInstance().receiveIntent(intent)
try {
RNPassportReaderModule.getInstance().receiveIntent(intent)
} catch (e: IllegalStateException) {
// Module not initialized yet (React context not ready). Ignore safely.
Log.w("MAIN_ACTIVITY", "RNPassportReaderModule not ready; deferring NFC intent")
setIntent(intent)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Lock to portrait orientation
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
// Prevent fragment state restoration to avoid react-native-screens crash
// See: https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704978
super.onCreate(null)
// Ensure edge-to-edge is enabled consistently across Android versions
// Android 15 enables by default; on earlier versions, opt-in for immersive layouts
WindowCompat.setDecorFitsSystemWindows(window, false)
// Allow system to manage orientation for large screens
}
}

View File

@@ -7,7 +7,7 @@ buildscript {
compileSdkVersion = 35
targetSdkVersion = 35
// Updated NDK to support 16k page size devices
ndkVersion = "27.0.11718014"
ndkVersion = "27.1.12297006"
kotlinVersion = "1.9.24"
firebaseMessagingVersion = "23.4.0"
firebaseBomVersion = "32.7.3"

View File

@@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
android {
namespace "io.tradle.nfc"
// Use NDK that supports 16k page size
ndkVersion = "27.0.11718014"
ndkVersion = "27.1.12297006"
compileSdkVersion 33
defaultConfig {
targetSdkVersion 33
@@ -32,7 +32,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation 'com.google.code.gson:gson:2.8.9' // Check for the latest version
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'com.wdullaer:materialdatetimepicker:3.5.2'
implementation 'org.jmrtd:jmrtd:0.8.1'

View File

@@ -6,7 +6,6 @@ import { lazy } from 'react';
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
import { HomeNavBar } from '@/components/NavBar';
import { black } from '@/utils/colors';
const DisclaimerScreen = lazy(() => import('@/screens/home/DisclaimerScreen'));
const HomeScreen = lazy(() => import('@/screens/home/HomeScreen'));
@@ -29,7 +28,6 @@ const homeScreens = {
options: {
title: 'Self',
header: HomeNavBar,
navigationBarColor: black,
presentation: 'card',
} as NativeStackNavigationOptions,
},
@@ -37,7 +35,6 @@ const homeScreens = {
screen: ProofHistoryScreen,
options: {
title: 'Approved Requests',
navigationBarColor: black,
headerBackTitle: 'close',
},
},

View File

@@ -24,7 +24,6 @@ import recoveryScreens from '@/navigation/recovery';
import settingsScreens from '@/navigation/settings';
import systemScreens from '@/navigation/system';
import analytics from '@/utils/analytics';
import { white } from '@/utils/colors';
import { setupUniversalLinkListenerInNavigation } from '@/utils/deeplinks';
export const navigationScreens = {
@@ -43,7 +42,6 @@ const AppNavigation = createNativeStackNavigator({
initialRouteName: Platform.OS === 'web' ? 'Home' : 'Splash',
screenOptions: {
header: DefaultNavBar,
navigationBarColor: white,
},
layout: AppLayout,
screens: navigationScreens,

View File

@@ -66,7 +66,6 @@ const settingsScreens = {
headerTitleStyle: {
color: black,
},
navigationBarColor: black,
} as NativeStackNavigationOptions,
config: {
screens: {},

View File

@@ -48,7 +48,6 @@ const settingsScreens = {
headerTitleStyle: {
color: black,
},
navigationBarColor: black,
} as NativeStackNavigationOptions,
config: {
screens: {},

View File

@@ -10,7 +10,6 @@ import type { NativeStackNavigationOptions } from '@react-navigation/native-stac
// This is because it's used as a fallback for the Suspense boundary in the root navigator,
// ensuring it's immediately available at startup.
import SplashScreen from '@/screens/system/SplashScreen';
import { black } from '@/utils/colors';
const LaunchScreen = lazy(() => import('@/screens/system/LaunchScreen'));
const LoadingScreen = lazy(() => import('@/screens/system/Loading'));
@@ -24,14 +23,12 @@ const systemScreens = {
screen: LaunchScreen,
options: {
header: () => <SystemBars style="light" />,
navigationBarColor: black,
},
},
Loading: {
screen: LoadingScreen,
options: {
headerShown: false,
navigationBarColor: black,
} as NativeStackNavigationOptions,
},
Modal: {
@@ -54,7 +51,6 @@ const systemScreens = {
screen: SplashScreen,
options: {
header: () => <SystemBars style="light" />,
navigationBarColor: black,
},
},
};

View File

@@ -125,7 +125,8 @@ describe('Android Manifest Configuration', () => {
expect(manifestContent).toContain('android:name=".MainActivity"');
expect(manifestContent).toContain('android:exported="true"');
expect(manifestContent).toContain('android:launchMode="singleTop"');
expect(manifestContent).toContain('android:screenOrientation="portrait"');
// Orientation locks removed to support large screens
expect(manifestContent).not.toContain('android:screenOrientation');
});
it('should have main launcher intent filter', () => {