Telegram

I BUILT OTP HOPPER AN OPEN-SOURCE ANDROID UTILITY TO FORWARD OTPS TO FRIENDS AND FAMILY

I built OTP Hopper: An Open-Source Android utility to forward OTPs to friends & family through SMS / Telegram group.

Introduction to OTP Hopper: Solving the Subscription Sharing Dilemma

We understand the modern digital friction associated with sharing subscription services. Whether it is Netflix, Hotstar, or banking applications, the primary account holder often faces the tedious task of manually relaying One-Time Passwords (OTPs) to friends or family members. This process interrupts workflows and introduces a delay that can be frustrating for all parties involved. To address this common annoyance, we have developed OTP Hopper, a robust, open-source Android utility designed to automate and secure the forwarding of verification codes.

OTP Hopper is not merely a script; it is a sophisticated application built with modern Android development standards. We designed it to detect specific incoming SMS messages and automatically route them to a pre-defined list of phone numbers or a dedicated Telegram group. By leveraging a foreground service, the application ensures reliability even on devices with aggressive battery management, such as Motorola smartphones. Our commitment to privacy is paramount; all message processing occurs locally on the device, ensuring no sensitive data is stored in the cloud. As an MIT-licensed open-source project, we invite the developer community to audit, modify, and contribute to the codebase available on GitHub.

Core Functionality: How OTP Hopper Works

We engineered OTP Hopper to be intuitive yet powerful. The application operates on a simple premise: intercept specific SMS messages based on user-defined keywords and forward the content immediately. This functionality is achieved through a combination of native Android components and modern Kotlin libraries.

Automatic SMS Detection and Parsing

The core of the utility lies in its ability to listen for incoming SMS broadcasts. We utilize Android’s BroadcastReceiver to detect new messages the moment they arrive. However, we do not process every message indiscriminately. To preserve user privacy and minimize unnecessary notifications, we implemented a Keyword Filter system. Users can specify exact phrases or keywords—such as “JioHotstar verification code” or “Netflix OTP”—ensuring that only relevant messages trigger the forwarding mechanism. This filtering logic prevents the accidental exposure of personal conversations or unrelated two-factor authentication codes.

Multi-Channel Forwarding Capabilities

Flexibility is key to a utility tool. We recognized that users communicate through different channels, so we integrated two primary forwarding methods:

  1. SMS Forwarding: The application can repackage the intercepted OTP and send it as a standard SMS to a list of authorized phone numbers. This is ideal for users who prefer direct text messages or for recipients who may not have Telegram installed.
  2. Telegram Group Broadcasting: For tech-savvy users and families managing shared accounts, we integrated direct Telegram API support. OTPs can be pushed instantly to a specific Telegram group. This method offers a persistent chat history, making it easy for multiple users to access the code without sifting through SMS logs.

Technical Architecture: Built with Modern Android Standards

We built OTP Hopper using the latest Android technologies to ensure performance, stability, and maintainability. Our development philosophy prioritizes a reactive UI and efficient background processing.

Jetpack Compose and UDF Architecture

The user interface is built entirely with Jetpack Compose, the modern toolkit for building native UI. This allows for a declarative, fluid interface that adapts seamlessly to different screen sizes. We strictly adhered to the Unidirectional Data Flow (UDF) architecture. In this model, the UI state flows down from the ViewModel, and user events flow up as intents. This separation of concerns makes the app predictable, easier to debug, and highly testable. The result is a clean, material design interface that allows users to manage their forwarding lists and filters with ease.

Kotlin Coroutines and Foreground Services

Background processing is the most critical aspect of an OTP utility. If the Android system kills the app to save battery, OTPs will be missed. To combat this, we utilize Kotlin Coroutines for asynchronous operations, ensuring that network calls and message processing do not block the main thread. Furthermore, we implemented a persistent Foreground Service. This service displays a persistent notification to the user, signaling that the app is active. By doing so, we explicitly tell the Android OS that the app is performing important work, significantly reducing the likelihood of termination by battery savers like Motorola’s “Smart Battery” or Huawei’s “PowerGenie.”

