Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b91e9a7
setup: install software-properties-common before
Kn0ax Jan 4, 2022
e366973
setup/install_android_sdk: update packages and sync with upstream
xstefen Jan 8, 2022
0c08d37
Merge pull request #172 from xstefen/master
akhilnarang Jan 10, 2022
783bf3d
removed -get
Kn0ax Jan 11, 2022
dc0d4c8
Merge pull request #171 from Kn0ax/master
akhilnarang Jan 11, 2022
3c30dcd
Update android_build_env.sh
gerrydoro Jan 24, 2022
bc4c85f
scripts: github: Add script to push all repos from manifest to github
SahilSonar Jan 29, 2022
ea3f432
android_build_env: Install libswitch-perl as well
theimpulson Feb 17, 2022
9f015c5
Merge pull request #175 from theimpulson/master
akhilnarang Feb 17, 2022
82a2ca4
Merge pull request #174 from SahilSonar/master
akhilnarang Feb 17, 2022
94205bc
Merge pull request #173 from gerrydoro/patch-1
akhilnarang Mar 20, 2022
ae8bcbd
android_build_env: use upgrade to hkps for keyserver because why not
xstefen Mar 21, 2022
b606b67
setup: ccache: Update SCM protocol to https
gokulkgm Mar 29, 2022
de03876
Merge pull request #177 from xstefen/master
akhilnarang Mar 30, 2022
56018db
Merge pull request #178 from gokulkgm/ccache-update
akhilnarang Mar 30, 2022
67eb050
setup: android_build_env: extend focal packages to jammy as well
gokulkgm Apr 22, 2022
f9e3eee
Merge pull request #179 from gokulkgm/ubuntu-jammy
akhilnarang Apr 22, 2022
bd07812
Add libxcrypt-compat for Arch env setup
PIPIPIG233666 Jun 2, 2022
d7921f5
setup: android_build_env: Update the installation of GitHub CLI package
ElectroPerf Jun 21, 2022
603ebab
Merge commit 'refs/pull/183/head' of ssh://github.com/akhilnarang/scr…
akhilnarang Jun 27, 2022
7385117
Add in a comment, add in a missing command from github's install docs
akhilnarang Jun 27, 2022
980e6d1
Merge pull request #182 from PIPIPIG233666/patch-1
akhilnarang Jun 29, 2022
2cd4ed1
Arch env install font as well
realaashil Jul 1, 2022
c80dee8
setup: fedora: Add clang
iKeramat Sep 5, 2022
e61f664
Arch-Androidenvsetup: Don't install libxcrypt-compat from AUR
Arrowsploit Nov 13, 2022
8110a63
Merge pull request #188 from Arrowsploit/master
akhilnarang Nov 13, 2022
8c7ef9e
Merge pull request #187 from iKeramat/master
akhilnarang Dec 23, 2022
be34c74
setup: android_build_env: Add support for PopOS
Giovix92 Dec 23, 2022
9aeb292
scripts: fedora: Update for F37
LeddaZ Dec 26, 2022
7eca1be
Merge pull request #190 from LeddaZ/master
akhilnarang Dec 26, 2022
b76bf84
Merge pull request #189 from Giovix92/master
akhilnarang Dec 29, 2022
a50c73a
Merge pull request #184 from aashil123/patch-1
akhilnarang Dec 29, 2022
9653c7d
scripts: setup: Revive crowdin cli installation script
Darkstar085 Jan 2, 2023
7db8887
setup: Install git-lfs
Arrowsploit Apr 5, 2023
24f1640
Merge pull request #193 from Arrowsploit/master
akhilnarang Apr 5, 2023
eab9b8b
setup: add in openSUSE setup script
TogoFire Nov 10, 2022
5e6cb17
Merge pull request #194 from TogoFire/master
akhilnarang Apr 10, 2023
851851e
setup: Install rsync
Megh-Rana Jul 23, 2023
1569b14
setup: fedora: Install libxcrypt-compat
RisenID Sep 9, 2023
8da27eb
Merge pull request #201 from RisenID/master
akhilnarang Sep 9, 2023
a10bf6f
Merge pull request #199 from Meghthedev/master
akhilnarang Sep 9, 2023
b8f2bcb
scripts: ccache: use cmake to configure build
Megh-Rana Sep 9, 2023
6687c35
Add in some script to parse android APNs and copy some attributes fro…
akhilnarang Apr 6, 2024
8e4fd70
fix(apn): write with utf-8 encoding
akhilnarang Apr 6, 2024
b8dcd09
refactor: update script name in preparation for another
akhilnarang Apr 6, 2024
1f2974a
chore: add in another script
akhilnarang May 13, 2024
10860ba
random: Add scripts to copy IMS APN as well as sort APNs
gotenksIN Apr 6, 2024
7c1bc09
fix: set the new scripts as executable
akhilnarang May 13, 2024
93a17e4
setup: Install pyelftools
basamaryan Nov 5, 2024
91c1c82
Merge pull request #206 from basamaryan/master
akhilnarang Nov 9, 2024
f890610
Merge pull request #191 from Darkstar085/master
akhilnarang Jan 31, 2025
063c60a
Merge pull request #202 from Meghthedev/patch-1
akhilnarang Jan 31, 2025
cfc9031
Aur helpers (#210)
jensgrunzer1 Mar 28, 2025
de6cca8
feat: add in a script to install `acpi_call`
akhilnarang Apr 18, 2025
366cd95
chore: add in an alias to trigger my zenbook 14X camera on/off
akhilnarang Apr 18, 2025
8927ded
fix: shellcheck workflow
akhilnarang Apr 18, 2025
f28a783
setup: fedora: Install openssl-devel-engine as well. (#212)
Vishalcj17 May 15, 2025
18a2cc9
feat: add in helper function to upload to katbin
akhilnarang Oct 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: ShellCheck scripts
jobs:
shellCheck:
name: ShellCheck
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Run shellcheck.
run: |
while read -r script; do shellcheck --exclude=SC1090,SC1091 $script; done < files
3 changes: 3 additions & 0 deletions aliases
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ export EDITOR="nano"

# Set timezone
export TZ="Asia/Kolkata"

alias camera_off="echo '\_SB.ATKD.WMNB 0x00 0x53564544 0x0000000000060078' | sudo tee /proc/acpi/call"
alias camera_on="echo '\_SB.ATKD.WMNB 0x00 0x53564544 0x0000000100060078' | sudo tee /proc/acpi/call"
1 change: 1 addition & 0 deletions files
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ rr/channel.sh
rr/crowdin.sh
rr/copy_ftp.sh
rr/push_json.sh
setup/acpi_call.sh
setup/android_build_env.sh
setup/arch-manjaro.sh
setup/ccache.sh
Expand Down
16 changes: 16 additions & 0 deletions functions
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,19 @@ GDrive ID: \`${GDRIVE_UPLOAD_ID}\`
tgm "${UPLOAD_INFO}"
echo "Get the file with ${GDRIVE_UPLOAD_ID}"
}

# Paste content to katb.in
function katbin() {
local content
if [[ -z "$1" ]]; then
if [[ -t 0 ]]; then
echo "Error: No content provided. Provide as argument or pipe in."
return 1
else
content=$(cat)
fi
else
content="$1"
fi
curl -sL 'https://katb.in/api/paste' --json '{"paste":{"content":"'"$content"'"}}' | jq -r '"https://katb.in/\(.id)"'
}
14 changes: 14 additions & 0 deletions github/push-all-repos-git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# A github script to push all repositories from a manifest

# This again, will have to be adapted based on your setup.

cwd=$PWD
PROJECTS="$(grep 'aosip' .repo/manifests/aosip.xml | awk '{print $2}' | awk -F'"' '{print $2}' | uniq | grep -v caf)"
for project in ${PROJECTS}; do
cd "$project" || exit
git push git@github.com:AOSIP/"$(git remote -v | head -n1 | awk '{print $2}' | sed 's/.*\///' | sed 's/\.git//')".git HEAD:refs/heads/nougat-mr2
cd - || exit
done
cd "$cwd" || exit
49 changes: 49 additions & 0 deletions random-py/apn-copy-entries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python

import sys
from pathlib import Path
from xml.etree import ElementTree

# ./apn-copy-entries.py source.xml destination.xml
# If no arguments are provided, the user will be prompted to enter the file paths

if len(sys.argv) < 3:
source = input("Enter the source XML path: ")
destination = input("Enter the destination XML path: ")
else:
source = sys.argv[1]
destination = sys.argv[2]

source_path = Path(source)
destination_path = Path(destination)

if not source_path.exists() or not destination_path.exists():
print("Please ensure that both the files exist")
sys.exit(1)

source_apn_xml = ElementTree.parse(source_path)
destination_apn_xml = ElementTree.parse(destination_path)

tags_to_match = ("mcc", "mnc")
tags_to_copy = ("apn")

destination_root = destination_apn_xml.getroot()

combinations = set()

# Define a function to check if a child element is already in the destination root
def is_in_destination(child, destination_root):
for dest_child in destination_root:
if child.attrib == dest_child.attrib:
return True
return False

# Modify the loop that appends children from the source to the destination
for child in source_apn_xml.getroot():
# Only consider children with apn='ims'
if child.attrib.get('apn') == 'ims':
# Only append the child if it is not already in the destination
if not is_in_destination(child, destination_root):
destination_root.append(child)

destination_apn_xml.write(destination, encoding="utf-8")
49 changes: 49 additions & 0 deletions random-py/apn-copy-tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python

import sys
from pathlib import Path
from xml.etree import ElementTree

# ./apn.py source.xml destination.xml
# If no arguments are provided, the user will be prompted to enter the file paths

if len(sys.argv) < 3:
source = input("Enter the source XML path: ")
destination = input("Enter the destination XML path: ")
else:
source = sys.argv[1]
destination = sys.argv[2]

source_path = Path(source)
destination_path = Path(destination)

if not source_path.exists() or not destination_path.exists():
print("Please ensure that both the files exist")
sys.exit(1)

source_apn_xml = ElementTree.parse(source_path)
destination_apn_xml = ElementTree.parse(destination_path)

tags_to_match = ("apn", "mcc", "mnc")
tags_to_copy = ("network_type_bitmask", "type")
required_tags = tags_to_match + tags_to_copy

mapping = {}

for child in source_apn_xml.getroot():
if not all(tag in child.attrib for tag in required_tags):
continue
mapping["|".join([child.attrib[tag] for tag in tags_to_match])] = {
tag: child.attrib[tag] for tag in tags_to_copy
}


for child in destination_apn_xml.getroot():
if not all(tag in child.attrib for tag in tags_to_match):
continue
key = "|".join([child.attrib[tag] for tag in tags_to_match])
if key in mapping:
for tag in tags_to_copy:
child.attrib[tag] = mapping[key][tag]

destination_apn_xml.write(destination, encoding="utf-8")
34 changes: 34 additions & 0 deletions random-py/sort_apn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python

import sys
from pathlib import Path
from xml.etree import ElementTree

# ./sort_apn.py apns-conf.xml
# If no arguments are provided, the user will be prompted to enter the file paths

if len(sys.argv) < 2:
apns = input("Enter the apns-conf XML path: ")
else:
apns = sys.argv[1]

apns_path = Path(apns)

if not apns_path.exists():
print("Please ensure that the files exist")
sys.exit(1)

def sort_apns(apns_path):
# Parse the XML file into an ElementTree
tree = ElementTree.parse(apns_path)
root = tree.getroot()

# Sort the children of the root by 'mcc' and 'mnc'
root[:] = sorted(root, key=lambda child: (child.attrib.get('mcc', ''), child.attrib.get('mnc', '')))

# Write the sorted ElementTree back into the XML file
with open(apns_path, 'wb') as f:
f.write(ElementTree.tostring(root, encoding='utf-8'))

# Call the function with the XML file path
sort_apns(apns_path)
14 changes: 14 additions & 0 deletions setup/acpi_call.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash


lsmod | rg -q acpi_call && {
echo "acpi_call already installed";
exit 0;
}

git clone https://github.com/nix-community/acpi_call /tmp/acpi_call
make -C /tmp/acpi_call
sudo make -C /tmp/acpi_call install
sudo depmod -a
sudo modprobe acpi_call
rm -rf /tmp/acpi_call/
12 changes: 6 additions & 6 deletions setup/android-sdk-minimal.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
build-tools;30.0.3
build-tools;31.0.0-rc2
cmake;3.10.2.4988404
ndk;22.1.7171670
build-tools;31.0.0
build-tools;32.0.0
cmake;3.18.1
ndk;23.1.7779620
platform-tools
tools
platforms;android-30
platforms;android-S
platforms;android-31
platforms;android-32
22 changes: 13 additions & 9 deletions setup/android_build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ DEBIAN_10_PACKAGES="libncurses5"
DEBIAN_11_PACKAGES="libncurses5"
PACKAGES=""

echo "Adding GitHub apt key and repository!"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages

sudo apt install software-properties-common -y
sudo apt update

# Install lsb-core packages
Expand All @@ -26,7 +23,7 @@ LSB_RELEASE="$(lsb_release -d | cut -d ':' -f 2 | sed -e 's/^[[:space:]]*//')"

if [[ ${LSB_RELEASE} =~ "Mint 18" || ${LSB_RELEASE} =~ "Ubuntu 16" ]]; then
PACKAGES="${UBUNTU_16_PACKAGES}"
elif [[ ${LSB_RELEASE} =~ "Ubuntu 20" || ${LSB_RELEASE} =~ "Ubuntu 21" ]]; then
elif [[ ${LSB_RELEASE} =~ "Ubuntu 20" || ${LSB_RELEASE} =~ "Ubuntu 21" || ${LSB_RELEASE} =~ "Ubuntu 22" || ${LSB_RELEASE} =~ 'Pop!_OS 2' ]]; then
PACKAGES="${UBUNTU_20_PACKAGES}"
elif [[ ${LSB_RELEASE} =~ "Debian GNU/Linux 10" ]]; then
PACKAGES="${DEBIAN_10_PACKAGES}"
Expand All @@ -37,17 +34,24 @@ fi
sudo DEBIAN_FRONTEND=noninteractive \
apt install \
adb autoconf automake axel bc bison build-essential \
ccache clang cmake expat fastboot flex g++ \
g++-multilib gawk gcc gcc-multilib git gnupg gperf \
ccache clang cmake curl expat fastboot flex g++ \
g++-multilib gawk gcc gcc-multilib git git-lfs gnupg gperf \
htop imagemagick lib32ncurses5-dev lib32z1-dev libtinfo5 libc6-dev libcap-dev \
libexpat1-dev libgmp-dev '^liblz4-.*' '^liblzma.*' libmpc-dev libmpfr-dev libncurses5-dev \
libsdl1.2-dev libssl-dev libtool libxml2 libxml2-utils '^lzma.*' lzop \
maven ncftp ncurses-dev patch patchelf pkg-config pngcrush \
pngquant python2.7 python-all-dev re2c schedtool squashfs-tools subversion \
pngquant python2.7 python3-pyelftools python-all-dev re2c schedtool squashfs-tools subversion \
texinfo unzip w3m xsltproc zip zlib1g-dev lzip \
libxml-simple-perl apt-utils gh \
libxml-simple-perl libswitch-perl apt-utils rsync \
${PACKAGES} -y

echo -e "Installing GitHub CLI"
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install -y gh

echo -e "Setting up udev rules for adb!"
sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/M0Rf30/android-udev-rules/master/51-android.rules
sudo chmod 644 /etc/udev/rules.d/51-android.rules
Expand Down
27 changes: 17 additions & 10 deletions setup/arch-manjaro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@ echo '[1/4] Enabling multilib repo'
sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
# Sync, update, and prepare system
echo '[2/4] Syncing repositories and updating system packages'
sudo pacman -Syyu --noconfirm --needed multilib-devel
sudo pacman -Syyu --noconfirm --needed git git-lfs multilib-devel fontconfig ttf-droid python-pyelftools
# Install android build prerequisites
echo '[3/4] Installing Android building prerequisites'
packages="ncurses5-compat-libs lib32-ncurses5-compat-libs aosp-devel xml2 lineageos-devel"
for package in $packages; do
echo "Installing $package"
git clone https://aur.archlinux.org/"$package"
cd "$package" || exit
makepkg -si --skippgpcheck --noconfirm --needed
cd - || exit
rm -rf "$package"
done

if command -v paru 2>&1 >/dev/null
then
paru -S --noconfirm --needed $packages
elif command -v yay 2>&1 >/dev/null
then
yay -S --noconfirm --needed $packages
else
for package in $packages; do
echo "Installing $package"
git clone https://aur.archlinux.org/"$package"
cd "$package" || exit
makepkg -si --skippgpcheck --noconfirm --needed
cd - || exit
rm -rf "$package"
done
fi
# Install adb and associated udev rules
echo '[4/4] Installing adb convenience tools'
sudo pacman -S --noconfirm --needed android-tools android-udev
Expand Down
6 changes: 3 additions & 3 deletions setup/ccache.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

cd /tmp || exit 1
git clone git://github.com/ccache/ccache.git
git clone https://github.com/ccache/ccache.git
cd ccache || exit 1
./autogen.sh
./configure --disable-man --with-libzstd-from-internet --with-libb2-from-internet
mkdir -p build && cd build || exit 1
cmake -DHIREDIS_FROM_INTERNET=ON -DZSTD_FROM_INTERNET=ON -DCMAKE_BUILD_TYPE=Release ..
make -j"$(nproc)"
sudo make install
rm -rf "${PWD}"
Expand Down
12 changes: 9 additions & 3 deletions setup/crowdin-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
# Script to setup environment for crowdin
# shellcheck disable=SC1010

sudo apt install python-git
curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm all do gem install crowdin-cli
# Install crowdin-cli
wget https://artifacts.crowdin.com/repo/deb/crowdin3.deb -O crowdin.deb
sudo dpkg -i crowdin.deb
echo "crowdin-cli installed"
echo ""

# Test crowdin-cli
echo "Your crowdin version:"
crowdin --version
14 changes: 10 additions & 4 deletions setup/fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-only
#
# Script to setup an Android 10 build
# environment for Fedora 31 / Rawhide.
# Script to setup an Android 10+ build
# environment for Fedora 37 / Rawhide.

# Packages
sudo dnf install \
Expand All @@ -12,11 +12,13 @@ sudo dnf install \
bison \
bzip2 \
ccache \
clang \
curl \
flex \
gawk \
gcc-c++ \
git \
git-lfs \
glibc-devel \
glibc-static \
libstdc++-static \
Expand All @@ -38,20 +40,24 @@ sudo dnf install \
zip \
perl-Digest-SHA \
python2 \
python3-pyelftools \
wget \
lzop \
openssl-devel \
openssl-devel-engine \
java-1.8.0-openjdk-devel \
ImageMagick \
ncurses-compat-libs \
schedtool \
lzip \
vboot-utils \
vim
vim \
libxcrypt-compat

# The package libncurses5 is not available, so we need to hack our way by symlinking the required library.
sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libncurses.so.5
sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libtinfo.so.5
sudo ln -s /usr/lib64/libncurses.so.6 /usr/lib64/libncurses.so.5
sudo ln -s /usr/lib64/libncurses.so.6 /usr/lib64/libtinfo.so.5

# Repo
echo "Installing Git Repository Tool"
Expand Down
Loading