Skip to content

Commit 46a6eac

Browse files
committed
init
Signed-off-by: Denis Efremov <efremov@linux.com>
1 parent 4fbc4cf commit 46a6eac

24 files changed

Lines changed: 5373 additions & 0 deletions

.dockerignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
node_modules
2+
dist
3+
dist-ssr
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
pnpm-debug.log*
11+
12+
# Editor/IDE
13+
.vscode
14+
.idea
15+
*.sw?
16+
17+
# Git
18+
.git
19+
.gitignore
20+
21+
# Docker
22+
Dockerfile
23+
.dockerignore
24+
25+
# Misc
26+
.DS_Store
27+
*.local
28+
CLAUDE.md
29+
README.md

.github/workflows/deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v6
22+
- uses: actions/setup-node@v6
23+
with:
24+
node-version: 22
25+
cache: npm
26+
- run: npm ci
27+
- run: npm run build
28+
env:
29+
VITE_BASE_PATH: /oneplus_kernel_flasher/
30+
- uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: dist
33+
34+
deploy:
35+
needs: build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
40+
steps:
41+
- uses: actions/deploy-pages@v4
42+
id: deployment

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Build stage
2+
FROM node:22-alpine AS build
3+
4+
WORKDIR /app
5+
6+
COPY package.json package-lock.json ./
7+
RUN npm ci
8+
9+
COPY . .
10+
RUN npm run build
11+
12+
# Production stage
13+
FROM lipanski/docker-static-website:2.4.0
14+
15+
COPY --from=build /app/dist .
16+
17+
EXPOSE 3000

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# OnePlus Kernel Flasher
2+
3+
A browser-based tool for flashing Magisk-patched `init_boot.img` files to OnePlus Open devices (CPH2551) via WebUSB.
4+
5+
## Requirements
6+
7+
- Chrome, Edge, or other Chromium-based browser (WebUSB support required)
8+
- OnePlus Open (CPH2551) with unlocked bootloader
9+
- USB cable
10+
11+
## Development
12+
13+
```bash
14+
npm install
15+
npm run dev # Start development server
16+
npm run build # Build for production
17+
npm run lint # Run ESLint
18+
npm run preview # Preview production build
19+
```
20+
21+
## Docker
22+
23+
```bash
24+
# Using Docker Compose (recommended)
25+
docker compose up
26+
27+
# Or build and run manually
28+
docker build -t oneplus-kernel-flasher .
29+
docker run -p 8080:3000 oneplus-kernel-flasher
30+
```
31+
32+
The app will be available at `http://localhost:8080`.

compose.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
services:
2+
web:
3+
build: .
4+
ports:
5+
- "8080:3000"
6+
restart: unless-stopped

eslint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs.flat.recommended,
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>OnePlus Open Flasher</title>
7+
<meta name="description" content="Flash Magisk-patched init_boot.img to OnePlus Open via WebUSB" />
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)