• Stars
    star
    216
  • Rank 183,179 (Top 4 %)
  • Language
    Shell
  • License
    BSD 2-Clause "Sim...
  • Created almost 9 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An easy way to patch ramdisks, replace kernels, and install files to your phone through recovery.

Kernel Flasher by jcadduono

To use:

Place a zImage/Image.gz (or any other variation of a kernel image) along with an optional dtb.img in the root directory and it will automatically be flashed by the zip.

To create a zip file, use make.

You can modify the Makefile and update-binary (a shell script) to print installation messages, and add custom scripts to the patch.d folder.

Template for patch.d script:

#!/sbin/sh

. "$env"

# add your scripts here

exit 0

You can also add your own functions to patch.d-env.

Existing functions available to patch.d scripts:

abort <error message> - aborts the installation and prints an error message
print <message> - prints a message to the installation console
replace_file <old file> <new file> - replace a file, preserving metadata (using cat)
replace_line <file> <line match mattern> <replacement line> - replace a matching line in a file with another line
insert_after_last <file> <line match pattern> <inserted line> - insert a specified line after the last matching line
setperm <directory permissions> <file permissions> <directory> - recursively sets permissions of files & directories
setcmdline <key> <value> - set a key's value on the boot image's initial command line
setprop <prop> <value> - set a prop value in default.prop
delprop <prop> - delete a prop from both default.prop and build.prop
disable_service <service> - searches init rc files and sets the matching service to disabled
remove_service <service> - searches init rc files and comments out all references to the matching service
ueventd_set <device node> <permissions> <chown> <chgrp> - use this to set permissions of /dev nodes
context_set <file path regex> <context> - use this to set selinux contexts of file paths
import_rc <rc file> - adds an init rc file as an import to init.rc, it will be imported last
secheck [-s <source type>] [-c <class>] - check if a given context label or class exists in the sepolicy
seadd [-Z / -z <domain> | -s <source type>] [-t <target type>] [-c <class>] [-z <domain>] [-p <perm,list>] [-a <type attr>] - add a new policy rule/domain to the sepolicy

Variables available to patch.d scripts:

$found_prop - true if default.prop exists in the ramdisk
$found_build_prop - true if build.prop exists in /system
$found_ueventd - true if ueventd.rc exists in the ramdisk
$found_sepolicy - true if sepolicy exists in the ramdisk
$found_file_contexts - true if file_contexts exists in the ramdisk
$android_api - Android API version estimated from sepolicy rules (19 <= K, 21 = L, 23 = M, 24 >= N)
$tmp - full path to installation extraction root (ex. /tmp/kernel-flasher)
$ramdisk - full path to extracted ramdisk root (current directory of patch.d scripts)
$ramdisk_patch - full path to new ramdisk files (applied automatically over the current ramdisk)
$split_img - full path to extracted contents of boot image (including cmdline)
$modules - full path to directory containing kernel modules for install to /system/lib/modules
$bin - full path to recovery executable binaries (ex. unpackbootimg, mkbootimg)

More Repositories

1

nethunter-installer-tools

A (source) collection of tools used in the Kali NetHunter installer, see:
C
42
star
2

linux_fs_exfat

exFAT filesystem driver for the Linux kernel (by Samsung Electronics Co., Ltd.)
C
24
star
3

idleKernel-note3

idleKernel is a fork of leanKernel for Samsung Galaxy Note 3. It adds new features and updates.
C
20
star
4

android_kernel_samsung_universal7420

Samsung kernel sources for the Galaxy Note 5, S6, S6 edge, and S6 edge+
C
19
star
5

android_kernel_samsung_universal8890

Android kernel source tree for Samsung Exynos 8890 devices
C
17
star
6

android_external_libbootimg

A library and executable for working with Android boot images.
C
17
star
7

android_device_oneplus_oneplus3t

TWRP device tree for OnePlus 3T (oneplus3t)
Makefile
13
star
8

kali-chroot-installer

Kali Linux chroot installer - taken from Kali NetHunter
Shell
11
star
9

android_kernel_samsung_universal3475

Android kernel source tree for Samsung Exynos 3475 devices
C
11
star
10

android_kernel_lge_msm8998

LG Electronics kernel sources for MSM8998 devices (Snapdragon 835)
C
10
star
11

android_kernel_oneplus_msm8996

Android kernel source tree for OnePlus msm8996 devices
C
10
star
12

android_kernel_lge_msm8996

Android kernel source tree for LGE msm8996 devices
C
9
star
13

