Skip to content

Instantly share code, notes, and snippets.

View rajatgupta1998's full-sized avatar
💻
Blessing your screen.

Rajat Gupta rajatgupta1998

💻
Blessing your screen.
View GitHub Profile
@sourajitk
sourajitk / FWB-Push-Guide-Github.md
Last active April 6, 2024 16:48
How to push AOSP Frameworks base to your own Github repository.

Let's start by cloning base.

Due to the sheer size and history of AOSP's frameworks_base repository, pushing it to GitHub isn't exactly straightforward. In this guide, I'll walk you through the entire process of pushing the contents of frameworks_base to a GitHub repository.

Let's start with cloning an older version of Android's frameworks_base.

Here, I have cloned:

https://github.com/aosp-mirror/platform_frameworks_base -b nougat-release

Introduction

Google has traditionally been against upgrading the compiler as it comes with new warnings and potentially changes behavior. However, these are actually good reasons to upgrade, they help shake out undefined behavior.

Process

In order to compile with a newer version of GCC, you'll need to do a few modifications to your kernel in addition to a new toolchain. I recommend using the ones available from Bootlin.

  1. Remove gcc-wrapper and any instances of -Werror: gcc-wrapper is CAF's shitty way of enabling -Werror, which is unnecessary since regular -Werror will suffice. We need to remove it for the time being because there will be new warnings to fix. Pick Google's revert of it (3.18, 4.4) then remove any other instances of -Werror (such as in prima, qcacld-2.0, and qc
@erfanoabdi
erfanoabdi / sparse_convertor.sh
Created August 6, 2017 04:34
sparseChunks to image Convertor for motorola images
#!/bin/sh
#SparseChunks to image Convertor for motorola images by Erfan Abdi
#special thanks to superR for header removal script
#make sure you have only one image with sparse chunks (system or oem)
echo "Converting all SparseChunks to Raw Image"
./simg2img *chunk* system.img.raw
echo "Removing Moto Header"
offset=$(LANG=C grep -aobP -m1 '\x53\xEF' system.img.raw | head -1 | gawk '{print $1 - 1080}')
dd if=system.img.raw of=system_moto.img ibs=$offset skip=1 2>&1
@msfjarvis
msfjarvis / sepolicy.md
Last active December 16, 2023 20:50
How to write sepolicy to fix a denial