FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
monogram/build-tdlib.sh at develop · monogram-android/monogram · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
monogram-android
/
monogram
Public
Notifications
You must be signed in to change notification settings
Fork
58
Star
892
Code
Issues
49
Pull requests
5
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
monogram
/
build-tdlib.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
105 lines (88 loc) · 2.57 KB
Breadcrumbs
monogram
/
build-tdlib.sh
Copy path
File metadata and controls
executable file
·
105 lines (88 loc) · 2.57 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!
/bin/bash
set
-e
prompt_build_choice
() {
echo
"
Select TDLib build target:
"
echo
"
1) official
"
echo
"
2) telemt
"
echo
"
3) both
"
printf
"
Enter choice [1-3]:
"
read
-r choice
case
"
$choice
"
in
1)
echo
"
official
"
;;
2)
echo
"
telemt
"
;;
3)
echo
"
both
"
;;
*
)
echo
"
Invalid choice:
$choice
"
>&2
;
exit
1 ;;
esac
}
TARGET_SELECTION=
"
${1
:-
}
"
if
[
-z
"
$TARGET_SELECTION
"
]
;
then
TARGET_SELECTION=
"
$(
prompt_build_choice
)
"
fi
case
"
$TARGET_SELECTION
"
in
official|telemt|both)
;;
*
)
echo
"
Usage:
$0
[official|telemt|both]
"
exit
1
;;
esac
ensure_repo
() {
local
repo_dir=
"
$1
"
local
repo_url=
"
$2
"
if
[
!
-d
"
$repo_dir
"
]
;
then
echo
"
Cloning
$repo_url
into
$repo_dir
...
"
git clone
"
$repo_url
"
"
$repo_dir
"
fi
}
build_variant
() {
local
variant=
"
$1
"
local
repo_dir=
"
$2
"
local
repo_url=
"
$3
"
local
zip_path=
"
$repo_dir
/example/android/tdlib/tdlib.zip
"
local
temp_dir=
"
tdlib_temp_
$variant
"
local
native_lib_dir=
"
"
ensure_repo
"
$repo_dir
"
"
$repo_url
"
echo
"
Starting TDLib build for
$variant
...
"
(
cd
"
$repo_dir
/example/android
"
./check-environment.sh
./fetch-sdk.sh
./build-openssl.sh
./build-tdlib.sh
)
if
[
!
-f
"
$zip_path
"
]
;
then
echo
"
Error: Archive
$zip_path
not found.
"
exit
1
fi
echo
"
Extracting and copying files for
$variant
...
"
rm -rf
"
$temp_dir
"
unzip -q
"
$zip_path
"
-d
"
$temp_dir
"
if
[
-d
"
$temp_dir
/tdlib/lib
"
]
;
then
native_lib_dir=
"
$temp_dir
/tdlib/lib
"
elif
[
-d
"
$temp_dir
/tdlib/libs
"
]
;
then
native_lib_dir=
"
$temp_dir
/tdlib/libs
"
else
echo
"
Error: Native libraries directory not found in
$zip_path
.
"
exit
1
fi
mkdir -p
"
data/src/
$variant
/jniLibs
"
rm -rf
"
data/src/
$variant
/jniLibs
"
/
*
cp -r
"
$native_lib_dir
/
"
*
"
data/src/
$variant
/jniLibs/
"
mkdir -p
"
data/src/
$variant
/java
"
rm -rf
"
data/src/
$variant
/java/org/drinkless/tdlib
"
cp -r
"
$temp_dir
/tdlib/java/
"
*
"
data/src/
$variant
/java/
"
rm -rf
"
$temp_dir
"
echo
"
Done! TDLib prebuilts copied to data/src/
$variant
/jniLibs
"
}
case
"
$TARGET_SELECTION
"
in
official)
build_variant
"
official
"
"
td
"
"
https://github.com/tdlib/td.git
"
;;
telemt)
build_variant
"
telemt
"
"
td-telemt
"
"
https://github.com/telemt/tdlib-obf.git
"
;;
both)
build_variant
"
official
"
"
td
"
"
https://github.com/tdlib/td.git
"
build_variant
"
telemt
"
"
td-telemt
"
"
https://github.com/telemt/tdlib-obf.git
"
;;
esac
Back
|
FazBrowse Home
|
New Git URL