Skip to content

Commit bcf8c84

Browse files
authored
Merge pull request abue-ammar#17 from abue-ammar/logo-fix
Logo fix
2 parents 254fe8a + a2a9219 commit bcf8c84

95 files changed

Lines changed: 8668 additions & 427 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 352 additions & 18 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,27 @@ dist-ssr
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
27+
# Rust (Tauri backend)
28+
src-tauri/target/
29+
src-tauri/.cargo/
30+
src-tauri/Cargo.lock
31+
32+
# Tauri build artifacts
33+
/src-tauri/bundled/
34+
/src-tauri/gen/android/app/build
35+
**/*.dmg
36+
**/*.app
37+
**/*.deb
38+
**/*.rpm
39+
**/*.msi
40+
**/*.exe
41+
**/*.apk
42+
**/*.aab
43+
44+
# Android signing keys (NEVER commit these)
45+
**/keystore.properties
46+
*.jks
47+
*.keystore
48+
upload-keystore.jks.base64

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

ANDROID_SIGNING_SETUP.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Android Signing Setup for GitHub Actions
2+
3+
This document explains how to set up Android signing for your Tauri app using GitHub Actions.
4+
5+
## Prerequisites
6+
7+
Before setting up GitHub Actions, you need to generate a signing key for your Android app.
8+
9+
### 1. Generate Android Signing Key
10+
11+
If you haven't already, generate a signing key using the `keytool` command:
12+
13+
```bash
14+
keytool -genkey -v -keystore upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
15+
```
16+
17+
When prompted, provide:
18+
19+
- A strong password for the keystore
20+
- Your app details (name, organization, etc.)
21+
- The same password for the key alias
22+
23+
**Important:** Save the keystore file (`upload-keystore.jks`) and remember the password you set.
24+
25+
### 2. Convert Keystore to Base64
26+
27+
Convert your keystore file to base64 for secure storage in GitHub secrets:
28+
29+
```bash
30+
base64 -i upload-keystore.jks | tr -d '\n' > keystore.base64
31+
```
32+
33+
This creates a `keystore.base64` file with the base64-encoded keystore.
34+
35+
## GitHub Repository Setup
36+
37+
### 3. Add GitHub Secrets
38+
39+
Go to your GitHub repository settings and add the following secrets:
40+
41+
1. **Settings****Secrets and variables****Actions**
42+
2. Click **New repository secret** and add:
43+
44+
| Secret Name | Description | Example Value |
45+
| ---------------------- | --------------------------------------------- | --------------------------------- |
46+
| `ANDROID_KEY_ALIAS` | The alias you used when creating the keystore | `upload` |
47+
| `ANDROID_KEY_PASSWORD` | The password you set for the keystore | `your_secure_password` |
48+
| `ANDROID_KEY_BASE64` | The base64-encoded keystore content | Content of `keystore.base64` file |
49+
50+
### 4. Configure Gradle for Signing
51+
52+
The Gradle build configuration has been automatically set up in `src-tauri/gen/android/app/build.gradle.kts` to use the signing key:
53+
54+
```kotlin
55+
import java.io.FileInputStream
56+
57+
// ... other configurations ...
58+
59+
signingConfigs {
60+
create("release") {
61+
val keystorePropertiesFile = rootProject.file("keystore.properties")
62+
val keystoreProperties = Properties()
63+
if (keystorePropertiesFile.exists()) {
64+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
65+
}
66+
67+
keyAlias = keystoreProperties["keyAlias"] as String
68+
keyPassword = keystoreProperties["password"] as String
69+
storeFile = file(keystoreProperties["storeFile"] as String)
70+
storePassword = keystoreProperties["password"] as String
71+
}
72+
}
73+
74+
buildTypes {
75+
getByName("release") {
76+
signingConfig = signingConfigs.getByName("release")
77+
// ... other release configurations ...
78+
}
79+
}
80+
```
81+
82+
This configuration:
83+
84+
- Reads the keystore properties from `keystore.properties`
85+
- Uses the signing key for release builds
86+
- Automatically signs APKs during the build process
87+
88+
### 5. Security Best Practices
89+
90+
- **Never commit** the `keystore.properties` file to your repository
91+
- **Never commit** the actual `.jks` keystore file
92+
- Use strong passwords for your keystore
93+
- Consider using different keys for debug and release builds
94+
- Keep backups of your keystore file in a secure location
95+
96+
## How It Works
97+
98+
When the GitHub Actions workflow runs:
99+
100+
1. The `Setup Android Signing` step creates a `keystore.properties` file in `src-tauri/gen/android/`
101+
2. It populates the file with values from your GitHub secrets
102+
3. The base64-encoded keystore is decoded and saved as a temporary file
103+
4. The Tauri build process uses these signing credentials to create signed APKs
104+
105+
## Workflow Integration
106+
107+
The signing is integrated into the main GitHub Actions workflow in `.github/workflows/main.yml`. The relevant steps are:
108+
109+
```yaml
110+
- name: Setup Android Signing
111+
run: |
112+
cd src-tauri/gen/android
113+
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
114+
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
115+
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
116+
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
117+
118+
- name: Build Signed Android APK
119+
run: npx tauri android build --apk --split-per-abi
120+
```
121+
122+
## Troubleshooting
123+
124+
### Common Issues
125+
126+
1. **Build fails with "keystore not found"**
127+
- Ensure all three GitHub secrets are set correctly
128+
- Verify the base64 encoding is correct (no newlines)
129+
130+
2. **Invalid keystore password**
131+
- Double-check the `ANDROID_KEY_PASSWORD` secret
132+
- Ensure the password matches what you used when creating the keystore
133+
134+
3. **Key alias not found**
135+
- Verify the `ANDROID_KEY_ALIAS` matches the alias used in keystore creation
136+
- Default alias is usually `upload`
137+
138+
### Verifying Secrets
139+
140+
You can verify your secrets are set correctly by checking the GitHub Actions logs. The workflow will show masked values for security.
141+
142+
## Release Process
143+
144+
Once configured, every push to the `tauri-migration` branch will:
145+
146+
1. Build signed APKs for multiple Android architectures
147+
2. Upload them as artifacts
148+
3. Create a GitHub release with all platform builds
149+
4. Deploy the web version to GitHub Pages
150+
151+
The signed APKs will be available in the GitHub release.

