Skip to content

Instantly share code, notes, and snippets.

View ilhan-athn7's full-sized avatar
🪟
Windows is only operating system that would give you blue screen of death

İlhan Atahan ilhan-athn7

🪟
Windows is only operating system that would give you blue screen of death
View GitHub Profile
@ilhan-athn7
ilhan-athn7 / file_info.sh
Created August 15, 2026 18:45
Magisk set_perm style file attribute fetch tool
file_info() {
local f="$1"
if [ -z "$f" ] || [ ! -e "$f" ]; then
echo "$1" "Usage: file_info <path>"
return 1
fi
local uid gid perm ctx
uid=$(stat -c '%u' "$f")
gid=$(stat -c '%g' "$f")
@ilhan-athn7
ilhan-athn7 / fakeprops.sh
Created July 31, 2026 04:07
Hide USB debugging
#!/bin/sh
resetprop -w sys.boot_completed 0
hide_usb_debug() {
while true; do
resetprop -w init.svc.adbd stopped
resetprop init.svc.adbd stopped
resetprop init.svc_debug_pid.adbd ""
resetprop -d ro.boottime.adbd
resetprop -c
@ilhan-athn7
ilhan-athn7 / meminfo.sh
Created June 28, 2026 06:42
Get memory usage of processes on android in a viable way
dumpsys meminfo | grep '(pid' | sed 's/,//g' | sed 's/ //g' | sort -h
@ilhan-athn7
ilhan-athn7 / allow_perm
Created June 4, 2026 18:54
Allow all permissions of android app
su -c "for perm in \$(dumpsys package com.example.app | grep 'android.permission' | awk '{print \$1}' | sort -u); do pm grant com.example.app \$perm; done" 2>/dev/null
@ilhan-athn7
ilhan-athn7 / system_image_rw_convert.py
Created December 1, 2025 10:58
Convert write-protected android partitions to RW equivalent
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#====================================================
# FILE: sdat2img.py
# AUTHORS: xpirt - luxi78 - howellzhu
# DATE: 2018-10-27 10:33:21 CEST
#====================================================
from __future__ import print_function
import sys, os, errno
@ilhan-athn7
ilhan-athn7 / mount.sh
Created December 1, 2025 10:56
Mount android partitions independently to desired path (thanks to reiryuki )
get_device() {
PAR="$1"
DEV="`cat /proc/self/mountinfo | awk '{ if ( $5 == "'$PAR'" ) print $3 }' | head -1 | sed 's/:/ /g'`"
}
mount_mirror() {
SRC="$1"
DES="$2"
RAN="`head -c6 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9'`"
while [ -e /dev/$RAN ]; do
@ilhan-athn7
ilhan-athn7 / usb_gadget.sh
Created December 1, 2025 10:54
USB Gadget for Android
# This part is likely not needed
# mkdir -p /config/usb_gadget/g1
# mkdir -p /config/usb_gadget/g1/functions/mass_storage.0
# echo 0x1d6b > /config/usb_gadget/g1/idVendor # Linux Foundation
# echo 0x0104 > /config/usb_gadget/g1/idProduct # Mass Storage
# echo 0x0100 > /config/usb_gadget/g1/bcdDevice
# echo 0x0200 > /config/usb_gadget/g1/bcdUSB
#mkdir -p /config/usb_gadget/g1/strings/0x409
#echo "1234567890" > /config/usb_gadget/g1/strings/0x409/serialnumber
@ilhan-athn7
ilhan-athn7 / termux_shell
Created November 26, 2025 11:24
Run termux shell inside adb shell
PATH=/data/data/com.termux/files/usr/bin LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so HOME=/data/data/com.termux/files/home /data/data/com.termux/files/usr/bin/bash -l
@ilhan-athn7
ilhan-athn7 / barcode_picture_remover.py
Created June 16, 2025 08:49
barcode_picture_remover
import os
import cv2
from pyzbar.pyzbar import decode
folder_path = 'path/to/your/folder'
if not os.path.isdir(folder_path):
print(f"Folder not found: {folder_path}")
exit(1)
@ilhan-athn7
ilhan-athn7 / archinstall_ubuntu_jammy.sh
Created March 3, 2024 11:22
Minimal ubuntu setup with kde-plasma desktop.
#!/bin/bash
#mkfs.ext4 /dev/nvme0n1p4
#mount /dev/nvme0n1p4 /mnt
debootstrap --variant=minbase \
--exclude="snapd,cloud-init,landscape-common,popularity-contest,ubuntu-advantage-tools,unattended-upgrades,netplan,networkd" \
jammy /mnt http://archive.ubuntu.com/ubuntu
echo ubuntu >/mnt/etc/hostname
echo 127.0.0.1 >>/mnt/etc/hosts