Skip to content

pashechello/kotkit

Repository files navigation

KotKit Basic

AI-powered Android client for automated TikTok video posting.

This is the mobile client app that works with KotKit's backend AI service. The app sends screenshots to the backend, receives intelligent actions (tap, swipe, type), and executes them via Android Accessibility Service. All AI/VLM processing happens on the server - the app contains zero AI models locally.

Why open source? Transparency and trust. You can verify that the app only:

  • Accesses TikTok (no other apps)
  • Sends screenshots to backend API for analysis
  • Does NOT collect personal data, passwords, or contacts

For individual creators and content publishers.


πŸ” ΠŸΡ€ΠΎΠ²Π΅Ρ€ΡŒΡ‚Π΅ ΠΊΠΎΠ΄ сами / Verify the Code

НС довСряйтС - ΠΏΡ€ΠΎΠ²Π΅Ρ€ΡŒΡ‚Π΅! Don't trust - verify!

Π’ΡΡ‚Π°Π²ΡŒΡ‚Π΅ ссылку Π² любой AI (Claude, ChatGPT, DeepSeek):

https://github.com/pashechello/kotkit

БпроситС / Ask:

ΠŸΡ€ΠΎΠ°Π½Π°Π»ΠΈΠ·ΠΈΡ€ΡƒΠΉ этот Android ΠΏΡ€ΠΎΠ΅ΠΊΡ‚. Как Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ Accessibility Service ΠΈ ΠΊ ΠΊΠ°ΠΊΠΈΠΌ прилоТСниям ΠΎΠ½ ΠΈΠΌΠ΅Π΅Ρ‚ доступ? КакиС Ρ€Π°Π·Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ Π·Π°ΠΏΡ€Π°ΡˆΠΈΠ²Π°Π΅Ρ‚ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅? КакиС Π΄Π°Π½Π½Ρ‹Π΅ ΠΎΡ‚ΠΏΡ€Π°Π²Π»ΡΡŽΡ‚ΡΡ Π½Π° сСрвСр?
Analyze this Android app. How does the Accessibility Service work and which apps can it access? What permissions does the app request? What data is sent to the server?

AI ΠΏΡ€ΠΎΡ‡ΠΈΡ‚Π°Π΅Ρ‚ вСсь ΠΊΠΎΠ΄ ΠΈ скаТСт Ρ‡Ρ‚ΠΎ Ρ‚Π°ΠΌ. / AI will read all code and tell you what's there.


Features

Personal Mode (Creator Mode)

Default mode for content creators who want to automate their own content posting:

  • Automated Video Posting - Schedule and publish videos to TikTok automatically
  • Smart Scheduler - AI-powered optimal posting time suggestions based on audience activity
  • Video Queue - Manage multiple videos with drag-and-drop reordering
  • AI Caption Generation - Generate engaging captions and hashtags via backend API
  • Publishing History - Track all published videos with analytics
  • Localization - Russian and English languages supported

Worker Mode (Network Mode)

Π—Π°Ρ€Π°Π±Π°Ρ‚Ρ‹Π²Π°ΠΉΡ‚Π΅ Π½Π° своём TikTok Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚Π΅!

KotKit Network соСдиняСт Π±Ρ€Π΅Π½Π΄Ρ‹ (Ρ€Π΅ΠΊΠ»Π°ΠΌΠΎΠ΄Π°Ρ‚Π΅Π»Π΅ΠΉ) с Π²Π»Π°Π΄Π΅Π»ΡŒΡ†Π°ΠΌΠΈ TikTok Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚ΠΎΠ². Π‘Ρ€Π΅Π½Π΄Ρ‹ платят Π·Π° ΠΏΡƒΠ±Π»ΠΈΠΊΠ°Ρ†ΠΈΡŽ своих Π²ΠΈΠ΄Π΅ΠΎ Π½Π° вашСм Π°ΠΊΠΊΠ°ΡƒΠ½Ρ‚Π΅.

Как это Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚:

  1. Π’Ρ‹ Π²ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚Π΅ Worker Mode Π² ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ
  2. ΠŸΠΎΠ»ΡƒΡ‡Π°Π΅Ρ‚Π΅ Π·Π°Π΄Π°Ρ‡ΠΈ ΠΎΡ‚ Π±Ρ€Π΅Π½Π΄ΠΎΠ² (Π²ΠΈΠ΄Π΅ΠΎ + описаниС)
  3. ΠŸΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ автоматичСски ΠΏΡƒΠ±Π»ΠΈΠΊΡƒΠ΅Ρ‚ Π²ΠΈΠ΄Π΅ΠΎ Π² ваш TikTok
  4. Π§Π΅Ρ€Π΅Π· 24 часа провСряСтся Ρ‡Ρ‚ΠΎ Π²ΠΈΠ΄Π΅ΠΎ Π½Π΅ ΡƒΠ΄Π°Π»Π΅Π½ΠΎ
  5. Π’Ρ‹ ΠΏΠΎΠ»ΡƒΡ‡Π°Π΅Ρ‚Π΅ ΠΎΠΏΠ»Π°Ρ‚Ρƒ Π·Π° ΠΊΠ°ΠΆΠ΄Ρ‹ΠΉ ΡƒΡΠΏΠ΅ΡˆΠ½Ρ‹ΠΉ пост

ВозмоТности:

  • Task Assignment - Receive posting tasks from advertisers
  • Automated Publishing - Download and publish videos automatically
  • Reward System - Earn USD for each successful publication
  • Payout Options - Withdraw via cryptocurrency, bank cards, or local payment systems (Π‘Π‘ΠŸ, ΠΊΠ°Ρ€Ρ‚Ρ‹)
  • Anti-Fraud Protection - 24-hour verification ensures fair payment
  • Resume Downloads - Network interruption recovery for large video files

Requirements

  • Android 7.0 (API 24) or higher
  • TikTok app installed
  • Accessibility Service permission enabled

Screen Unlock

KotKit uses only Accessibility Service for screen unlock β€” no ADB, no root, no special setup required.

Lock Type How It Works
Swipe only Accessibility Service swipes to unlock
PIN Reads PIN pad from UI tree, taps each digit
Password Coming soon

How PIN unlock works

  1. User saves PIN in the app (stored encrypted via Android Keystore)
  2. When posting time comes, app wakes the screen
  3. Accessibility Service swipes up to show PIN pad
  4. Reads PIN button coordinates from rootInActiveWindow (UI tree)
  5. Uses dispatchGesture() to tap each digit
  6. Phone unlocked β†’ TikTok opens β†’ video posted

Key insight: Android's TalkBack (for visually impaired users) works on lockscreen. Our Accessibility Service uses the same APIs, so it works too β€” even on MIUI/HyperOS where shell commands are blocked.

Why no ADB?

Previous versions used ADB/Wireless Debugging for PIN entry. We removed it because:

  • Complex setup (Developer Options, pairing codes)
  • Breaks after reboot
  • Doesn't work on some devices (MIUI blocks shell input)
  • Accessibility approach is simpler and more reliable

Installation

From Releases

  1. Download the latest APK from Releases
  2. Install APK on your device (enable "Install from unknown sources" if needed)
  3. Open the app and follow the setup wizard
  4. Enable Accessibility Service in Android Settings

Build from Source

# Clone the repository
git clone https://github.com/pashechello/kotkit.git
cd kotkit

# Configure local.properties (optional, for release signing)
cat > local.properties << EOF
sdk.dir=/path/to/your/Android/sdk
RELEASE_STORE_FILE=path/to/your/keystore.jks
RELEASE_STORE_PASSWORD=your_store_password
RELEASE_KEY_ALIAS=your_key_alias
RELEASE_KEY_PASSWORD=your_key_password
EOF

# Build debug APK
./gradlew assembleDebug

# APK will be in app/build/outputs/apk/debug/

How It Works

Client-Server Architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   πŸ“± Your Android Device         β”‚
β”‚                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  KotKit Basic (this app)  β”‚  β”‚
β”‚  β”‚                           β”‚  β”‚
β”‚  β”‚  1. Capture screenshot    │──┼──┐
β”‚  β”‚  2. Send to backend API   β”‚  β”‚  β”‚  HTTPS + JWT
β”‚  β”‚  3. Receive action        β”‚β—„β”€β”Όβ”€β”€β”˜  (api.kotkit.pro)
β”‚  β”‚  4. Execute via           β”‚  β”‚
β”‚  β”‚     AccessibilityService  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚     TikTok App            β”‚  β”‚
β”‚  β”‚  (automated by above)     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
                β”‚ Screenshot (JPEG, 720x1440)
                β”‚ UI Tree (accessibility nodes)
                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  ☁️  KotKit Backend (closed)    β”‚
