Telegram源码之android客户端配置

1.下载

github上搜索telegram下载,下载方式最好使用git,因为版本内部文件配置不全,还需要继续下载文件

https://github.com/DrKLO/Telegram.git

2.ndk配置

使用android studio打开项目,配置ndk环境为android-ndk-r14b,其他版本可能会出些问题,接下来就是正常的配置。

3.申请你的app_id和app_bash

Telegram源码之android客户端配置_第1张图片
image.png

填写到org.telegram.messager/BuildVars.java中,HOCKEY_APP_HASH和HOCKEY_APP_HASH_DEBUGE在代码中的使用需要注释掉,不想注释的话,可以直接使用将app_bash填写进去。

4.配置Android.mk和Application.mk

在Android.mk添加:

LOCAL_SHORT_COMMANDS :=true

在Application.mk添加:

APP_SHORT_COMMANDS :=true

5.导入libtgvoip完整文件

使用git submodule update --init --recursive导入完整的libtgvoip文件

6.添加google-services.json到项目中

File google-services.json is missing. The Google Services

7.修改builder.gradle

builder.gradle中找到如下代码:

 debug {
            debuggable true
            jniDebuggable true
            signingConfig signingConfigs.debug
//            applicationIdSuffix ".beta"   注释掉applicationIdSuffix ".beta"
        }

8.修改密钥

拖动密钥到config目录中,密钥密码都为password,别名为alias,名字为release.keystore

你可能感兴趣的:(Telegram源码之android客户端配置)