Data Persistence with Jetpack DataStore

We replaced the legacy SharedPreferences with Jetpack DataStore. DataStore is a modern data storage solution that uses Kotlin coroutines and Flow to deliver type-safe, asynchronous data storage. We use it to store the user’s configuration—such as the list of phone numbers, the Telegram bot token, the chat ID, and the keyword filters. By leveraging Kotlin Serialization, we efficiently convert complex objects into JSON strings for storage, ensuring that data is saved and retrieved quickly without performance bottlenecks.

Privacy and Security: Processing On-Device

In an era where data privacy is a major concern, we designed OTP Hopper with a “privacy-first” mindset. Many automation tools rely on cloud servers to route messages, creating a potential point of failure and data leakage.

Local Processing Only

OTP Hopper operates entirely on the device. The logic that scans SMS content and the forwarding decision engine run locally. We do not have access to your messages, nor do we route them through a third-party server. When forwarding via Telegram, the app communicates directly with the Telegram API from your device. This architecture ensures that your verification codes remain confidential and are only seen by the intended recipients.

Open Source Transparency

Trust is built on transparency. We have released OTP Hopper under the MIT License, one of the most permissive open-source licenses. This means the code is freely available for review on GitHub. Security researchers, developers, and privacy-conscious users can inspect the source code to verify that there are no backdoors or hidden trackers. This open approach fosters community trust and encourages collaborative improvement of the security model.

Reliability: Overcoming Android Battery Restrictions

One of the biggest challenges in Android development is keeping background services alive. Manufacturers like Xiaomi, Oppo, and Motorola implement aggressive battery optimization strategies that kill background apps to extend standby time.

The Foreground Service Strategy

We tackled this head-on by implementing a robust Foreground Service. Unlike a background thread which the system can terminate silently, a foreground service requires a persistent notification in the status bar. This notification acts as a constant reminder to the user that the service is running and provides an easy exit point. While some may see the notification as intrusive, it is the most reliable method to ensure the app receives high priority from the Android OS.

Tested on Aggressive Devices

We did not develop OTP Hopper in a vacuum. It has been rigorously tested on devices known for aggressive task management, specifically Motorola devices running near-stock Android. Through these tests, we refined the logic to handle scenarios where the network might drop or the device enters Doze mode. The app recovers quickly and continues to monitor for messages without requiring manual intervention from the user.

Technology Stack: A Deep Dive

We selected a modern tech stack to ensure the app is future-proof and maintainable. This stack allows for rapid iteration and a high-quality user experience.

Use Cases: Beyond Subscription Sharing

While the primary motivation was sharing subscriptions like Netflix and Hotstar, the utility of OTP Hopper extends to various scenarios.

Shared Business Accounts

Small businesses often share access to platforms like Google Ads, Shopify, or social media accounts. Security protocols often require 2FA, which can be a bottleneck if the account owner is unavailable. OTP Hopper allows a team to receive verification codes instantly in a designated Telegram group, streamlining workflow and reducing downtime.

Family Security and Emergency Access

Families can use OTP Hopper to ensure that critical alerts—such as banking transaction confirmations or emergency service notifications—are received by multiple family members. By setting up a keyword filter for “bank” or “alert,” users can create a secondary notification system that bypasses the usual communication channels.

Automated Testing and QA

For Android developers and QA engineers, OTP Hopper serves as a practical example of SMS interception and foreground services. The codebase acts as a reference implementation for handling SmsManager APIs and managing permissions in Android 13 and above. We encourage developers to fork the repository to understand the intricacies of the Android telephony stack.

Integration Guide: Setting Up OTP Hopper

We designed the setup process to be as straightforward as possible, though certain permissions are required for the app to function correctly.