β”‚                                  β”‚
β”‚  - Vision-Language Model (VLM)  β”‚
β”‚  - AI decision making            β”‚
β”‚  - Action planning               β”‚
β”‚                                  β”‚
β”‚  Returns: {action: "tap",        β”‚
β”‚            x: 540, y: 960}       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Publishing Flow:

  1. Unlock Screen - Automatically unlocks the device if needed
  2. Launch TikTok - Opens TikTok via share intent with the video
  3. AI-Guided Navigation - Backend VLM analyzes screenshots and provides actions
  4. Add Caption - Enters the caption and hashtags
  5. Publish - Taps the publish button and verifies success
  6. Extract Link - Copies the published video URL for tracking

What stays on device:

  • Video files (in your gallery)
  • Posting history (SQLite database)
  • Encrypted credentials (Android Keystore)

What goes to backend:

  • Screenshots of TikTok UI (for AI analysis)
  • UI accessibility tree (button coordinates)
  • Task context (caption, video filename)

No AI models on device - all intelligence is server-side. This keeps the app small, fast, and allows us to improve the AI without requiring app updates.

Architecture

kotkit-basic/
β”œβ”€β”€ app/
β”‚   └── src/main/kotlin/com/kotkit/basic/
β”‚       β”œβ”€β”€ agent/              # PostingAgent - Core posting logic
β”‚       β”‚   β”œβ”€β”€ PostingAgent.kt
β”‚       β”‚   β”œβ”€β”€ AgentState.kt
β”‚       β”‚   └── ActionHandler.kt
β”‚       β”œβ”€β”€ executor/           # ActionExecutor - UI automation
β”‚       β”‚   β”œβ”€β”€ accessibility/  # Accessibility Service
β”‚       β”‚   β”œβ”€β”€ screen/         # Screen unlock, wake lock
β”‚       β”‚   β”œβ”€β”€ screenshot/     # Screenshot capture
β”‚       β”‚   └── humanizer/      # Human-like action timing
β”‚       β”œβ”€β”€ scheduler/          # SmartScheduler (Personal Mode)
β”‚       β”‚   β”œβ”€β”€ SmartScheduler.kt
β”‚       β”‚   β”œβ”€β”€ PostWorker.kt
β”‚       β”‚   └── SchedulerReceiver.kt
β”‚       β”œβ”€β”€ network/            # Network workers (Worker Mode)
β”‚       β”‚   β”œβ”€β”€ NetworkWorkerService.kt
β”‚       β”‚   β”œβ”€β”€ NetworkTaskExecutor.kt
β”‚       β”‚   β”œβ”€β”€ VideoDownloader.kt
β”‚       β”‚   └── HeartbeatWorker.kt
β”‚       β”œβ”€β”€ data/
β”‚       β”‚   β”œβ”€β”€ local/          # Room database
β”‚       β”‚   β”œβ”€β”€ remote/api/     # Retrofit API client
β”‚       β”‚   └── repository/     # Data repositories
β”‚       β”œβ”€β”€ di/                 # Hilt DI modules
β”‚       β”œβ”€β”€ security/           # SSL pinning, integrity checks
β”‚       └── ui/
β”‚           β”œβ”€β”€ screens/        # Compose UI screens
β”‚           β”œβ”€β”€ components/     # Reusable components
β”‚           └── navigation/     # Navigation graph
└── README.md

Technology Stack

  • Language: Kotlin
  • UI: Jetpack Compose + Material 3
  • DI: Hilt (Dagger)
  • Database: Room
  • Network: Retrofit + OkHttp with SSL pinning
  • Background: WorkManager + Foreground Services
  • Async: Coroutines + Flow
  • Security: Android Keystore (encrypted PIN storage), Conscrypt (TLS)

API Integration

The app communicates with the KotKit backend API for:

  • Authentication - JWT-based auth with token refresh
  • AI Analysis - Screenshot analysis and action planning
  • Task Management - Worker mode task assignment and tracking
  • Configuration - Remote config and feature flags
  • Analytics - Usage tracking and error reporting

All AI/ML processing is server-side. The mobile app contains no local AI models.

Security

Full security documentation: SECURITY.md

Key points:

  • Accessibility Service is TikTok-only - enforced at Android OS level via packageNames attribute
  • 3-layer package restriction - XML manifest + runtime constant + event filtering
  • Server cannot bypass restrictions - it can only send action commands, not change which apps are accessible
  • PIN encrypted with AES-256-GCM - stored locally, never transmitted to server
  • SSL certificate pinning - only communicates with api.kotkit.pro
  • No dangerous permissions - no contacts, SMS, camera, microphone, location

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

Apache License 2.0 - see LICENSE

Support