- emulator (30.3.5) (via Android SDK)
- adb (30.0.5) (via Android SDK)
- apktool (2.5.0) and Java runtime
- zip (3.0)
- unzip (6.0)
Make sure you have JAVA_HOME and ANDROID_HOME environment variables correctly set.
| #!/bin/sh | |
| [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup | |
| [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources | |
| vncconfig -iconic & | |
| export DESKTOP_SESSION=/usr/share/xsessions/ubuntu.desktop | |
| export XDG_CURRENT_DESKTOP=ubuntu:GNOME | |
| export GNOME_SHELL_SESSION_MODE=ubuntu | |
| export XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop | |
| dbus-launch --exit-with-session /usr/bin/gnome-session --systemd --session=ubuntu |
| #!/bin/bash | |
| cd / | |
| tar -cvpzf backup.tar.gz \ | |
| --exclude=/backup.tar.gz \ | |
| --exclude=/proc \ | |
| --exclude=/tmp \ | |
| --exclude=/mnt \ | |
| --exclude=/dev \ | |
| --exclude=/sys \ | |
| --exclude=/run \ |
Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.
Update system packages in Termux:
$ pkg update -y
| // Copyright 2020 ppoffice | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this softwareand associated documentation files(the "Software"), to | |
| // deal in the Software without restriction, including without limitation the | |
| // rights to use, copy, modify, merge, publish, distribute, sublicense, and /or | |
| // sell copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions : | |
| // | |
| // The above copyright noticeand this permission notice shall be included in |
| # recompile kernel first with patch: | |
| # https://github.com/postmarketOS/pmbootstrap/blob/4b10acc2535033414cd4f358433a51626096d7ce/aports/device/linux-lg-hammerhead/06_fix_mdss_fb_rgb_mode.patch | |
| git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 \ | |
| -b marshmallow-mr1-release \ | |
| ~/arm-eabi-4.8 | |
| git clone https://android.googlesource.com/kernel/msm \ | |
| -b android-msm-hammerhead-3.4-marshmallow-mr1 \ | |
| ~/msm | |
| git clone https://github.com/osm0sis/mkbootimg.git ~/mkbootimg | |
| cd ~/msm |
| from typing import Tuple | |
| import pyasn1.codec.der.encoder | |
| import pyasn1.type.univ | |
| import base64 | |
| import rsa | |
| def private_key_pem(n: int, e: int, d: int, p: int, q: int, dP: int, dQ: int, qInv: int) -> str: | |
| '''Create a private key PEM file |
system/core/rootdir/init.rc according to init.rc.diff. Make sure you mount all the cgroup subsystems needed (cpu, cpuacct, cpuset, memory, pids, devices, freezer, blkio) under /sys/fs/cgruop, otherwise lxc won't find them;emulator -kernel kernel-file-path) and use adb shell and dmesg to check if everything is doing ok.| # Get Pre-reqs | |
| apt-get install libattr1-dev git unzip make gcc automake pkg-config | |
| # Get Android NDK | |
| cd /root | |
| mkdir -p build && cd build | |
| wget http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -O /tmp/android-ndk-r10e-linux-x86_64.zip | |
| unzip /tmp/android-ndk-r10e-linux-x86_64.zip -d /root/build | |
| # Set paths |