Skip to content

Instantly share code, notes, and snippets.


Duy Tran Khanh khanhduytran0

View GitHub Profile
khanhduytran0 /
Last active Sep 19, 2021
OptiFine 1.17.x assets patcher for PojavLauncher.
* These following steps are not currently automated, so you need to do manually for now.
* download at
* extract and copy the shaders folder to the resources folder.
* edit include/light.glsl add `#define texture texture2D` after `#version 100` line
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
khanhduytran0 / dlopen.cpp
Created Aug 23, 2020
Example of dlopening greylisted libraries or dlopening libraries with custom LD_LIBRARY_PATH. Android 5.0+
View dlopen.cpp
#include <dlfcn.h>
#include <cstring>
#include <android/dlext.h>
#include "log.h" // LOGE, LOGW, etc...
bool (*_android_init_namespaces)(const char* public_ns_sonames, const char* anon_ns_library_path) = nullptr;
bool __unused android_init_namespaces(const char* public_ns_sonames, const char* anon_ns_library_path) {
if (!_android_init_namespaces) {
void *libdl_handle;
khanhduytran0 /
Created Jun 22, 2020
gl-streaming command finder from command index
import java.util.*;
public class GLSCommandFinder
private static final String glsCmdHeaderPath = "/sdcard/AppProjects/gl-streaming/common/gls_command.h";
private static List<Integer> cmdlineList;
private static List<String> commandList;
public static void main(String[] args)