Skip to content

Instantly share code, notes, and snippets.

@ins1der1211
ins1der1211 / gist.kt
Last active December 15, 2023 07:55
*Not* Restartable app
Register in the manifest receiver that catch all possible implicit broadcasts
(https://developer.android.com/guide/components/broadcast-exceptions)
In this example I used locale changed broadcast.
<receiver android:name=".broadcast.HackBroadcast"
android:exported="true"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.LOCALE_CHANGED" />
@ins1der1211
ins1der1211 / gist:e169414596e05a00de710c3f82dced14
Created April 19, 2023 14:06
Compile u-boot for BBB + save env file on emmc
git clone https://github.com/u-boot/u-boot.git
cd u-boot
git checkout -b emmc_env v2023.04-rc5
export CROSS_COMPILE=arm-linux-gnueabi- && export ARCH=arm
make am335x_evm_defconfig
make xconfig
# Go to Environment -> Device and partition for where to store the environment in FAT -> Enter 1:1. Save config
make -j8
@ins1der1211
ins1der1211 / bbb.txt
Created March 9, 2023 17:24
Beaglebone black. Compile uboot and linux with buildroot. Create bootable sd card and flash eMMC.
sudo apt install sed make binutils gcc g++ bash patch gzip bzip2 perl tar cpio python unzip rsync wget libncurses-dev
git clone https://git.buildroot.net/buildroot
git checkout -b bootlin 2022.02
make beaglebone_defconfig
make -j16
package some.pkg
import android.content.SharedPreferences
import com.squareup.moshi.JsonAdapter
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.MutableSharedFlow
import timber.log.Timber
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
@ins1der1211
ins1der1211 / open_links_script.sh
Created April 8, 2020 20:23
Open links from txt file in google chrome tabs
@ins1der1211
ins1der1211 / d_r_s.txt
Created December 20, 2019 12:59
Decompile/rebuild/sign
apktool d ${APK_NAME}.apk
apktool b --use-aapt2 .
jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android *.apk androiddebugkey
@ins1der1211
ins1der1211 / build_opencv_for_android_3.4.7.sh
Created November 15, 2019 14:07
Shell script to build opencv for android
#!/bin/bash
export OPENCV_ROOT=/mnt/hdd/Downloads/opencv/3.4.7
export ANDROID_STANDALONE_TOOLCHAIN=${OPENCV_ROOT}/build/toolchain
export ANDROID_NDK=/mnt/hdd/Downloads/android-ndks/ndk-14
export ANDROID_HOME=/mnt/hdd/Android/Sdk
ANDROID_BUILD_DIR=${OPENCV_ROOT}/android_build
rm -rf $ANDROID_BUILD_DIR
mkdir $ANDROID_BUILD_DIR
mkdir /mnt/hdd/Downloads/opencv/opencv/build && \
cd /mnt/hdd/Downloads/ndk-16/build/tools/ && \
python make_standalone_toolchain.py \
--arch arm \
--api 21 \
--install-dir /mnt/hdd/Downloads/opencv/opencv/build/toolchain && \
export ANDROID_STANDALONE_TOOLCHAIN=/mnt/hdd/Downloads/opencv/opencv/build/toolchain && \
export ANDROID_HOME=/mnt/hdd/Android/Sdk/ && \
export ANDROID_NDK_HOME=/mnd/hdd/Downloads/ndk-16/ && \
cd /mnt/hdd/Downloads/opencv/opencv/build/ && \