Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #407

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
dce2863
[TF] modify .gitignore
thermatk Apr 4, 2020
903a00d
[TF][JNI] remove native deps to be replaced
thermatk Apr 4, 2020
1b5fef5
[TF][JNI] Add $(LOCAL_PATH) to LOCAL_C_INCLUDES
thermatk Jul 20, 2019
5c8aaa5
[TF][JNI][UPDATE] libwebp source to 1.0.1
thermatk Jan 25, 2019
3fa1a1a
[TF][JNI][UPDATE] FFmpeg 4.2.2 from source
thermatk Sep 15, 2019
b773b7a
[TF][JNI][UPDATE] BoringSSL from source (master)
thermatk Jan 2, 2020
606a0bc
[TF] API keys
thermatk Sep 15, 2019
79829ac
[TF][JNI][FIX] ffmpeg header included and patched
thermatk May 18, 2019
737a0a0
[TF] TravisCI support
vk496 Jul 20, 2019
8e4dfec
[TF] tiny build improvements
thermatk Jan 12, 2020
06d0d61
[TF][FEATURE] Support installing APKs
thermatk Feb 9, 2019
886e547
[TF][KILL] Hockey analytics
thermatk Jan 24, 2019
62411c6
[TF][KILL] Google Vision
thermatk Jan 3, 2020
bc26c68
[TF][KILL] Google Wallet and Android Pay
thermatk Jan 25, 2019
2d0d40e
[TF][KILL] remaining GMS(GCM, Wear, etc), except for Maps
thermatk Jan 25, 2019
f37cd11
[TF][CENSOR] PWN RKN without Firebase
thermatk Jan 25, 2019
404b1ea
[TF][CENSOR] allow to set a proxy before login
thermatk Jan 3, 2020
199d245
[TF][MAPS] force Telegram's static map previews
thermatk Jan 26, 2019
65e94e0
[TF][PUSH] push service adjustments
thermatk Jan 26, 2019
477b86e
[TF][PUSH] notification in foregroung on Oreo+
thermatk Jul 21, 2019
1cc0de1
[TF][PUSH] remove one of the confusing toggles
thermatk Mar 9, 2019
3138fed
[TF][BRAND] Do not send to Google Play for update
thermatk Jan 23, 2019
97fed2d
[TF][BRAND] Send invite link to F-Droid
thermatk May 2, 2020
a698fff
[TF][BRAND] in settings
thermatk Jan 26, 2019
07ca143
[TF][BRAND] AppName
thermatk May 2, 2020
3ecf159
[TF][KILL] remove fusedlocationprovider
thermatk Feb 22, 2020
def3308
[TF][KILL] GMS SMS Receiver
thermatk Sep 15, 2019
3c31176
[TF][KILL] Google Voice
thermatk Jan 4, 2020
c91e818
[TF][FIX] missing viewpager dependency
thermatk Jan 11, 2020
865f379
[TF][MAPS] replace Google Maps with OSMDroid: LocationActivity
thermatk Apr 4, 2020
c857f96
[TF][MAPS] replace Google Maps with OSMDroid: ChatAttachAlertLocation…
thermatk May 2, 2020
283b251
[TF][MAPS] support geo: intents
thermatk Jan 12, 2020
03cd8f6
[TF][MAPS] OSMDroid useragent and cache directory configuration
nekohasekai Apr 30, 2020
ab9bafb
[TF][FEATURE] replace Apple's emojis with twemoji
thermatk Jan 12, 2020
656920b
[TF][PUSH] default is true
thermatk Jan 12, 2020
0e398ce
[TF][PUSH] Enable push in migration case
thermatk Jan 25, 2020
16981c2
[TF][FIX] missing interpolator dependency
thermatk Apr 4, 2020
206a592
[TF][JNI] NDK r21
thermatk Apr 26, 2020
0987aab
[TF] Readme + Changelog
thermatk Jan 12, 2020
94ebeda
Update README.md
giupardeb May 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ build/
obj/
*.iml
local.properties
API_KEYS
*.hprof
TMessagesProj/.externalNativeBuild/
TMessagesProj/jni/ffmpeg/android/
TMessagesProj/jni/ffmpeg/build/
TMessagesProj/jni/boringssl/build/
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "TMessagesProj/jni/libwebp"]
path = TMessagesProj/jni/libwebp
url = https://github.com/webmproject/libwebp
[submodule "TMessagesProj/jni/ffmpeg"]
path = TMessagesProj/jni/ffmpeg
url = https://github.com/FFmpeg/FFmpeg
[submodule "TMessagesProj/jni/boringssl"]
path = TMessagesProj/jni/boringssl
url = https://github.com/google/boringssl
40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
language: android
dist: trusty
jdk:
- openjdk8
android:
components:
- build-tools-28.0.3
- android-28
addons:
apt_packages:
- ninja-build