PLATFORM_SUPPORT.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Mobile and Cross-Platform Support
2+
3+
This image compressor app now supports multiple platforms:
4+
5+
## Supported Platforms
6+
7+
### ✅ Web Browser
8+
9+
- Works in any modern web browser
10+
- Uses standard HTML5 download functionality
11+
12+
### ✅ Desktop Applications
13+
14+
- **Windows**: Native Windows application
15+
- **Linux**: Native Linux application
16+
- **macOS**: Native macOS application
17+
18+
### ✅ Mobile Applications
19+
20+
- **Android**: Native Android APK
21+
- **iOS**: Native iOS application (requires macOS for building)
22+
23+
## Platform-Specific Features
24+
25+
### Web Browser
26+
27+
- Files are downloaded to the browser's default download location
28+
- Standard browser download dialog
29+
30+
### Desktop (Windows/Linux/macOS)
31+
32+
- File save dialog allows users to choose save location
33+
- Full file system access
34+
35+
### Android
36+
37+
- Files are automatically saved to the Downloads folder
38+
- Requires storage permissions (automatically requested)
39+
- Optimized for mobile touch interface
40+
41+
## Building for Different Platforms
42+
43+
### Web
44+
45+
```bash
46+
npm run build
47+
npm run preview
48+
```
49+
50+
### Desktop
51+
52+
```bash
53+
npx tauri build
54+
```
55+
56+
### Android
57+
58+
```bash
59+
npx tauri android build
60+
```
61+
62+
### iOS (requires macOS)
63+
64+
```bash
65+
npx tauri ios build
66+
```
67+
68+
## Android Development Setup
69+
70+
1. Install Android Studio
71+
2. Install Android SDK
72+
3. Set up environment variables:
73+
74+
```bash
75+
export ANDROID_HOME=/path/to/android-sdk
76+
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
77+
```
78+
79+
4. **Important**: Update the bundle identifier in `src-tauri/tauri.conf.json`:
80+
81+
```json
82+
{
83+
"identifier": "com.yourcompany.yourapp"
84+
}
85+
```
86+
87+
The default `com.tauri.dev` is not allowed for production.
88+
89+
5. Initialize Android support:
90+
91+
```bash
92+
npx tauri android init
93+
```
94+
95+
6. Build debug version:
96+
```bash
97+
npx tauri android build --debug
98+
```
99+
100+
**Note**: If you change the bundle identifier after running `android init`, you must delete the `src-tauri/gen/android` folder and run `tauri android init` again.
101+
102+
## File Permissions
103+
104+
### Android
105+
106+
The app requests the following permissions:
107+
108+
- `WRITE_EXTERNAL_STORAGE` - To save compressed images
109+
- `READ_EXTERNAL_STORAGE` - To access image files
110+
- `READ_MEDIA_IMAGES` - For Android 13+ compatibility
111+
112+
### Desktop
113+
114+
- File system access through native dialogs
115+
- User explicitly chooses save locations
116+
117+
### Web
118+
119+
- No special permissions required
120+
- Uses browser's download functionality
121+
122+
## Features Available on All Platforms
123+
124+
- Image compression with quality control
125+
- Batch processing of multiple images
126+
- ZIP file creation for bulk downloads
127+
- Individual image downloads
128+
- Support for JPG, PNG, WEBP formats
129+
- Real-time compression progress
130+
- Drag and drop interface
131+
- Dark/light theme support
132+
133+
## Troubleshooting
134+
135+
### Android Build Issues
136+
137+
1. **Bundle Identifier Error**
138+
139+
```
140+
Error: You must change the bundle identifier in `tauri.conf.json identifier`.
141+
The default value `com.tauri.dev` is not allowed.
142+
```
143+
144+
**Solution**:
145+
- Update `src-tauri/tauri.conf.json` with a unique identifier
146+
- Delete `src-tauri/gen/android` folder
147+
- Run `npx tauri android init` again
148+
149+
2. **Project Directory Not Found**
150+
151+
```
152+
Error: Project directory /path/to/com/yourcompany/yourapp does not exist.
153+
```
154+
155+
**Solution**:
156+
- Delete `src-tauri/gen/android` folder
157+
- Run `npx tauri android init` to regenerate
158+
159+
3. **Android SDK Not Found**
160+
161+
```
162+
Error: Android SDK not found
163+
```
164+
165+
**Solution**:
166+
- Install Android Studio
167+
- Set ANDROID_HOME environment variable
168+
- Add Android SDK tools to PATH
169+
170+
### Desktop Build Issues
171+
172+
1. **Missing Dependencies**
173+
- Install system dependencies for your OS
174+
- Check Tauri prerequisites documentation
175+
176+
### General Issues
177+
178+
1. **Build Failures**
179+
- Run `npm run build` first
180+
- Check for TypeScript errors
181+
- Ensure all dependencies are installed
182+
183+
2. **Permission Issues**
184+
- Check platform-specific permissions
185+
- Ensure proper capabilities are set in `default.json`

0 commit comments

Comments
 (0)