This repository was archived by the owner on Jun 28, 2021. It is now read-only.
forked from adiatul16/aosp-building
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatejson
63 lines (58 loc) · 2.47 KB
/
createjson
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
#!/bin/bash
#put script in crDroid source folder, make executable (chmod +x createupdate.sh) and run it (./createupdate.sh)
#modify values below
#leave blank if not used
maintainer="Arsh Khan (Sohil876)" #ex: Lup Gabriel (gwolfu)
oem="Xiaomi" #ex: OnePlus
device="tissot" #ex: guacamole
devicename="Xiaomi Mi A1" #ex: OnePlus 7 Pro
zip="$(ls out/target/product/tissot/crDroidAndroid*.zip | xargs basename)" #ex: crDroidAndroid-<android version>-<date>-<device codename>-v<crdroid version>.zip
buildtype="Monthly" #choose from Testing/Alpha/Beta/Weekly/Monthly
forum="https://forum.xda-developers.com/t/rom-11-0-crdroid-7-4-official.4254533/" #https link (mandatory)
gapps="https://nikgapps.com/" #https link (leave empty if unused)
firmware="https://drive.google.com/file/d/1W3J0_k1IGvdPFQGV7QySVufnAdTLwqLE/view?usp=sharing" #https link (leave empty if unused)
modem="" #https link (leave empty if unused)
bootloader="" #https link (leave empty if unused)
recovery="https://dl.twrp.me/tissot/" #https link (leave empty if unused)
paypal="" #https link (leave empty if unused)
telegram="https://t.me/crdroidtissot" #https link (leave empty if unused)
#don't modify from here
script_path="`dirname \"$0\"`"
zip_name=$script_path/out/target/product/$device/$zip
buildprop=$script_path/out/target/product/$device/system/build.prop
if [ -f $script_path/$device.json ]; then
rm $script_path/$device.json
fi
linenr=`grep -n "ro.system.build.date.utc" $buildprop | cut -d':' -f1`
timestamp=`sed -n $linenr'p' < $buildprop | cut -d'=' -f2`
zip_only=`basename "$zip_name"`
md5=`md5sum "$zip_name" | cut -d' ' -f1`
size=`stat -c "%s" "$zip_name"`
version=`echo "$zip_only" | cut -d'-' -f5`
v_max=`echo "$version" | cut -d'.' -f1 | cut -d'v' -f2`
v_min=`echo "$version" | cut -d'.' -f2`
version=`echo $v_max.$v_min`
echo '{
"response": [
{
"maintainer": "'$maintainer'",
"oem": "'$oem'",
"device": "'$devicename'",
"filename": "'$zip_only'",
"download": "https://sourceforge.net/projects/crdroid/files/'$device'/'$v_max'.x/'$zip_only'/download",
"timestamp": '$timestamp',
"md5": "'$md5'",
"size": '$size',
"version": "'$version'",
"buildtype": "'$buildtype'",
"forum": "'$forum'",
"gapps": "'$gapps'",
"firmware": "'$firmware'",
"modem": "'$modem'",
"bootloader": "'$bootloader'",
"recovery": "'$recovery'",
"paypal": "'$paypal'",
"telegram": "'$telegram'"
}
]
}' >> $device.json