install:
- set -e
- echo y | sdkmanager "ndk-bundle"
- echo y | sdkmanager "cmake;3.6.4111459"
- echo y | sdkmanager "lldb;3.1"
before_script:
- export NDK=$ANDROID_HOME/ndk-bundle
- export NINJA_PATH=/usr/bin/ninja
- export PATH=`echo $ANDROID_HOME/cmake/*/bin`:$PATH
- echo -e "APP_ID = ${APP_ID}\nAPP_HASH = ${APP_HASH}" > API_KEYS
script:
# If some stage fails, exit inmediatly
- set -e
# Prebuild
- "cd TMessagesProj/jni"
- "./build_ffmpeg_clang.sh"
- "./patch_ffmpeg.sh"
- "./patch_boringssl.sh"
- "./build_boringssl.sh"
- "cd ../.."
# Build
- "./gradlew assembleAfatRelease"

after_success:
- "./gradlew test"

after_script:
- "rm API_KEYS"
457 changes: 457 additions & 0 deletions Changelog.md

Large diffs are not rendered by default.

Binary file added DigitalResistance.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions Notifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Notifications

Since [Android 8.0 Oreo, Google doesn't allow apps to run in the background anymore](https://developer.android.com/about/versions/oreo/background#services), requiring all apps which were previously keeping background connection to exclusively use its Firebase push messaging service.

As one can't use Google's push messaging in a FOSS app, Telegram-FOSS has to show you a notification to keep the background service running. Otherwise, you wouldn't be notified about new messages.

Sadly, if the app would set the notification to lower priority (to hide it a bit in the lower part of the notification screen), you would immediately get a system notification about Telegram "using battery", which is confusing and is the reason for this not being the default. Despite Google's misleading warnings, there is no difference in battery usage between v4.6 in "true background" and v4.9+ with notification.

## Make it better

You may still lower the priority of the notification channel or even hide it altogether manually (make a long tap on the notification). You will then receive the misleading system notification, which [may be disabled as well with another long tap](https://9to5google.com/2017/10/26/how-to-disable-android-oreo-using-battery-notification-android-basics/).
139 changes: 116 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,132 @@
## Telegram messenger for Android
[![Releases](https://img.shields.io/github/release/Telegram-FOSS-Team/Telegram-FOSS.svg)](https://github.com/Telegram-FOSS-Team/Telegram-FOSS/releases/latest)
[![Discussions](https://img.shields.io/badge/Offtopics-Telegram-blue.svg)](https://t.me/tfossofftop)

[![Donate](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/Telegram-FOSS/) or <img src="https://en.bitcoin.it/w/images/en/c/cb/BC_Logotype.png" alt="Bitcoin" height="25px" /> `1McafEgMvqAVujNLtcJumZHxp2UfaNByqs`

# Telegram-FOSS

[Telegram](https://telegram.org) is a messaging app with a focus on speed and security. It’s superfast, simple and free.
This repo contains the official source code for [Telegram App for Android](https://play.google.com/store/apps/details?id=org.telegram.messenger).

## Creating your Telegram Application
This is an unofficial, FOSS-friendly fork of the original [Telegram App for Android](https://github.com/DrKLO/Telegram).

This version of Telegram is available on FDroid:

[<img src="https://f-droid.org/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/app/org.telegram.messenger)

## Current Maintainers

- [thermatk](https://github.com/thermatk)
- [Bubu](https://github.com/Bubu)
- you? :)

## Contributors

- [slp](https://github.com/slp)
- [Sudokamikaze](https://github.com/Sudokamikaze)
- [l2dy](https://github.com/l2dy)
- [maximgrafin](https://github.com/maximgrafin)
- [vn971](https://github.com/vn971)
- [theel0ja](https://github.com/theel0ja)
- [AnXh3L0](https://github.com/AnXh3L0)
- [noplanman](https://github.com/noplanman)
- [vk496](https://github.com/vk496)
- [verdulo](https://github.com/verdulo)
- [anupritaisno1](https://github.com/anupritaisno1)
- [nekohasekai](https://github.com/nekohasekai)

## Discussion

Join the [Telegram-FOSS Offtopics group](https://t.me/tfossofftop)

You can also join `#telegram-foss:matrix.org` via [matrix](https://matrix.to/#/#telegram-foss:matrix.org) or `#telegram-foss` on freenode.

## Changes:

*Replacement of non-FOSS, untrustworthy or suspicious binaries or source code:*
- Do location sharing with OpenStreetMap(osmdroid) instead of Google Maps
- Use Twemoji emoji set instead of Apple's emoji
- Google Play Services GCM replaced with Telegram's push service
- Has to show a notification on Oreo+, ask Google
- **SECURITY:** Old BoringSSL prebuilts are replaced with the newest upstream source code built at compile time
- **SECURITY:** Old FFmpeg prebuilts are replaced with the newest upstream source code built at compile time
- **SECURITY:** Bundled libWebP is updated

We welcome all developers to use our API and source code to create applications on our platform.
There are several things we require from **all developers** for the moment.
*Removal of non-FOSS, untrustworthy or suspicious binaries or source code and their functionality:*
- Google Vision face detection and barcode scanning (Passport)
- Google Wallet and Android Pay integration
- Google Voice integration
- HockeyApp crash reporting and self-updates
- Google SMS retrieval. You have to type the code manually

1. [**Obtain your own api_id**](https://core.telegram.org/api/obtaining_api_id) for your application.
2. Please **do not** use the name Telegram for your app — or make sure your users understand that it is unofficial.
3. Kindly **do not** use our standard logo (white paper plane in a blue circle) as your app's logo.
3. Please study our [**security guidelines**](https://core.telegram.org/mtproto/security_guidelines) and take good care of your users' data and privacy.
4. Please remember to publish **your** code too in order to comply with the licences.
*Other:*
- Allow to set a proxy before login
- Added the ability to parse locations from intents containing a `geo:<lat>,<lon>,<zoom>` string
- Force static map previews from Telegram

### API, Protocol documentation
## Versioning

This repository contains tags to make tracking versions easier.

Versions are in form "v$UPSTREAM$RELEASE" where:

* $UPSTREAM is the public, visible version of upstream.
* $RELEASE is a letter ([a-z]) indicating minor releases between official versions (sometimes, upstream is updated without relating the changes to an specific version).

## API, Protocol documentation

Telegram API manuals: https://core.telegram.org/api

MTproto protocol manuals: https://core.telegram.org/mtproto

### Compilation Guide
## Building

**NOTE: Building on Windows is, unfortunately, not supported.
Consider using a Linux VM or dual booting.**
![WindowsSupport](/tgfoss-build-under-win.gif?raw=true)

**Important:**

1. You need the Android SDK([section Command line tools only](https://developer.android.com/studio)), Android NDK, Go(Golang) and [Ninja](https://ninja-build.org/) to build the apk. Install `openjdk-devel` in accord with your distribution (Debian, Ubuntu, Fedora..)

2. Don't forget to include the submodules when you clone:
- `git clone --recursive https://github.com/Telegram-FOSS-Team/Telegram-FOSS.git`

3. Build native FFmpeg and BoringSSL dependencies:
- Go to the `TMessagesProj/jni` folder and execute the following (define the paths to your NDK and Ninja):

```
export ANDROID_HOME=[PATH_TO_SDK] #if you haven't already
export NDK=[PATH_TO_NDK]
export NINJA_PATH=[PATH_TO_NINJA]
./build_ffmpeg_clang.sh
./patch_ffmpeg.sh
./patch_boringssl.sh
./build_boringssl.sh
```

4. You get **your own API key** here: https://core.telegram.org/api/obtaining_api_id and create a file called `API_KEYS` in the source root directory.The contents should look like this:

APP_ID = 12345
APP_HASH = aaaaaaaabbbbbbccccccfffffff001122

- If you want to publish a modified version of Telegram:

1. Do not use the name Telegram and the standard logo (white paper plane in a blue circle) for your app — or make sure your users understand that it is unofficial
2. Take good care of your users' data and privacy
3. **Please remember to publish your code too in order to comply with the licenses**

5. The project can be built with Android Studio or from the command line with gradle: `./gradlew assembleAfatRelease`. The apk will be found in `TMessagesProj/build/outputs/apk` folder.

- If you want built specific version in accord your cpu architecture:

**Note**: In order to support [reproducible builds](https://core.telegram.org/reproducible-builds), this repo contains dummy release.keystore, google-services.json and filled variables inside BuildVars.java. Before publishing your own APKs please make sure to replace all these files with your own.
1. `./gradlew <sdk specific for your CPU architecture>`

You will require Android Studio 3.4, Android NDK rev. 20 and Android SDK 8.1
for example, if you want built for **arm64-v8a**: `./gradlew assembleArm64_SDK23Release`

1. Download the Telegram source code from https://github.com/DrKLO/Telegram ( git clone https://github.com/DrKLO/Telegram.git )
2. Copy your release.keystore into TMessagesProj/config
3. Fill out RELEASE_KEY_PASSWORD, RELEASE_KEY_ALIAS, RELEASE_STORE_PASSWORD in gradle.properties to access your release.keystore
4. Go to https://console.firebase.google.com/, create two android apps with application IDs org.telegram.messenger and org.telegram.messenger.beta, turn on firebase messaging and download google-services.json, which should be copied to the same folder as TMessagesProj.
5. Open the project in the Studio (note that it should be opened, NOT imported).
6. Fill out values in TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java – there’s a link for each of the variables showing where and which data to obtain.
7. You are ready to compile Telegram.
6. Sign your [apk](https://stackoverflow.com/a/55271559/4624106)

### Localization
# DIGITAL RESISTANCE

We moved all translations to https://translations.telegram.org/en/android/. Please use it.
![DIGITALRESISTANCE](/DigitalResistance.jpg?raw=true "DIGITALRESISTANCE")
58 changes: 21 additions & 37 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,38 @@ configurations {
compile.exclude module: 'support-v4'
}

configurations.all {
exclude group: 'com.google.firebase', module: 'firebase-core'
}

dependencies {
implementation 'androidx.core:core:1.1.0-beta01'
implementation 'androidx.palette:palette:1.0.0'
implementation 'androidx.interpolator:interpolator:1.0.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.2.0'
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
implementation 'com.android.support:multidex:1.0.3'

compileOnly 'org.checkerframework:checker-qual:2.5.2'
compileOnly 'org.checkerframework:checker-compat-qual:2.5.0'
implementation 'com.google.firebase:firebase-messaging:20.1.6'
implementation 'com.google.firebase:firebase-config:19.1.4'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-vision:16.2.0'
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation "com.microsoft.appcenter:appcenter-distribute:3.1.0"
implementation "com.microsoft.appcenter:appcenter-crashes:3.1.0"
implementation 'com.googlecode.mp4parser:isoparser:1.0.6'
implementation 'com.stripe:stripe-android:2.0.2'
implementation files('libs/libgsaverification-client.aar')
implementation 'org.osmdroid:osmdroid-android:6.1.6'
}

//return an api key from a properties file.
def getAppId(){
Properties properties = new Properties()
properties.load(new FileInputStream("./API_KEYS"))
return properties.get("APP_ID")
}
def getAppHash(){
Properties properties = new Properties()
properties.load(new FileInputStream("./API_KEYS"))
return "\"" + properties.get("APP_HASH") + "\""
}

android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
ndkVersion "20.0.5594570"
ndkVersion "21.1.6352462"

defaultConfig.applicationId = "org.telegram.messenger"

Expand All @@ -62,34 +63,19 @@ android {

dexOptions {
jumboMode = true
// Telegram-FOSS
javaMaxHeapSize "2g"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

signingConfigs {
debug {
storeFile file("config/release.keystore")
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}

release {
storeFile file("config/release.keystore")
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}

buildTypes {
debug {
debuggable true
jniDebuggable true
signingConfig signingConfigs.debug
applicationIdSuffix ".beta"
minifyEnabled true
multiDexEnabled true
Expand Down Expand Up @@ -133,7 +119,6 @@ android {
HA {
debuggable false
jniDebuggable false
signingConfig signingConfigs.debug
applicationIdSuffix ".beta"
minifyEnabled true
multiDexEnabled true
Expand All @@ -143,7 +128,6 @@ android {
release {
debuggable false
jniDebuggable false
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources false
multiDexEnabled true
Expand Down Expand Up @@ -295,7 +279,6 @@ android {

applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "app.apk"
output.getProcessManifestProvider().get().doLast {
def abiVersion = variant.productFlavors.get(0).abiVersionCode

Expand Down Expand Up @@ -384,6 +367,9 @@ android {
versionName "6.1.1"

vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']
//obtain your own keys at https://core.telegram.org/api/obtaining_api_id
buildConfigField 'int', 'APP_ID', getAppId()
buildConfigField 'String', 'APP_HASH', getAppHash()

externalNativeBuild {
ndkBuild {
Expand Down Expand Up @@ -420,5 +406,3 @@ private static File findJavac() {
return null
}
}

apply plugin: 'com.google.gms.google-services'
Loading