Skip to content

Instantly share code, notes, and snippets.

View DerGoogler's full-sized avatar
🍃
Busy.

Der_Googler DerGoogler

🍃
Busy.
View GitHub Profile
@LGLTeam
LGLTeam / android-read-write-file.cpp
Created April 19, 2021 13:45
Reading and writing text file via c++ for Android. No root
#include <string.h>
#include <cstring>
#include <fstream>
#include <iostream>
std::string dir = "/data/data/uk.lgl.modmenu/cache/imei";
std::string buf = "whatever";
std::ifstream myfile(dir);
if (!myfile.is_open()) {
std::ofstream os(dir.c_str(), std::ios::trunc);
@mrousavy
mrousavy / MEMOIZE.md
Last active June 28, 2024 17:29
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
@ppoffice
ppoffice / README.md
Last active July 2, 2024 09:45
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@mrk-han
mrk-han / change-accessibility-settings-with-adb.md
Last active July 1, 2024 20:20
Enable and Disable Android Accessibility Settings from the Command Line using ADB (Font scale, talkback, color blind)

Using ADB to control Accessbility settings for easier testing with Android Emulators + Real Devices

It's a lot easier to test accessibility on the fly using ADB. This gist attempts to make the days of navigating through the Android device settings UI to change Accessibility settings obsolete.

These ADB commands will hopefully encourage Android developers to test and use their apps with common Accessiblility settings enabled.

Credit to James Nitsch for inspiring this, and for figuring out the put commands to enable these settings.

Font Scale (Font Size -- Testing Dynamic Text)

@PasanBhanu
PasanBhanu / AndroidDownloadImage.java
Created September 26, 2019 09:04
Download Image from URL and Added to Gallery - Android (Java)
/*
This method can be used to download an image from the internet using a url in Android. This use Android Download Manager to
download the file and added it to the Gallery. Downloaded image will be saved to "Pictures"
Folder in your internal storage
*/
private void downloadImageNew(String filename, String downloadUrlOfImage){
try{
DownloadManager dm = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse(downloadUrlOfImage);
@pgp
pgp / BuildRustAppForAndroid.sh
Created April 11, 2019 08:36
Cross compile RUST application for Android (uses standalone toolchains, NDK >= 19 required)
# arm
export PATH=$PATH:$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC=armv7a-linux-androideabi19-clang
export CXX=armv7a-linux-androideabi19-clang++
~/.cargo/bin/cargo build --target armv7-linux-androideabi
# aarch64
export PATH=$PATH:$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC=aarch64-linux-android21-clang
export CXX=aarch64-linux-android21-clang++
@pabloko
pabloko / AndroidJSInterfaceComplexTypes.java
Created December 8, 2018 13:20
Lets have any JSON serializable type and methods to callback on Android WebView's JSInterface
//How it works: all the script relies on a tiny javascript stub injected to webView's document that uses Proxy api and json serialicing stuff. Calls to our internal objects are proxified to a single method "__mm_handle_method", that using reflection find the target method and populate arguments exchanged in json, plus a custom interface for methods passed as argument.
package es.pabloko.webviewbridge;
import android.app.Activity;
import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.webkit.JavascriptInterface;
@ww9
ww9 / gist_markdown_examples.md
Last active June 25, 2024 19:25
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
@veez21
veez21 / wpd
Last active October 11, 2023 15:19
View wifi passwords through Termux for Android Oreo+ (Root)
#!/system/bin/sh
[ "$(whoami)" != "root" ] && { echo "root required"; exit 1; }
configs=( /data/misc/wifi/WifiConfigStore.xml /data/misc/apexdata/com.android.wifi/WifiConfigStore.xml )
for z in ${configs[@]}; do
if [ -f $z ]; then
config=$z
break
fi
done