Skip to content

Instantly share code, notes, and snippets.

View ganadist's full-sized avatar

YOUNG HO CHA (aka ganachoco) ganadist

  • Seoul, Republic of Korea
View GitHub Profile
@ganadist
ganadist / update-binary
Last active August 3, 2023 04:54
update-binary from UPDATE-SuperSU-v2.46.zip
#!/sbin/sh
#
# SuperSU installer ZIP
# Copyright (c) 2012-2014 - Chainfire
#
# To install SuperSU properly, aside from cleaning old versions and
# other superuser-type apps from the system, the following files need to
# be installed:
#
# API source target chmod chcon required
from flask import Flask, request, session, g, redirect, url_for
from flask import abort, render_template, flash
app = Flask(__name__)
app.config.from_object(__name__)
hosts = {
'b': "https://code.google.com/p/android/issues/"
's': "https://android.googlesource.com/",
'r': "https://android-review.googlesource.com/",
#!/bin/bash
ID=`id -u`
if [ $ID != 0 ]; then
exec sudo $0 $@
fi
print_available_governors() {
echo -n "available governors are : "
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
echo -n "current governor is : "
@ganadist
ganadist / git-benchmark.py
Created December 17, 2018 14:13
git clone https://blahblah x 10 : user = 0.477663 stime = 0.20673899999999998 total = 14.000959157943726 idle = 13.915408907943725
#!/usr/bin/env python3
import os
import resource
import time
N_CPU = os.sysconf('SC_NPROCESSORS_ONLN')
class Usage:
#!/usr/bin/env python3
import os
import resource
import time
N_CPU = os.sysconf('SC_NPROCESSORS_ONLN')
class Usage:
# vim: ts=2 sw=2 sts=2 et ai
from android-19-armeabi-v7a
# add for debugging
COPY bin/busybox /bin/sh
# copy from https://packages.debian.org/sid/qemu-user-static
COPY bin/qemu-arm-static /usr/bin/
ENV ANDROID_ASSETS /system/app
#!/usr/bin/env python3
import os, glob
WIDTH_ORIG = 1080
HEIGHT_ORIG = 1920
def create_background(region, outname):
w = region[2] - region[0]
h = region[3] - region[1]
cmd = 'convert -size {}x{} xc:none {}'.format(w, h, outname)
@ganadist
ganadist / fstab.ramplus
Last active February 2, 2022 15:56
Ram-Plus implementation from Galaxy Fold 3 (SM-F926N)
### /vendor/etc/fstab.ramplus
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
# SWAP
/dev/block/zram0 none swap defaults zramsize=2147483648,auto_configure
@ganadist
ganadist / gist:2af47d422ca6f9d30e8d
Last active March 3, 2021 20:24
SafetyNet example
private static final DEBUG = false;
private static final SecureRandom SR;
static {
SR = new SecureRandom();
SR.setSeed(System.currentTimeMillis());
}
private byte[] getRequestNonce() {
byte[] output = new byte[16];
@ganadist
ganadist / gist:5a40cca5680ea94c82e7
Created May 16, 2015 12:16
LOCAL_MODULE_PATH usage in aosp master-soong branch
$ mgrep LOCAL_MODULE_PATH | cut -d':' -f3- |sort |uniq
LOCAL_MODULE_PATH=$(HOST_OUT)/lib64/valgrind
LOCAL_MODULE_PATH=$(PRODUCT_OUT)$(vg_target_module_path)
#LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
#LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
#LOCAL_MODULE_PATH := $(etc_dir)
#LOCAL_MODULE_PATH := $(local_target_dir)
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/