android_device_samsung_heroqlte

TWRP device tree for Galaxy S7 (Qualcomm)
Makefile
9
star
14

android_kernel_samsung_msm8996

Android kernel source tree for Samsung msm8996 devices
C
8
star
15

android_kernel_samsung_exynos7870

TWRP kernel tree for Samsung Exynos 7870 devices
C
8
star
16

platform_external_vboot_reference

C
6
star
17

android_device_samsung_klte

TWRP device tree for Samsung Galaxy S5 (International Qualcomm, Americas, and Oceanic)
Makefile
6
star
18

android_device_xiaomi_lithium

TWRP device tree for Xiaomi Mi MIX (lithium)
Makefile
5
star
19

android_device_samsung_on5ltetmo

TWRP device tree for Samsung Galaxy On5 (T-Mobile & MetroPCS)
Makefile
5
star
20

android_kernel_zte_msm8996_old

Android kernel source tree for ZTE msm8996 devices
C
5
star
21

android_device_samsung_hero2qltechn

TWRP device tree for Samsung Galaxy S7 edge (China Qualcomm)
5
star
22

interface_addons_claw

Claw is an addon for druids that simplifies gameplay and maximizes DPS by doing all the decision making for you.
Lua
4
star
23

android_device_lge_us996

TWRP device tree for LG V20 (US Unlocked US996)
Makefile
4
star
24

android_kernel_google_chromeos

ChromeOS/Android kernel source tree for Google ChromeOS devices
C
4
star
25

android_device_samsung_gtaxlwifi

TWRP device tree for Samsung Galaxy Tab A 10.1 WiFi (2016 Exynos)
Makefile
4
star
26

android_external_hid-keyboard

HID keyboard gadget test repository for building under Android environment
C
4
star
27

android_kernel_lge_msm8996-caf

Android kernel source tree for LGE msm8996 devices (CAF merge)
C
4
star
28

twrp-installer-pixel

TWRP installer for Pixel - injects ramdisks to boot partitions.
Shell
3
star
29

android_device_lge_h930

Device tree for building TWRP for the LG V30 (Europe/Italy)
Makefile
3
star
30

android_device_lge_rs988

TWRP device tree for LG G5 (US Unlocked RS988)
Makefile
3
star
31

android_device_samsung_gteslte

TWRP device tree for Samsung Galaxy Tab E 8.0 (Exynos)
Makefile
3
star
32

nethunter-devices

This is just a little repo for testing devices for NetHunter on my limited bandwidth. :)
Shell
3
star
33

android_kernel_samsung_universal8895

Samsung Mobile kernel source for Universal8895 devices (Exynos 8895)
C
3
star
34

android_device_lge_h850

TWRP device tree for LG G5 (International H850)
Makefile
3
star
35

android_device_samsung_hero2qlte

TWRP device tree for Galaxy S7 Edge (Qualcomm)
Makefile
3
star
36

android_device_zte_ailsa_ii

TWRP device tree for ZTE Axon 7 (ailsa_ii)
Makefile
3
star
37

android_device_samsung_zerolte

TWRP device tree for Samsung Galaxy S6 Edge (International GSM)
Makefile
3
star
38

android_device_meizu_PRO5

TWRP device tree for Meizu Pro 5 (PRO5)
Makefile
2
star
39

android_external_screenres

screenres repository for building under Android environment
C
2
star
40

android_kernel_zte_msm8996

C
2
star
41

android_device_samsung_zeroltespr

TWRP device tree for Samsung Galaxy S6 Edge (Sprint)
Makefile
2
star
42

android_device_samsung_gtanotexllte

TWRP device tree for Samsung Galaxy Tab A 10.1 LTE (2016) with S-Pen
Makefile
2
star
43

android_device_samsung_graceltekor

TWRP device tree for Samsung Galaxy Note 7 (Korean Exynos)
Makefile
2
star
44

chat_adduono_com

Source code to chat.adduono.com, an unfinished project from when I was younger
JavaScript
2
star
45

android_device_razer_cheryl

TWRP device tree for the Razer Phone (1st generation 'cheryl')
Makefile
2
star
46

android_device_samsung_zerofltetmo

TWRP device tree for Samsung Galaxy S6 (T-Mobile)
Makefile
2
star
47

android_device_samsung_nobleltezt

TWRP device tree for Samsung Galaxy Note 5 (China Duos) - Kernel sources:
Makefile
2
star
48

android_device_samsung_zerofltespr

TWRP device tree for Samsung Galaxy S6 (Sprint)
Makefile
2
star
49

