Skip to content

Instantly share code, notes, and snippets.

View sb6596's full-sized avatar
🏠
Working from home

ѕнυвнαмв sb6596

🏠
Working from home
View GitHub Profile
@neilchetty
neilchetty / Sign-Android-Build.md
Last active December 6, 2024 00:30
Guide To Sign Android Build Update With Private Release Keys

Index

  1. Generating signing keys (Part 1)
  2. Generating signing keys (Part 2)
  3. Making signed build (recovery)
  4. Making signed build (fastboot)
  5. Making incremental update

Requirements

All you need is an android buildsystem (I would recommend you to use lineageos)

@masemoel
masemoel / gist:537301229c1bd4c8b20c50f535751d19
Created January 25, 2022 22:41
Enable ccache on Android 12 environments
# First time building A12
Open terminal and run:
sudo bash
mkdir /mnt/ccache
exit
sudo mount --bind /home/masemoel/.ccache /mnt/ccache
export USE_CCACHE=1 && export CCACHE_EXEC=/usr/bin/ccache && ccache -M 60G && export CCACHE_DIR=/mnt/ccache
(set ccache -M with the maximum of GB of your disk you wanna set available for ccache, and home/masemoel with home/ and your username on your Linux environment).
@PIPIPIG233666
PIPIPIG233666 / gist:72806386c8b93729ce7f2b2c263d8889
Created October 16, 2020 21:36
qti-telephony-common smali edit
--- a/smali/com/qualcomm/qti/internal/telephony/WifiManagerCompatible.smali
+++ b/smali/com/qualcomm/qti/internal/telephony/WifiManagerCompatible.smali
@@ -17,7 +17,7 @@
.locals 1
.line 15
- sget-boolean v0, Lmiui/os/Build;->IS_GLOBAL_BUILD:Z
+ const v0, 1
return v0
@masemoel
masemoel / BuildGuide.txt
Last active September 3, 2025 17:50
How to build an A14+ ROM from scratch under Ubuntu 24.04 (or based)
To build a A14+ (AOSP/LOS based) on Ubuntu 24.04+ (or distros based on it), there are four main steps:
(This guide is applicable for recoveries as well (TWRP, OFRP...))
Working on Android 14 and upper
#################################################################
# Step 1: Setup your environment #
#################################################################
****Setup Linux to build Android****
@dodyirawan85
dodyirawan85 / RMX1801_Partition_Table_64GB.txt
Created January 17, 2020 22:18
Realme 2 Pro partition table, 4/64GB variant
Model: MMC DH6DAB (sd/mmc)
Disk /dev/block/mmcblk0: 62.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 20.5kB 10.5MB 10.5MB fat16 oppodycnvbk
2 10.5MB 21.0MB 10.5MB oppostanvbk
3 21.0MB 23.1MB 2097kB modemst1
@AndiMiko
AndiMiko / migrateAndroidX.py
Created February 8, 2019 02:16
Replaces the pairs in androidx-class-mapping.csv (get it here: https://developer.android.com/jetpack/androidx/migrate) to migrate Android support to AndroidX
import glob
import csv
dictCSV = "C:/path/to/androidx-class-mapping.csv"
projectPath = "C:/path/to/project/src/"
def replace_all(text, dic):
for i, j in dic.items():
text = text.replace(i, j)
return text
@Yash089610
Yash089610 / push.sh
Last active March 30, 2024 02:08
remote: fatal: pack exceeds maximum allowed size
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else
#!/usr/bin/node
const DEBUG = false;
const relativeFilesDirectory = process.argv[2];
const relativeFileStart = process.argv[3];
const filesDirectory = path.resolve(relativeFilesDirectory);
const fileStart = path.join(filesDirectory, relativeFileStart);
@Nihhaar
Nihhaar / audit2allow-sepolicy-android
Created August 22, 2017 20:50
Addressing selinux denials using audit2allow for android using logcat
# Goto android source code root and then execute following commands
# Keep the logcat.log in the root
export ANDROID_BUILD_TOP=$(pwd)
./external/selinux/prebuilts/bin/audit2allow -p out/target/product/{devicename}/root/sepolicy < logcat.log
# Copy the generated rules in respective files in the device tree