# Lemon8 (com.bd.nproject) Feature Analysis

## 1. Core Features
Lemon8 is a lifestyle discovery and social sharing platform built by ByteDance, tightly integrated with the TikTok ecosystem. Its primary purpose is to enable users to discover, create, and share visual lifestyle content (notes, articles, photos, and videos) through an algorithmically personalized feed. Key differentiators include:
- **Cross-Platform Social Graph:** Seamless TikTok account linking, automatic follow synchronization, and shared authentication.
- **Rich Media Creation Suite:** In-app camera, template-driven editing, advanced text/sticker customization, and filter application.
- **Creator Exposure Program:** "Lemon8 Boost" allows selected creators to opt-in to having their content featured in official ads and marketing campaigns.
- **Interest-Driven Discovery:** Onboarding flow captures user interests, pronouns, and privacy preferences to tailor the initial feed experience.

## 2. Feature Categories

### Account & Identity Management
- Multi-provider authentication: Apple, Google, and TikTok (`GGAppleLogin_loginPage_menuBtn_apple`, `GGAppleLogin_loginPage_menuBtn_google`)
- TikTok account pairing & authorization (`Lemon8_addLink_authorize_header`, `Lemon8_addLink_authorize_body_2`)
- Pronoun selection with privacy disclaimer (`NUJ_revamp_interestRecall_pronoun_disclaimer`: "(Hidden from everyone)")
- Account data export (`account_CTA_downloadL8Data`: "Download your Lemon8 data")

### Content Creation & Editing
- Camera integration with explicit permission prompts (`Camara_permission_decription`: "To take photos on Lemon8, allow access to your camera.")
- Filter & adjustment tools (`Camara_filter_nofilter`: "Original", `adjust_tab_tooltip`: "Tap to enhance and adjust photos")
- Text customization (`Customize_text_background_bubble`: "Tap to adjust background opacity and corner radius", `Customize_text_stroke_bubble`: "Text stroke is here. Try it now!")
- Template & sticker application (`Lemon8EditorAnchor_modal_specific_body`: "Try template {template} to make your photo stunning.")
- POI/Location tagging (`add_location_poi`: "Add location", `POI_distanceTag_about`: "About")

### Social & Feed Discovery
- Interest-based onboarding (`NUJ_revamp_interestRecall_header`: "Tell us more about you for a feed you'll love")
- TikTok friend sync (`TikTokFollow_onboarding_header`: "Follow the same accounts you follow on TikTok")
- Content types: Notes (`notes_detail_page`), Articles (`article_detail_page`), Videos (`video_id`, `is_immersive_video`)
- Collections & Boards (`Add_to_collections`: "Add", `added_to_favorites`: "Added to board")
- Commenting & interaction (`add_comment`: "Add comment…", `ads_cantComment_toast`: "Can’t add comments on ads for now")

### Commerce & Marketing
- Splash & rewarded ads (`HotStartSplashAdActivity`, `RewardItem`)
- Lemon8 Boost creator program (`Lemon8Boost_modal_header`: "Get exposure with Lemon8 Boost")
- Campaign & activity tracking (`activity_center_entrance`: "Active posting event", `activity_notes`: "Campaign Notes")

## 3. User-facing Capabilities
- **Create & Publish:** Capture photos/videos, apply filters, add styled text/stickers, use templates, tag locations, and publish to public or private feeds.
- **Cross-Platform Sync:** Link TikTok account to automatically follow friends when they join Lemon8, and display Lemon8 profile link on TikTok.
- **Personalize Feed:** Select interests during onboarding, switch content categories, and toggle between public/private account visibility.
- **Save & Organize:** Bookmark posts to custom collections/boards, follow users, and interact via likes/comments.
- **Opt-in to Marketing:** Accept "Lemon8 Boost" invitations to allow posts to be featured in official ads, with granular opt-out controls.
- **Data Management:** Download complete account data, manage third-party app permissions, and handle region/account changes.

## 4. Settings & Configuration
| Setting / Feature | UI Label / Key | Description / Default |
|-------------------|----------------|------------------------|
| **Account Privacy** | `accountPrivacy_onboarding_header` ("Manage account privacy") | Choose between `accountPrivacy_onboarding_CTA_public` ("Public account" - Anyone can see your posts) or `accountPrivacy_onboarding_CTA_private` ("Private account" - Only your followers can see your posts). Defaults to private if deferred. |
| **Lemon8 Boost** | `Lemon8Boost_settings_title` ("Lemon8 Boost") | Opt-in to feature posts in ads/marketing. Non-US toggle: `Lemon8Boost_settings_nonUS_switchHeader` ("Disallow Lemon8 to feature your posts"). |
| **Data Export** | `account_CTA_downloadL8Data` / `accountData_settings_entry` ("Download your Lemon8 data") | Initiates GDPR/CCPA-compliant account data package generation. |
| **App Permissions** | `Lemon8_addLink_authorize_body_3` | Path: Settings and privacy > Account > Manage app permissions. Controls third-party OAuth access. |
| **Camera Access** | `Camara_permission_android` ("Allow Lemon8 to access camera to take photos?") | Explicit runtime permission with `ALLOW`/`DENY` options. |
| **Region/Location** | `change_region` / `region_change` | Allows switching app region to adjust content localization and compliance settings. |