android_device_lge_h830

TWRP device tree for LG G5 (T-Mobile H830)
Makefile
2
star
50

android_device_samsung_noblelte

TWRP device tree for Samsung Galaxy Note 5 (GSM) - Kernel sources:
Makefile
2
star
51

android_device_samsung_zeroltetmo

TWRP device tree for Samsung Galaxy S6 Edge (T-Mobile)
Makefile
2
star
52

n900w8_restore

Restore all the unusual partitions to your SM-N900W8 using this zip
Shell
2
star
53

android_device_samsung_ha3g

TWRP device tree for Samsung Galaxy Note 3 (International Exynos)
Makefile
1
star
54

note7-disable-charging-limit

You don't actually want to do this, do you?
Shell
1
star
55

android_device_wileyfox_crackling

TWRP device tree for Wileyfox Swift (crackling)
Makefile
1
star
56

interface_addons_shrapnel

Shrapnel is an addon for hunters that simplifies gameplay and maximizes DPS by doing all the decision making for you.
Lua
1
star
57

android_external_bootimg

bootimg repository for building under Android environment
C
1
star
58

android_device_samsung_graceqlte

TWRP device tree for Samsung Galaxy Note 7 (Qualcomm)
Makefile
1
star
59

android_device_samsung_heroltekor

TWRP device tree for Samsung Galaxy S7 (Korea)
Makefile
1
star
60

interface_addons_goodhunting

Good Hunting is an addon for hunters that simplifies gameplay and maximizes DPS by doing all the decision making for you.
Lua
1
star
61

android_external_lz4

lz4 repository for building under Android environment
C
1
star
62

android_device_samsung_j1xlte

TWRP device tree for Samsung Galaxy J1 Exynos (2016)
Makefile
1
star
63

android_device_lge_h831

TWRP device tree for LG G5 (Canadian H831)
Makefile
1
star
64

android_external_bzip2

bzip2 repository for building under Android environment
C
1
star
65

android_device_samsung_noblelteskt

TWRP device tree for Samsung Galaxy Note 5 (Korea) - Kernel sources:
Makefile
1
star
66

interface_addons_lasik

Lasik is an addon for demon hunters that simplifies gameplay and maximizes DPS by doing all the decision making for you.
Lua
1
star
67

android_device_samsung_zenlte

TWRP device tree for Samsung Galaxy S6 Edge+ (International GSM)
Makefile
1
star
68

android_device_lge_h918

TWRP device tree for LG V20 (T-Mobile H918)
Makefile
1
star
69

twrp_kernel_samsung_jflte

TWRP kernel tree for Samsung Galaxy S4 (Qualcomm)
1
star
70

android_kernel_razer_msm8998

Android kernel sources for Razer Snapdragon 835 devices
C
1
star
71

interface_addons_smash

Smash is an addon for warriors that simplifies gameplay and maximizes DPS by doing all the decision making for you.
Lua
1
star
72

android_device_samsung_noblelteusc

TWRP device tree for Samsung Galaxy Note 5 (US Cellular) - Kernel sources:
Makefile
1
star
73

android_device_lge_vs995

TWRP device tree for LG V20 (Verizon Wireless VS995)
1
star
74

lazyflasher-bin

Source code for binaries used in LazyFlasher
1
star
75

android_device_samsung_herolte

TWRP device tree for Galaxy S7 (International & Canadian Exynos)
Makefile
1
star
76

android_device_generic

for building omnirom/twrp for generic devices
Makefile
1
star
77

interface_addons_monkseemonkdo

MonkSeeMonkDo is an addon for monks that simplifies gameplay and maximizes DPS by doing all the decision making for you.
Lua
1
star
78

android_device_samsung_graceqltechn

TWRP device tree for Samsung Galaxy Note 7 (China Qualcomm)
Makefile
1
star
79

android_device_samsung_gracelte

TWRP device tree for Samsung Galaxy Note 7 (Exynos)
Makefile
1
star
80

android_external_bbe

bbe is a sed-like editor for binary files. Instead of reading input in lines as sed, bbe reads arbitrary blocks from an input stream and performs byte-related transformations on found blocks.
C
1
star
81

android_device_samsung_kccat6

TWRP device tree for Samsung Galaxy S5 Plus (International)
Makefile
1
star
82

android_kernel_samsung_universal5420

TWRP kernel for Samsung Galaxy Note 3 (Exynos)
C
1
star
83

compat-zstd

Zstandard compression library - OpenVPN compatibility submodule
C
1
star