Skip to content

Instantly share code, notes, and snippets.

View lattice0's full-sized avatar
🦀

Lattice 0 lattice0

🦀
View GitHub Profile
@lattice0
lattice0 / gist:11e8b5d128a27b106f9702fb13638f46
Created April 5, 2021 04:19
run in background android ignore
./adb shell cmd appops set com.whatsapp RUN_IN_BACKGROUND ignore
./adb shell cmd appops set com.yubico.yubioath RUN_IN_BACKGROUND ignore
./adb shell cmd appops set com.instagram.android RUN_IN_BACKGROUND ignore
./adb shell cmd appops set com.whatsapp RUN_IN_BACKGROUND
./adb shell cmd appops set com.zhiliaoapp.musically RUN_IN_BACKGROUND ignore
./adb shell cmd appops set com.tinder RUN_IN_BACKGROUND ignore
./adb shell cmd appops get piuk.blockchain.android RUN_IN_BACKGROUND
./adb shell cmd appops set piuk.blockchain.android RUN_IN_BACKGROUND ignore
./adb shell cmd appops set br.com.intermedium RUN_IN_BACKGROUND ignore
./adb shell cmd appops set bipa.app.bipa RUN_IN_BACKGROUND ignore
@lattice0
lattice0 / gist:85ac2aaba12a09df383fb6ca42d1ca59
Created February 22, 2021 20:24
simple boinary file write tests C++
#include <iostream>
#include <fstream>
#include <vector>
int main()
{
std::fstream f;
std::string filePath = "file.txt";
f.open(filePath, std::ios_base::binary | std::ios_base::out | std::ios_base::in | std::ios_base::trunc );
if (!f.is_open()) {
@lattice0
lattice0 / gist:c83234be17b0864d4450dd2aeb4258a2
Created February 9, 2021 00:43
c++ file open/write test android
ALOGV(TAG, "#####################################################################");
std::fstream f;
ALOGV(TAG, "original filePath: %s", filePath.c_str());
std::string filePath2 = "/storage/emulated/0/Android/data/com.stompai.flutter_app/files/something_3.txt";//filePath + "22w";
ALOGV(TAG, "gonna open filePath2: %s", filePath2.c_str());
f.open(filePath2, std::ios_base::binary | std::ios_base::in | std::ios_base::out);
if (f.is_open()) {
ALOGV(TAG, "is open");
} else {
ALOGV(TAG, "is closed");
@lattice0
lattice0 / gist:c756b4a186ddcdfc095becb94db6efae
Created February 5, 2021 12:20
compilate qemu android emulator
repo init -u https://android.googlesource.com/platform/manifest -b emu-master-dev --depth=1
repo sync -c -j8
cd external/qemu
python android/build/python/cmake.py [--target darwin_aarch64]
https://fettec.net/en/shop/fettec-motor-1303.6 - FETtec Motor 1303.6
https://fettec.net/en/shop/fettec-mini-aio-15a - FETtec Mini AIO 15A (controller + ESCS?)
@lattice0
lattice0 / gist:0f5fa522e4561aa8f61e2089d6f013a4
Last active January 25, 2021 07:08
aosp study annotations
boot.img format:
https://forum.xda-developers.com/t/howto-unpack-edit-and-repack-boot-images.443994/
partitions explanation:
https://forum.xda-developers.com/t/info-android-device-partitions-and-filesystems.3586565/
bootloader unlock possibility for some brands:
@lattice0
lattice0 / x0vncserver.sh
Created January 6, 2021 00:10
x0vncserver for desktop
x0vncserver -display :0 -localhost -passwordfile ~/.vnc/passwd
@lattice0
lattice0 / make.sh
Created December 24, 2020 07:03
kernel compare 2
#This script will create a folder kernel_compare and download the first kernel in `kernel`, commit it, then download the second kernel on `kernel` also, and commit
mkdir kernel_compare
cd kernel_compare
mkdir kernel
#commit = 848ff3b146631bba895c487cd9104d094b987a47
git clone https://source.codeaurora.org/quic/la/kernel/msm-4.14
cd msm-4.14
@lattice0
lattice0 / main.dart
Created December 24, 2020 06:50
StatefulWidget wont change
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _MyAppState();
}
@lattice0
lattice0 / make.sh
Created December 22, 2020 20:29
Script to compare 2 kernels in VSCode using either GitLens or GitGraph extensions
#This script will create a folder kernel_compare and download the first kernel in `kernel`, commit it, then download the second kernel on `kernel` also, and commit
mkdir kernel_compare
cd kernel_compare
mkdir kernel
wget -O android-mainline.tar.gz https://android.googlesource.com/kernel/common/+archive/refs/heads/android-4.14-stable.tar.gz
tar xvzf android-mainline.tar.gz -C kernel
rm android-mainline.tar.gz