Android application to manage files in the cloud using Telegram as a backend. Your cloud, your rules π.
- Large files: Uses chunked upload (4MB) for files of any size.
- Unlimited storage: Telegram imposes no practical storage limits.
- Multiple bots: Support for multiple bot tokens with intelligent distribution.
- Dynamic Token Allocation: Automatically distributes bot tokens based on active operations:
- Single operation uses all tokens for maximum speed
- Multiple operations share tokens fairly (up to 5 concurrent operations)
- Parallel upload/download: Chunks are processed simultaneously across available tokens.
- Immediate Cancellation: Cancel operations instantly without waiting for current chunk to finish.
- Streaming Downloads: Memory-efficient streaming directly to disk prevents OutOfMemory errors.
- Batch Processing: Smart batching for gallery sync with configurable batch sizes.
- Resume Support: Automatically resume interrupted uploads and downloads.
- Orphaned Chunk Cleanup: Properly cleans up incomplete chunks when operations are cancelled.
- Token Fallback: Automatically tries alternative bot tokens if file is unavailable with primary token.
- Multi-Device Synchronization: Sync your files across unlimited devices instantly to create a unified personal cloud.
- Shared Clouds: Create collaborative clouds by sharing your
Sync Channel,Bot Token, andSync Passwordwith friends or team members. - Instant Cloud Switching: Change the Sync Password in settings to instantly switch between different shared clouds (e.g., "Family", "Work", "Private") while keeping the same Bot and Channel.
- Secure Distribution: Distribute content only to specific groups by managing encryption keys.
- Continuous Sync Animation: Visual feedback with smooth rotating arc indicator during sync operations.
- Robust Error Handling: Proper handling of .webp and other file types during sync.
- Linked List Chain: Sync logs are stored as a linked chain of messages, eliminating large index downloads.
- Smart Backtracking: Devices only download new logs by traversing the chain backwards.
- Adaptive Upload: Logs are automatically compressed and adapted (Text or Document) for maximum efficiency.
- Atomic Operations: Robust transaction management with
withTransactionblocks ensures data consistency across all devices. - Crash Prevention: Fixed concurrency issues and race conditions in sync log application.
- Automatic Gallery Backup: Sync photos and videos from device gallery to cloud.
- Batch Upload: Configurable batch processing for efficient gallery synchronization.
- Progress Tracking: Real-time progress indicators for gallery uploads.
- Restore All: One-click restore of all cloud files to device.
- Background Restore: Continue restore operations even when app is closed.
- Memory Optimized: Streaming downloads prevent memory issues during large restores.
- Single File Links: Generate encrypted
.linkfiles for individual files. - Multi-File Links: Create batch
.linkfiles for sharing multiple files at once. - Dashboard Integration: Generate links directly from file selection in dashboard.
- Cross-Platform:
.linkfiles compatible with desktop version. - Password Protected: All links encrypted with user-defined passwords.
- π± Material Design 3 Interface (Jetpack Compose).
- π Dark Theme with modern aesthetics.
- π Pull-to-Refresh with custom indicators.
- π Real-time Progress: Visual feedback for all operations.
- π¬ Integrated Video Player (ExoPlayer).
- π Search & Sort: Find and organize files easily.
- β Batch Operations: Select multiple files for download/delete/share.
- Encrypted Backups: Secure database with SQLCipher.
- Encrypted Links: All
.linkfiles password-protected. - No Analytics: No external tracking or data collection.
- Atomic Transactions: Database operations wrapped in transactions for consistency.
- ProGuard Optimized: Release builds properly configured with R8/ProGuard rules.
- Android 9.0 (API 28) or higher.
- Telegram Bot (Token obtained from @BotFather).
- Internet Connection.
- Android SDK with API 28+.
- Android NDK (Recommended version: r25c).
- CMake 3.22+.
- Linux/WSL (Ubuntu 22.04+ recommended).
- Packages:
git,wget,tar,perl,build-essential,tcl,dos2unix.
Go to the Releases section and download the latest version.
Follow the instructions below.
Due to the complexity of native dependencies (C++), follow these steps strictly in order.
Install the necessary tools and configure the paths. Adjust ANDROID_NDK_HOME if your version is different.
# Install system dependencies
sudo apt-get update
sudo apt-get install -y git wget tar perl build-essential tcl dos2unixexport ANDROID_HOME="$HOME/android-sdk"
export ANDROID_NDK_HOME="$HOME/android-sdk/ndk/25.2.9519653"
export API=28This step is necessary to inject configurations that the original scripts do not contemplate (such as static OpenSSL paths and Ninja fixes). Copy and paste this complete block into your terminal:
mkdir -p "$HOME/cmake-wrap"
cat > "$HOME/cmake-wrap/cmake" << 'EOF'
#!/bin/bash
# Wrapper to fix compilation on Android NDK
for arg in "$@"; do
# Fix Ninja error: "-j" empty -> "-jN"
if [ "$arg" = "--build" ]; then
exec /usr/bin/cmake --build . -- -j$(nproc)
fi
# Fix Ninja error: "--config Release" not supported
if [ "$arg" = "--install" ]; then
exec /usr/bin/cmake --install .
fi
done
# Inject OpenSSL paths and force static libraries
exec /usr/bin/cmake \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_LIBDIR=lib \
-DOPENSSL_ROOT_DIR="$OPENSSL_ROOT_DIR" \
-DOPENSSL_INCLUDE_DIR="$OPENSSL_ROOT_DIR/include" \
-DOPENSSL_CRYPTO_LIBRARY="$OPENSSL_ROOT_DIR/lib/libcrypto.a" \
-DOPENSSL_SSL_LIBRARY="$OPENSSL_ROOT_DIR/lib/libssl.a" \
"$@"
EOF
chmod +x "$HOME/cmake-wrap/cmake"
export PATH="$HOME/cmake-wrap:$PATH"Download the libraries and prepare SQLCipher (which requires a manual code generation step).
mkdir -p $HOME/android-native-sources
cd $HOME/android-native-sources
# Download OpenSSL and Curl
wget https://www.openssl.org/source/openssl-3.2.0.tar.gz && tar xf openssl-3.2.0.tar.gz
wget https://curl.se/download/curl-8.7.1.tar.gz && tar xf curl-8.7.1.tar.gz
# Download and Prepare SQLCipher
git clone https://github.com/sqlcipher/sqlcipher.git
cd sqlcipher
./configure
make sqlite3.c
find $HOME/android-native-sources/openssl-3.2.0 -type f -exec dos2unix {} \;Now we create the CMakeLists.txt configuration file that SQLCipher needs:
cat > CMakeLists.txt << 'EOF'
cmake_minimum_required(VERSION 3.22)
project(sqlcipher C)
find_package(OpenSSL REQUIRED)
add_library(sqlcipher STATIC sqlite3.c)
target_include_directories(sqlcipher PUBLIC ${OPENSSL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(sqlcipher PRIVATE
-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_ENABLE_JSON1
-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS5
-DSQLITE_ENABLE_RTREE -DSQLCIPHER_CRYPTO_OPENSSL -DANDROID
-DSQLITE_EXTRA_INIT=sqlcipher_extra_init
-DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown
)
target_link_libraries(sqlcipher Private OpenSSL::Crypto)
install(TARGETS sqlcipher ARCHIVE DESTINATION lib)
install(FILES sqlite3.h DESTINATION include)
EOFTo avoid errors on old devices (ARMv7), we must disable the assembler in OpenSSL. We modify the original script to allow option injection.
cd /mnt/c/Users/Lenovo/Desktop/jugar/prueba-github
sed -i "s|./Configure|./Configure \$OPENSSL_OPTS -fPIC|g" telegram-cloud-cpp/third_party/android_build_scripts/build_openssl_android.shRun this block to compile OpenSSL, Libcurl, and SQLCipher for both architectures (arm64-v8a and armeabi-v7a).
mkdir -p $HOME/android-native-builds/{openssl,libcurl,sqlcipher}
for ABI in arm64-v8a armeabi-v7a; do
echo ">>> Compiling for $ABI..."
# Define specific options for ARMv7
export OPENSSL_OPTS=""
if [ "$ABI" == "armeabi-v7a" ]; then
export OPENSSL_OPTS="no-asm"
fi
# 1. Compile OpenSSL
./telegram-cloud-cpp/third_party/android_build_scripts/build_openssl_android.sh \
-ndk "$ANDROID_NDK_HOME" -abi "$ABI" -api "$API" \
-srcPath "$HOME/android-native-sources/openssl-3.2.0" \
-outDir "$HOME/android-native-builds/openssl"
### Important Note about ABIs and Paths
# The original scripts expect paths with **hyphens** (`build-armeabi-v7a`), but # OpenSSL compilation generates folders with **underscores** (`build_armeabi_v7a`).
# To fix it automatically before compiling Libcurl or SQLCipher:
# Rename OpenSSL folders from underscore to hyphen
cd $HOME/android-native-builds/openssl
if [ "$ABI" == "armeabi-v7a" ] && [ -d "build_armeabi_v7a" ] && [ ! -d "build-armeabi-v7a" ]; then
mv build_armeabi_v7a build-armeabi-v7a
fi
if [ "$ABI" == "arm64-v8a" ] && [ -d "build_arm64_v8a" ] && [ ! -d "build-arm64-v8a" ]; then
mv build_arm64_v8a build-arm64-v8a
fi
# Update variable for the scripts
export OPENSSL_ROOT_DIR="$HOME/android-native-builds/openssl/build-$ABI/installed"
cd -
# 2. Compile Libcurl
./telegram-cloud-cpp/third_party/android_build_scripts/build_libcurl_android.sh \
-ndk "$ANDROID_NDK_HOME" -abi "$ABI" -api "$API" \
-opensslDir "$OPENSSL_ROOT_DIR" \
-srcPath "$HOME/android-native-sources/curl-8.7.1" \
-outDir "$HOME/android-native-builds/libcurl"
# Move library if it was installed in lib64 by mistake
if [ -f "$HOME/android-native-builds/libcurl/build_${ABI}/installed/lib64/libcurl.a" ]; then
mkdir -p "$HOME/android-native-builds/libcurl/build_${ABI}/installed/lib"
cp "$HOME/android-native-builds/libcurl/build_${ABI}/installed/lib64/libcurl.a" \
"$HOME/android-native-builds/libcurl/build_${ABI}/installed/lib/"
fi
# 3. Compile SQLCipher
./telegram-cloud-cpp/third_party/android_build_scripts/build_sqlcipher_android.sh \
-ndk "$ANDROID_NDK_HOME" -abi "$ABI" -api "$API" \
-opensslDir "$OPENSSL_ROOT_DIR" \
-srcPath "$HOME/android-native-sources/sqlcipher" \
-outDir "$HOME/android-native-builds/sqlcipher"
doneConfigure Gradle with the exact paths of the compiled libraries and generate the application.
cat > local.properties <<EOF
sdk.dir=$ANDROID_HOME
ndk.dir=$ANDROID_NDK_HOME
native.openssl.arm64-v8a=/home/enovo/android-native-builds/openssl/build_arm64_v8a/installed
native.openssl.armeabi-v7a=/home/enovo/android-native-builds/openssl/build_armeabi_v7a/installed
native.curl.arm64-v8a=/home/enovo/android-native-builds/libcurl/build_arm64_v8a/installed
native.curl.armeabi-v7a=/home/enovo/android-native-builds/libcurl/build_armeabi_v7a/installed
native.sqlcipher.arm64-v8a=/home/enovo/android-native-builds/sqlcipher/build_arm64_v8a/installed
native.sqlcipher.armeabi-v7a=/home/enovo/android-native-builds/sqlcipher/build_armeabi_v7a/installed
EOF
# Fix gradlew file format (for WSL)
dos2unix android/gradlew
chmod +x android/gradlew
# Compile
cd android
./gradlew assembleDebugThe APK will appear in: android/app/build/outputs/apk/debug/app-debug.apk
telegram-cloud-android/
βββ README.md # Instructions
βββ android/ # Android Application (Kotlin)
βββ telegram-cloud-cpp/ # Native Core (C++)
βββ scripts/ # Scripts (Experimental)Fork the repository.
Create a branch (git checkout -b feature/NewFeature). Send a Pull Request.
GNU General Public License v3.0 - see LICENSE file.
Your cloud, your rules. π







