Skip to content

Instantly share code, notes, and snippets.

View blackbbc's full-sized avatar

Tim Luo blackbbc

View GitHub Profile
@blackbbc
blackbbc / build-protobuf-android.sh
Created August 29, 2019 12:46
Build protobuf shared library
# Step 3. Generate Makefile with CMake.
# -Dprotobuf_BUILD_SHARED_LIBS=ON By default is static library (*.a file). I want a
# shared library (*.so file).
# -DCMAKE_INSTALL_PREFIX Because it's a cross-compiled library. You probably
# want to install the header files and shared library
# in specific folder rather than default /usr/local
# directory.
# -DANDROID_STL=c++_shared For the library using C++11, link to C++11 runtime.
# -DANDROID_LINKER_FLAGS="-landroid -llog" For the library using functions of libandroid.so
# and liblog.so.
@blackbbc
blackbbc / build-protobuf-android.sh
Created August 29, 2019 08:00
Build protobuf for Android
export PREFIX=~/Downloads/protobuf-3.5.0/build-v7a/
export PATH=$TOOLCHAIN/bin:$PATH
export SYSROOT=$TOOLCHAIN/sysroot
export CC="arm-linux-androideabi-clang --sysroot $SYSROOT"
export CXX="arm-linux-androideabi-clang++ --sysroot $SYSROOT"
export CXXSTL=$NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9
export LD=$TOOLCHAIN/bin/arm-linux-androideabi-ld
../configure \
--prefix=$PREFIX \
@blackbbc
blackbbc / gowther.h
Created May 7, 2018 18:49
launch gowther
adb reverse localabstract:droidpuppet_endpoint tcp:12345
PACKAGE=`pm path me.sweetll.gowther` PACKAGE=${PACKAGE#*:}
CLASSPATH=$PACKAGE app_process -Djava.library.path=/system/lib64:${PACKAGE%/*}/lib/arm64 /system/bin me.sweetll.gowther.Main
#pragma once
#include <cstdio>
extern "C" {
#include <SDL/SDL.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavutil/pixfmt.h>
#include <libavutil/error.h>
@blackbbc
blackbbc / main.c
Created October 26, 2017 01:32 — forked from pawitp/main.c
UInput Event Injector (Inject Event into Android via kernel)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/input.h>
#include <linux/uinput.h>
#define die(str, args...) do { \
@blackbbc
blackbbc / Android Studio .gitignore
Created March 1, 2016 02:37 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files