Skip to content

Instantly share code, notes, and snippets.

View ghostrider-reborn's full-sized avatar
:shipit:
hac

Adithya ghostrider-reborn

:shipit:
hac
View GitHub Profile
#!/usr/bin/python3
from github import Github # requires pip3 install pygithub
g = Github(input("Enter token: "))
org = g.get_organization(input("Enter org name: "))
branch = input("Enter branch: ")
for repo in org.get_repos():
try:
@ghostrider-reborn
ghostrider-reborn / extract-opcode.c
Last active October 24, 2023 05:50
Extract major and minor value from QTI perf opcode
#include <stdio.h>
#define EXTRACT_MAJOR_TYPE 0x1FC00000
#define EXTRACT_MINOR_TYPE 0x000FC000
#define SHIFT_BIT_MAJOR_TYPE 22
#define SHIFT_BIT_MINOR_TYPE 14
int main()
{
unsigned int opcode;
@ghostrider-reborn
ghostrider-reborn / thermal-normal.conf.txt
Last active August 16, 2023 10:15
thermal-normal.conf from marble
[BAT_SOC]
algo_type simulated
path /sys/class/power_supply/battery/capacity
polling 10000
[ABT-SENSOR]
algo_type ambient
sensors conn_therm cpu_therm power
coefficient_a 1125764 -504112009 -14091616 -70113 532538065 -4114823 2437207 -326148 -103617 -2700734 622580 2579143 4346965 -221765043 -24019755 446314 -3844149 -4032380 -4771762 10874 25664217 -26724 122112248 2668021 -20207 99535920 1120133
compensation -15506921
@ghostrider-reborn
ghostrider-reborn / unpack-moto-img.py
Last active November 1, 2023 01:13
Unpack motorola radio/bootloader.img
#!/usr/bin/env python
#
# based on https://pastebin.com/raw/9w5TBnSv
# credits to original author HemanthJabalpuri @ XDA
# converted to python using chatgpt
import struct
import sys
def abort(msg):
#!/usr/bin/env python3
import bisect
import subprocess
import sys
import time
from threading import Thread
def run_shell_cmd(*args):
@ghostrider-reborn
ghostrider-reborn / pa-gr.xml
Last active October 23, 2022 06:31
Repo local manifest for https://github.com/pa-gr
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="gr"
fetch="https://github.com/pa-gr/"
review="gerrit.aospa.co"
revision="topaz" />
<remove-project name="AOSPA/android_art" />
<remove-project name="AOSPA/android_bionic" />
@ghostrider-reborn
ghostrider-reborn / AutomaticBrightnessControllerImpl.java
Created June 30, 2022 07:06
AutomaticBrightnessControllerImpl from MIUI 13 (lisa)
package com.android.server.display;
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.hardware.camera2.CameraManager;
@ghostrider-reborn
ghostrider-reborn / KeyguardSensorInjector.java
Last active June 30, 2022 07:06
KeyguardSensorInjector from MIUI 13 (lisa)
package com.android.keyguard.injector;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
@ghostrider-reborn
ghostrider-reborn / msm8916_7.1_radio_props.txt
Created June 30, 2020 14:45
radio and ims props from vertex grip 7.1.2
persist.ims.QmiOttEnable
persist.ims.UpLinkFreq
persist.ims.disableADBLogs
persist.ims.disableDebugDataPathLogs
persist.ims.disableDebugLogs
persist.ims.disableIMSLogs
persist.ims.disableQXDMLogs
persist.ims.disableSigHandler
persist.ims.disableUserAgent
persist.ims.dumpWiFiLogs
@ghostrider-reborn
ghostrider-reborn / ginkgo_cam_props.txt
Last active June 1, 2020 07:23
Camera props from ginkgo MIUI 11 vendor
persist.camera.3hdr.enable
persist.camera.capture.sll.dump
persist.camera.clearshot.log
persist.camera.dualcal.state
persist.camera.superphoto.log
persist.vendor.camera.CDS
persist.vendor.camera.HAL3.enabled
persist.vendor.camera.HDR.fix_isp_gain
persist.vendor.camera.HDR.ratio
persist.vendor.camera.ae.capture.bound