# festivities/raspberry architecture

> Architecture diagram of the GitHub repository festivities/raspberry, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/festivities/raspberry
- Repository: https://github.com/festivities/raspberry

## Overview

Raspberry is an offline compatibility patcher and cross-platform runtime for the discontinued LINE PLAY 10.1.0 client. The user supplies an exact APK or decrypted IPA and a Cherry server endpoint; the CLI verifies and patches the package (Android output is signed, iOS output is unsigned), then the installed client routes selected traffic and supports Discord sign-in, re-authentication, and server-hosted pages/notices. The graph preserves the documented Android and iOS capabilities. Several runtime files were not sampled, so those internal links are shown only where the README or source index supports them.

Main entry points: [`cmd/raspberry/main.go`](https://github.com/festivities/raspberry/blob/main/cmd/raspberry/main.go) (Patcher CLI), [`android/src/dev/raspberry/Raspberry.java`](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/Raspberry.java) (Android runtime), [`android/src/dev/raspberry/core/Attempt.java`](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/Attempt.java) (Discord sign-in), [`internal/apk/apk.go`](https://github.com/festivities/raspberry/blob/main/internal/apk/apk.go) (APK patching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patching["Package patching"]
  node_cli["Patcher CLI<br/>[main.go]"]
  node_baseline["Baseline verification<br/>[baseline.go]"]
  node_apk["APK patching<br/>[apk.go]"]
  node_dexpatch["DEX edits<br/>[Edits.java]"]
  node_signing["APK signing<br/>[sign.go]"]
  node_ipa["IPA inspect and patch<br/>[patch.go]"]
end

subgraph group_android["Android runtime"]
  node_android_app["Android runtime<br/>[Raspberry.java]"]
  node_android_auth["Discord sign-in<br/>[Attempt.java]"]
  node_auth_url["Auth URL and callback<br/>[AuthUrl.java]"]
  node_endpoint_descriptor["Endpoint descriptor<br/>[Descriptor.java]"]
  node_reauth["Re-auth state<br/>[ReauthState.java]"]
  node_web_notice["Web pages and notices<br/>[NoticeRewrite.java]"]
end

subgraph group_ios["iOS runtime"]
  node_ios_auth["iOS sign-in runtime"]
  node_ios_notice["iOS notice requests"]
  node_ios_router["iOS URL routing<br/>[RBSocketRouter.c]"]
end

subgraph group_routing["Network routing"]
  node_native_routes["Native endpoint routing<br/>[endpoint.c]"]
  node_native_reauth["Native re-auth hooks<br/>[reauth_android.c]"]
end

node_operator(("Player / operator"))
node_cherry[("Cherry server")]
node_discord["Discord OAuth"]

node_operator -->|"supplies package and endpoint"| node_cli
node_cli -->|"verifies input"| node_baseline
node_cli -->|"patches Android"| node_apk
node_cli -->|"inspects or patches iOS"| node_ipa
node_apk -.->|"applies DEX changes"| node_dexpatch
node_cli -->|"signs Android output"| node_signing
node_operator -->|"launches patched app"| node_android_app
node_android_app -->|"starts sign-in"| node_android_auth
node_android_auth -->|"builds auth request"| node_auth_url
node_android_auth -->|"exchanges auth ticket"| node_cherry
node_cherry -->|"delegates OAuth"| node_discord
node_android_app -->|"loads endpoint config"| node_endpoint_descriptor
node_android_app -->|"coordinates re-auth"| node_reauth
node_native_reauth -.->|"signals reset state"| node_reauth
node_android_app -->|"rewrites web and notice URLs"| node_web_notice
node_operator -->|"signs in on iOS"| node_ios_auth
node_ios_auth -->|"uses server auth flow"| node_cherry
node_operator -->|"opens in-app pages"| node_ios_notice
node_ios_router -->|"routes selected traffic"| node_cherry
node_native_routes -->|"routes selected traffic"| node_cherry

click node_cli "https://github.com/festivities/raspberry/blob/main/cmd/raspberry/main.go"
click node_baseline "https://github.com/festivities/raspberry/blob/main/internal/baseline/baseline.go"
click node_apk "https://github.com/festivities/raspberry/blob/main/internal/apk/apk.go"
click node_dexpatch "https://github.com/festivities/raspberry/blob/main/tools/dexpatch/src/dev/raspberry/dexpatch/Edits.java"
click node_signing "https://github.com/festivities/raspberry/blob/main/internal/sign/sign.go"
click node_ipa "https://github.com/festivities/raspberry/blob/main/internal/ipa/patch.go"
click node_android_app "https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/Raspberry.java"
click node_android_auth "https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/Attempt.java"
click node_auth_url "https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/AuthUrl.java"
click node_endpoint_descriptor "https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/Descriptor.java"
click node_reauth "https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/ReauthState.java"
click node_web_notice "https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/NoticeRewrite.java"
click node_ios_auth "https://github.com/festivities/raspberry/blob/main/ios/RBAuthFlowCoordinator.h"
click node_ios_notice "https://github.com/festivities/raspberry/blob/main/ios/RBNoticeRouteClient.h"
click node_ios_router "https://github.com/festivities/raspberry/blob/main/ios/RBSocketRouter.c"
click node_native_routes "https://github.com/festivities/raspberry/blob/main/native/endpoint.c"
click node_native_reauth "https://github.com/festivities/raspberry/blob/main/native/reauth_android.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_baseline,node_apk,node_dexpatch,node_signing,node_ipa toneBlue
class node_android_app,node_android_auth,node_auth_url,node_endpoint_descriptor,node_reauth,node_web_notice,node_cherry toneAmber
class node_ios_auth,node_ios_notice,node_ios_router toneMint
class node_native_routes,node_native_reauth toneRose
class node_operator,node_discord toneIndigo
```

## Components

### Package patching

- [Patcher CLI](https://github.com/festivities/raspberry/blob/main/cmd/raspberry/main.go): `cmd/raspberry/main.go`
- [Baseline verification](https://github.com/festivities/raspberry/blob/main/internal/baseline/baseline.go): `internal/baseline/baseline.go`
- [APK patching](https://github.com/festivities/raspberry/blob/main/internal/apk/apk.go): `internal/apk/apk.go`
- [DEX edits](https://github.com/festivities/raspberry/blob/main/tools/dexpatch/src/dev/raspberry/dexpatch/Edits.java): `tools/dexpatch/src/dev/raspberry/dexpatch/Edits.java`
- [APK signing](https://github.com/festivities/raspberry/blob/main/internal/sign/sign.go): `internal/sign/sign.go`
- [IPA inspect and patch](https://github.com/festivities/raspberry/blob/main/internal/ipa/patch.go): `internal/ipa/patch.go`

### Android runtime

- [Android runtime](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/Raspberry.java): `android/src/dev/raspberry/Raspberry.java`
- [Discord sign-in](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/Attempt.java): `android/src/dev/raspberry/core/Attempt.java`
- [Auth URL and callback](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/AuthUrl.java): `android/src/dev/raspberry/core/AuthUrl.java`
- [Endpoint descriptor](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/Descriptor.java): `android/src/dev/raspberry/core/Descriptor.java`
- [Re-auth state](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/ReauthState.java): `android/src/dev/raspberry/core/ReauthState.java`
- [Web pages and notices](https://github.com/festivities/raspberry/blob/main/android/src/dev/raspberry/core/NoticeRewrite.java): `android/src/dev/raspberry/core/NoticeRewrite.java`

### iOS runtime

- [iOS sign-in runtime](https://github.com/festivities/raspberry/blob/main/ios/RBAuthFlowCoordinator.h): `ios/RBAuthFlowCoordinator.h`
- [iOS notice requests](https://github.com/festivities/raspberry/blob/main/ios/RBNoticeRouteClient.h): `ios/RBNoticeRouteClient.h`
- [iOS URL routing](https://github.com/festivities/raspberry/blob/main/ios/RBSocketRouter.c): `ios/RBSocketRouter.c`

### Network routing

- [Native endpoint routing](https://github.com/festivities/raspberry/blob/main/native/endpoint.c): `native/endpoint.c`
- [Native re-auth hooks](https://github.com/festivities/raspberry/blob/main/native/reauth_android.c): `native/reauth_android.c`

### Other components

- **Player / operator**
- **Cherry server**
- **Discord OAuth**

## Connections

- Player / operator → Patcher CLI: supplies package and endpoint (evidence: `README.md`)
- Patcher CLI → Baseline verification: verifies input (evidence: `cmd/raspberry/main.go`)
- Patcher CLI → APK patching: patches Android (evidence: `README.md`)
- Patcher CLI → IPA inspect and patch: inspects or patches iOS (evidence: `README.md`)
- APK patching → DEX edits: applies DEX changes
- Patcher CLI → APK signing: signs Android output (evidence: `README.md`)
- Player / operator → Android runtime: launches patched app (evidence: `README.md`)
- Android runtime → Discord sign-in: starts sign-in (evidence: `android/src/dev/raspberry/Raspberry.java`)
- Discord sign-in → Auth URL and callback: builds auth request (evidence: `android/src/dev/raspberry/core/Attempt.java`)
- Discord sign-in → Cherry server: exchanges auth ticket (evidence: `README.md`)
- Cherry server → Discord OAuth: delegates OAuth (evidence: `README.md`)
- Android runtime → Endpoint descriptor: loads endpoint config (evidence: `android/src/dev/raspberry/Raspberry.java`)
- Android runtime → Re-auth state: coordinates re-auth (evidence: `android/src/dev/raspberry/Raspberry.java`)
- Native re-auth hooks → Re-auth state: signals reset state
- Android runtime → Web pages and notices: rewrites web and notice URLs (evidence: `android/src/dev/raspberry/Raspberry.java`)
- Player / operator → iOS sign-in runtime: signs in on iOS (evidence: `README.md`)
- iOS sign-in runtime → Cherry server: uses server auth flow (evidence: `README.md`)
- Player / operator → iOS notice requests: opens in-app pages (evidence: `README.md`)
- iOS URL routing → Cherry server: routes selected traffic (evidence: `README.md`)
- Native endpoint routing → Cherry server: routes selected traffic (evidence: `README.md`)
