Skip to content

Instantly share code, notes, and snippets.

View gauravssnl's full-sized avatar
😸
use code::latest ;

GAURAV gauravssnl

😸
use code::latest ;
View GitHub Profile
@gauravssnl
gauravssnl / root_bypass.js
Created January 4, 2024 19:56 — forked from pich4ya/root_bypass.js
Bypass Android Root Detection / Bypass RootBeer - August 2019
// $ frida -l antiroot.js -U -f com.example.app --no-pause
// CHANGELOG by Pichaya Morimoto (p.morimoto@sth.sh):
// - I added extra whitelisted items to deal with the latest versions
// of RootBeer/Cordova iRoot as of August 6, 2019
// - The original one just fucked up (kill itself) if Magisk is installed lol
// Credit & Originally written by: https://codeshare.frida.re/@dzonerzy/fridantiroot/
// If this isn't working in the future, check console logs, rootbeer src, or libtool-checker.so
Java.perform(function() {
var RootPackages = ["com.noshufou.android.su", "com.noshufou.android.su.elite", "eu.chainfire.supersu",
@gauravssnl
gauravssnl / building-gstreamer-from-source.md
Created December 25, 2023 20:09 — forked from SleepingSoul/building-gstreamer-from-source.md
Building GStreamer from source on Linux device

Hardware used: Orange Pi 4 LTS

OS: Armbian Jammy

Should work everywhere on Debian or Ubuntu

Step 1: Install build tools (meson, ninja)

Usually gstreamer uses newer version of meson then available in apt packages, so we need to also build and install it from source. This is super easy. Here I am using 1.2.3 version that is currently latest, but you can use any other version.

sudo apt install pip
@gauravssnl
gauravssnl / ping.py
Created December 24, 2023 06:08 — forked from lotabout/ping.py
Simple ping implementation in python3 for practicing TCP/IP
#!/usr/bin/env python3
import os
import struct
import socket
import time
def checksum(bytestr):
# ref
# - https://en.wikipedia.org/wiki/IPv4_header_checksum
@gauravssnl
gauravssnl / traceroute.py
Created December 24, 2023 06:08 — forked from lotabout/traceroute.py
Simple traceroute implementation in Python3
#!/usr/bin/env python3
import struct
import socket
import time
# Need to run with root permission cause RAW socket is used
# ref:
# - https://dnaeon.github.io/traceroute-in-python/
@gauravssnl
gauravssnl / MyBenchmark.java
Created December 24, 2023 05:54 — forked from lotabout/MyBenchmark.java
CompletableFuture.supplyAsync profile
package me.lotabout;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
@gauravssnl
gauravssnl / MyHttpInjector.kt
Created December 21, 2023 09:50 — forked from hfutxqd/MyHttpInjector.kt
simple http injector sample for netbare
package com.android.netbare
import android.text.TextUtils
import android.util.Log
import com.github.megatronking.netbare.http.HttpBody
import com.github.megatronking.netbare.http.HttpRequest
import com.github.megatronking.netbare.http.HttpResponse
import com.github.megatronking.netbare.injector.InjectorCallback
import com.github.megatronking.netbare.injector.SimpleHttpInjector
import java.io.ByteArrayInputStream
@gauravssnl
gauravssnl / 8GB_android-12_compilation-note
Created December 20, 2023 10:38 — forked from verNANDo57/8GB_android-12_compilation-note
Workarounds for building Android 12 on 8GB RAM
Workarounds for building S on 8GB RAM environment:
1. At the start of the build:
[ 99% 138/139] /mnt/ssd/lineage/out/soong/.bootstrap/bin/soong_build /mnt/ssd/lineage/out/soong/build.ninja
This used to take around 30mins, after enabling zram now it takes around 30secs (thanks to @kdrag0n for the zram idea) which is on par with what happens in 16GB RAM building environments
sudo apt install zram-config for installing zram-config package
sudo nano /etc/fstab and add a # in front of the swap disk if you have one and then reboot
After booting cat /proc/swaps to check if zram is enabled or not
@gauravssnl
gauravssnl / ProcessOutputReader.java
Created June 21, 2023 15:01
Continously running Process output reader example in Java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ProcessOutputReader {
public static void main(String[] args) throws IOException {
String command = "./target/debug/rserver";
ProcessBuilder processBuilder = new ProcessBuilder(command);
processBuilder.redirectErrorStream(true);
Process process = processBuilder.start();
@gauravssnl
gauravssnl / Building Linux Kernel With Android.md
Created June 13, 2023 16:10 — forked from EduApps-CDG/Building Linux Kernel With Android.md
A guide of How to Build Linux Kernel using android

How to Build Linux Kernel with Android

This guide shows how to build Linux on a Android Device and was made for people that doesn't have s Computer.

Minimum Requiriments:

  • 4GB of free space (2GB if delete the temp files)
  • Android 5.0

Preparing the Environment

You need to install Termux