Skip to content

Instantly share code, notes, and snippets.

@mariodantas
mariodantas / edit-init-rc.md
Created January 15, 2023 20:51 — forked from ashutosh-mishra/edit-init-rc.md
How to run custom script from init.rc, How to Extract Android Kernel And Modify The Boot Ramdisk(Android 4+)

init.rc changes

init.rc changes to run any script Can be used to start any android application, service

on property:dev.bootcomplete=1
    exec - system system -- /system/bin/sh <custom script path>
    # exec - system system -- /system/bin/sh /data/local/bootscript/testservice.sh

Script can contains applications start, stop commands

@mariodantas
mariodantas / TestMPSFuelAPI.java
Last active November 21, 2021 19:54
This code shows how to call MPS Fuel API
package <YOURPACKAGENAME>;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
@mariodantas
mariodantas / AdbCommands
Created November 7, 2021 14:51 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@mariodantas
mariodantas / extract android kernel.md
Created June 15, 2021 09:39 — forked from azureru/extract android kernel.md
How to Extract Android Kernel And Modify The Boot Ramdisk (Android 4.4) on Allwinner based Processor

Extracting Existing Kernel + Ramfs

Enter the machine using adb shell

Run cat /proc/partitions

  #  Path                     Purpose        Size
  0 /dev/block/mmcblk0                       7761920
  1 /dev/block/mmcblk0p1      data           6085631