## 5. Background Services & System Tasks
- **`InitScheduler`**: Centralized startup orchestrator that dispatches initialization tasks across modular components (`account_impl`, `home_impl`, `video_impl`, `router_impl`, `security_api`, `setting_impl`, `ugc_post_impl`, `lynx_impl`, `popup_impl`, `posttools_impl`, `web_impl`, `business_l8_scaffold`).
- **`AppFrontBackHelper`**: Monitors application lifecycle transitions (cold/warm launch, foreground/background) to trigger analytics, state restoration, and resource management.
- **`WsConstants` / WebSocket Channel**: Maintains persistent real-time connections for app state synchronization, network state monitoring, message delivery, and heartbeat management (`KEY_HEART_BEAT_TIMEOUT`, `APP_STATE_DID_ENTER_FOREGROUND`).
- **`MediaPlayerInitTask`**: Pre-initializes the `TTVideoEngine` media pipeline during app startup to ensure instant video playback readiness.
- **`HotStartSplashAdActivity`**: Manages splash ad rendering and lifecycle during hot app resumes, with automatic dismissal logic on foreground return.
- **`Lemon8AppLinkActivity`**: Intercepts `lemon8-app.com` deep links, validates paths against onboarding whitelists, and routes to appropriate in-app destinations (notes, profiles, POIs, search).

## 6. Third-party Tool Integrations
- **TikTok Ecosystem APIs**: Deep OAuth integration (`lemon8-api.tiktokv.com/passport/open/auth/v2`), cross-platform follow sync, shared authentication tokens, and profile linking.
- **Video Processing Engine**: `ffmpeg` (external process call for media transcoding/encoding) + `com.ss.ttvideoengine` (TTVideoEngine for adaptive bitrate streaming, super-resolution, ABR switching, and hardware-accelerated playback).
- **Ad Monetization SDK**: ByteDance MSDK (`com.bytedance.msdk`) integrating Pangle, AdMob, Unity, and GDT (GroMore) for splash, rewarded, and interstitial ads.
- **AR & Camera Effects**: Google Play Services for AR (`__arcore_install_app`, `__arcore_continue`) for camera-based filters and spatial effects.
- **Analytics & Attribution**: AppsFlyer (`AF_REFERRER`, `KSAppsFlyerId`, `AF_INSTALLATION`), ByteDance Monitor (`mon.isnssdk.com`, `mon.tiktokv.com`), and crash reporting (`com.bytedance.crash`).
- **Local Storage & Caching**: `Keva` (custom high-performance key-value store), Jetpack DataStore, and WeChat DB (`com.tencent.wcdb`) for structured local caching.
- **Device Telemetry**: `getprop` system calls for hardware/OS property retrieval to optimize rendering and network strategies.

## 7. Key Workflows / User Journeys

### Onboarding & Personalization
1. User launches app → `NUJ_revamp_welcomePage_header_welcome` ("Welcome to Lemon8")
2. Privacy selection → Public/Private toggle with deferred option
3. Interest & Pronoun capture → `NUJ_revamp_interestRecall_sectionTitle_interests` ("Pick your interests")
4. TikTok Follow Sync → `TikTokFollow_onboarding_subtitle` ("These accounts may not have joined Lemon8 yet. You’ll automatically follow them when they join.")
5. Feed initialization → Algorithmic cold start with `InterestBean` and `ColdConfig` parameters

### Content Creation Pipeline
1. Open Camera → `Camera_function_entry`
2. Apply Filter/Template → `Camara_filter_nofilter` or `Lemon8EditorAnchor_modal_specific_body`
3. Add Text/Stickers → Customize stroke, background, opacity via `Customize_text_*` controls
4. Adjust & Tag → `adjust_tab_tooltip`, `add_location_poi`
5. Publish → Routes to `ugc_post_impl` pipeline, triggers `InitScheduler` post-processing tasks

### Cross-Platform Account Linking
1. User initiates link → `Lemon8_addLink_authorize_header` ("Authorize TikTok to link your Lemon8 account")
2. OAuth flow → `lemon8-api.tiktokv.com/v1/authorize`
3. Permission grant → Profile info & post access
4. Sync completion → `Lemon8Link_Lemon8_profile_header` ("Your Lemon8 link is now shown on your TikTok profile")
5. Follow queue populated → Pending accounts tracked until they join Lemon8

### Deep Link & Region Navigation
1. External tap on `lemon8-app.com/topic/` or `/poi/` URL
2. `Lemon8AppLinkActivity` intercepts intent
3. Validates against `whitePathListOnBoarding`
4. Routes via `webrouter_router_url` / `webrouter_router_path` to `notes_detail_page`, `article_detail_page`, or `user_profile`
5. Handles `change_region` redirects with `region_change` state preservation