Required Permissions

  1. SMS Permissions: The app needs to read incoming SMS messages. This is standard for any SMS utility.
  2. Phone State Permission: Required to read the phone number (optional, for self-identification).
  3. Background Permission: Users must manually disable battery optimization for the app (often found in “Battery Saver” settings) to ensure the foreground service remains active.
  4. Notification Listener: While primarily using SMS receivers, this permission ensures the app can act as a backup for notification-based OTPs if needed.

Configuring Telegram Forwarding

To enable Telegram forwarding, users must:

  1. Create a new bot via the BotFather on Telegram to obtain a Bot Token.
  2. Create a private Telegram group and add the bot as an administrator.
  3. Retrieve the Chat ID of the group.
  4. Input these credentials into OTP Hopper’s settings. The app will then route intercepted SMS content to this group.

Setting Keyword Filters

Users are advised to be specific with their filters. For example, using “Amazon” as a keyword might catch too many promotional messages. Instead, “Amazon OTP” or “Your Amazon code” ensures only verification messages are forwarded. The filter logic is case-insensitive to maximize detection rates.

Open Source Community and Contribution

We believe that open source software is the backbone of the Android ecosystem. By releasing OTP Hopper under the MIT license, we empower the community to take ownership of the tool.

Collaborative Development

We welcome contributions ranging from bug reports to feature requests and pull requests. If a user discovers an edge case—perhaps a specific SMS format that isn’t parsed correctly—they can open an issue on GitHub. We actively review and merge contributions that align with the project’s vision of simplicity and reliability.

Future Roadmap

Looking ahead, we envision expanding the forwarding capabilities to include platforms like Discord or Slack. We are also exploring the integration of QR code generation for easier onboarding. By keeping the project open, we allow the community to drive these innovations organically.

Testing and Quality Assurance

We are currently in the process of polishing the application for a wider release. To ensure stability across the fragmented Android landscape, we have initiated internal testing tracks.

The Need for Testers

Android fragmentation means an app that works perfectly on a Pixel might fail on a Samsung or Xiaomi device due to vendor-specific OS modifications. We are actively seeking testers to help us identify these edge cases. Specifically, we need users with devices from manufacturers like OnePlus, Vivo, and Realme, known for their aggressive background killing policies.

How to Get Involved

We have set up Internal and Closed Testing tracks on the Google Play Console. Users interested in assisting with testing can reach out via email or direct message. In exchange for valuable feedback, testers gain early access to new features and the satisfaction of contributing to a tool that solves a genuine digital problem. We are also open to “app-for-app” testing exchanges to support fellow developers.

Troubleshooting Common Issues

We anticipate a few common hurdles during the initial setup and have proactively addressed them in the design.

Missed Messages

If messages are not being forwarded, the first step is to check the Battery Optimization settings. Android’s “Doze Mode” restricts network access and CPU usage for background apps. Users must ensure OTP Hopper is marked as “Not Optimized.”

Telegram Delivery Failures

If the bot is not posting to the group, verify that the Bot Token and Chat ID are correct. Also, ensure the bot has been added to the group and given permission to send messages. The app logs errors locally, which can help diagnose API issues.

Conclusion: The Future of Automated OTP Management

We built OTP Hopper to fill a specific niche in the Android utility landscape. It combines the raw power of native Android APIs with the elegance of modern UI design. By prioritizing on-device processing, we ensure user privacy is never compromised. The use of a foreground service guarantees that the app works when you need it most, regardless of battery saving policies.

As we move towards the official release, we invite you to join our testing program. Your feedback is instrumental in refining the app’s reliability and expanding its feature set. Whether you are a developer interested in the Jetpack Compose codebase or a user looking for a seamless way to share Netflix OTPs, OTP Hopper offers a robust, open-source solution. Visit the GitHub repository to explore the code, clone the project, or contribute to the future of automated message forwarding. Let’s build a more connected and efficient digital experience together.

Explore More
Redirecting in 20 seconds...