Skip to content

Instantly share code, notes, and snippets.

View AdarshGrewal's full-sized avatar
😴

Adarsh Grewal AdarshGrewal

😴
View GitHub Profile
#!/bin/bash
read -p "Please input the tag/branch name: " branch
read -p "What do you want to do (import (i) or update (u)): " option
case $option in
import | i)
git subtree add --prefix=techpack/audio https://source.codeaurora.org/quic/la/platform/vendor/opensource/audio-kernel.git/ $branch
git subtree add --prefix=techpack/camera https://source.codeaurora.org/quic/la/platform/vendor/opensource/camera-kernel.git/ $branch
git subtree add --prefix=techpack/dataipa https://source.codeaurora.org/quic/la/platform/vendor/opensource/dataipa.git/ $branch
git subtree add --prefix=techpack/datarmnet https://source.codeaurora.org/quic/la/platform/vendor/qcom/opensource/datarmnet.git/ $branch
.class public Lcom/xiaomi/protocol/ICustomCaptureResult;
.super Ljava/lang/Object;
.source "ICustomCaptureResult.java"
# interfaces
.implements Landroid/os/Parcelable;
# static fields
.field public static final CAPTURE_RESULT_EXTRA_CLASS:Ljava/lang/String; = "android.hardware.camera2.impl.CaptureResultExtras"
#!/bin/bash
boot_partitions=("boot" "dtbo" "init_boot" "modem" "recovery" "vbmeta" "vbmeta_system" "vbmeta_vendor" "vendor_boot")
fw_partitions=("abl" "aop" "aop_config" "bluetooth" "cpucp" "cpucp_dtb" "devcfg" "dsp" "engineering_cdt" "featenabler" "hyp" "imagefv" "keymaster" "oplus_sec" "oplusstanvbk" "pdp" "pdp_cdb" "pvmfw" "qupfw" "shrm" "soccp_dcd" "soccp_debug" "splash" "spuservice" "tz" "uefi" "uefisecapp" "xbl" "xbl_config" "xbl_ramdump")
logical_partitions=("my_bigball" "my_carrier" "my_engineering" "my_heytap" "my_manifest" "my_product" "my_region" "my_stock" "odm" "product" "system" "system_dlkm" "system_ext" "vendor" "vendor_dlkm")
extra_partitions=("my_company" "my_preload") # These partitions don't exist in payload but must exist for Oplus updater
function check_all_images_exist() {
for partition in "${boot_partitions[@]}" "${fw_partitions[@]}" "${logical_partitions[@]}"; do
if ! ls "${partition}.img" >/dev/null 2>&1; then
echo "Error: Image not found for $partition"
@AdarshGrewal
AdarshGrewal / closest-commit.py
Created August 18, 2023 17:46
a script to find closest matching commit to HEAD,mostly inspired from best-caf-kernel.py
#!/usr/bin/env python
from __future__ import print_function
import sys
import time
from multiprocessing import Event, Pool, Process, Queue
from subprocess import PIPE, Popen
try: