Fix EAS build repositories issues by modifying both project-level and settings-level repository blocks
This commit is contained in:
@@ -1 +1,82 @@
|
||||
Schnappix
|
||||
# Schnappix
|
||||
|
||||
Schnappix is a tablet-optimized Photobooth application built with React Native and Expo. It provides a full-featured, interactive photo capturing experience, complete with external hardware support and an administrative interface.
|
||||
|
||||
## Features
|
||||
|
||||
- **Photobooth Experience**: Intuitive flow from start screen to countdown, photo capture, and final preview.
|
||||
- **Multiple Photos & Collages**: Capture single or multiple photos and review them in a generated collage.
|
||||
- **Direct Printing**: Built-in support for IPP (Internet Printing Protocol) network printers to instantly print captured moments.
|
||||
- **Kiosk Mode**: Custom native Android implementation to lock the tablet down to the Schnappix app, preventing users from exiting the photobooth.
|
||||
- **USB Camera Support**: Extends standard camera capabilities to support external USB cameras for higher quality photos.
|
||||
- **Admin Dashboard**: Secure administrative screen (protected by an admin password) to configure settings on the fly:
|
||||
- Countdown duration
|
||||
- Printer IP address
|
||||
- Kiosk mode toggle
|
||||
- Admin password changes
|
||||
- **Offline Storage**: Saves captured photos directly to the device's local storage and gallery.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
- **Framework**: [React Native](https://reactnative.dev/) (v0.85.3) & [Expo](https://expo.dev/) (SDK 56)
|
||||
- **Language**: TypeScript
|
||||
- **Key Libraries**:
|
||||
- `expo-camera`: Camera interface
|
||||
- `expo-media-library` & `expo-file-system`: Photo storage
|
||||
- `ipp-encoder`: Network printing integration
|
||||
- `react-native-view-shot`: Capturing collages as images
|
||||
- Custom native Expo plugins (`withKioskAdmin`, `withUsbCamera`, `withSettingsRepositories`) for extended Android capabilities.
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Node.js (v18+)
|
||||
- npm or yarn
|
||||
- Expo CLI
|
||||
- Android Studio / Android SDK (for building the native Android app, as it uses custom native modules)
|
||||
|
||||
### Installation
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd Schnappix
|
||||
```
|
||||
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
3. Prebuild the native Android project (required due to custom native plugins):
|
||||
```bash
|
||||
npx expo prebuild --platform android
|
||||
```
|
||||
|
||||
4. Run the app on an Android device or emulator:
|
||||
```bash
|
||||
npm run android
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
```text
|
||||
Schnappix/
|
||||
├── App.tsx # Main entry point and navigation logic
|
||||
├── app.json # Expo configuration and plugin registration
|
||||
├── plugins/ # Custom Expo config plugins for Android features
|
||||
├── modules/ # Custom native modules (e.g., kiosk-mode)
|
||||
└── src/
|
||||
├── screens/ # UI Screens (Home, Camera, Preview, Admin)
|
||||
├── services/ # Core logic (printer.ts, settings.ts, storage.ts)
|
||||
└── styles/ # Global styles and theme configurations
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
When the app is first launched, you can access the **Admin Dashboard** from the Home screen. From here, you can define your hardware settings like the Printer's local IP address and adjust the capture countdown timer.
|
||||
|
||||
## License
|
||||
|
||||
See the [LICENSE](LICENSE) file for more information.
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
const { withSettingsGradle } = require('@expo/config-plugins');
|
||||
const { withProjectBuildGradle, withSettingsGradle } = require('@expo/config-plugins');
|
||||
|
||||
const withSettingsRepositories = (config) => {
|
||||
return withSettingsGradle(config, (config) => {
|
||||
// 1. Modify settings.gradle (settings-level repositories)
|
||||
config = withSettingsGradle(config, (config) => {
|
||||
let contents = config.modResults.contents;
|
||||
|
||||
// Append dependencyResolutionManagement block at the end of settings.gradle
|
||||
// to add repositories at settings level. This is required because EAS Build
|
||||
// uses PREFER_SETTINGS repositories mode, which ignores project-level repositories.
|
||||
const reposBlock = `
|
||||
// Added by withSettingsRepositories plugin
|
||||
dependencyResolutionManagement {
|
||||
@@ -16,14 +13,32 @@ dependencyResolutionManagement {
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
if (!contents.includes('https://jcenter.bintray.com')) {
|
||||
contents += reposBlock;
|
||||
}
|
||||
config.modResults.contents = contents;
|
||||
return config;
|
||||
});
|
||||
|
||||
// 2. Modify root build.gradle (project-level repositories)
|
||||
config = withProjectBuildGradle(config, (config) => {
|
||||
let contents = config.modResults.contents;
|
||||
|
||||
// Inject jcenter and jitpack into the allprojects.repositories block
|
||||
if (!contents.includes('https://jcenter.bintray.com')) {
|
||||
contents = contents.replace(
|
||||
/maven\s*\{\s*url\s*['"]https:\/\/www\.jitpack\.io['"]\s*\}/g,
|
||||
`maven { url 'https://www.jitpack.io' }
|
||||
maven { url 'https://jcenter.bintray.com' }
|
||||
maven { url 'https://jitpack.io' }`
|
||||
);
|
||||
}
|
||||
|
||||
config.modResults.contents = contents;
|
||||
return config;
|
||||
});
|
||||
|
||||
return config;
|
||||
};
|
||||
|
||||
module.exports = withSettingsRepositories;
|
||||
|
||||
Reference in New Issue
Block a user