Skip to content

Instantly share code, notes, and snippets.

@draekko
draekko / PdkUtil.java
Created March 7, 2024 20:49 — forked from tdrkDev/PdkUtil.java
Samsung Camera reverse engineering notes. See SemCameraParameter.java for more in-depth notes.
package com.samsung.galaxytrash;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraDevice;
import android.hardware.camera2.params.OutputConfiguration;
import android.os.Build;
import android.util.Log;
import android.util.Size;
import dalvik.system.PathClassLoader;
import java.lang.reflect.Constructor;
@draekko
draekko / CameraService.java
Created April 25, 2023 13:00 — forked from ab2005/CameraService.java
Camera 2 raw frame grabber
package com.example.ab.myapplication;
import android.Manifest;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.ImageFormat;
import android.graphics.Point;
@draekko
draekko / linux-usb-file-copy-fix.md
Last active February 15, 2023 17:35 — forked from 2E0PGS/linux-usb-file-copy-fix.md
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

Building ROMs with microG integrated


Intro

I never thought I'd do this instead of just build normal ROMs and install microG manually just like people flashes opengapps or some other stuff, but then I found out that "LineageOS for microG" exists, stable custom ROM plus microG instead of bs out of box, nice idea isn't it?

@draekko
draekko / resumeable-file-download.php
Created February 23, 2021 12:26 — forked from ivankristianto/resumeable-file-download.php
Resumeable File Download With PHP
function serve_file_resumable ($file, $contenttype = 'application/octet-stream') {
// Avoid sending unexpected errors to the client - we should be serving a file,
// we don't want to corrupt the data we send
@error_reporting(0);
// Make sure the files exists, otherwise we are wasting our time
if (!file_exists($file)) {
header("HTTP/1.1 404 Not Found");
exit;
1. The texture target needs to be GLES20.GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D, e.g. in the glBindTexture calls and glTexParameteri calls.
2. In the fragment shader define a requirement to use the extension:
#extension GL_OES_EGL_image_external : require
3. For the texture sampler used in the fragment shader, use samplerExternalOES instead of sampler2D.
Everything below here is all in the C code, no more Java.
4. In the C code, use glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage) to specify where the data is, instead of using glTexImage2D family of functions.
@draekko
draekko / androidx-convert.sh
Last active July 26, 2020 13:45 — forked from dlew/script.sh
Simple AndroidX Migration Script (updated to work with Linux and avoid xarg argument list too long)
#!/usr/bin/env bash
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
#
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# It'll run faster on a clean build because then there are fewer files to scan over.
#
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`.
@draekko
draekko / gpt_parser.py
Created April 14, 2019 23:08 — forked from culots/gpt_parser.py
Feed this your GPT.bin, and out it shoots a partition.xml
#!/usr/bin/python
# Author : n0fate
# E-Mail rapfer@gmail.com, n0fate@live.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
@draekko
draekko / manifest.xml
Created February 14, 2019 09:28 — forked from filiprrs/manifest.xml
universal7880 manifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="https://github.com/TheMuppets/" name="TheMuppets" revision="lineage-15.1" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" revision="lineage-15.1" />
<project name="LineageOS/android_device_samsung_a7y17lte" path="device/samsung/a7y17lte" revision="lineage-16.0" />
<project name="LineageOS/android_device_samsung_a5y17lte" path="device/samsung/a5y17lte" revision="lineage-16.0" />
<project name="LineageOS/android_device_samsung_universal7880-common" path="device/samsung/universal7880-common" revision="lineage-16.0" />
<project name="LineageOS/android_kernel_samsung_universal7880" path="kernel/samsung/universal7880" revision="lineage-16.0" />
<project name="LineageOS/android_hardware_samsung" path="hardware/samsung" revision="lineage-16.0" />
<project name="LineageOS/android_packages_resources_devicesettings" path="packages/resources/devicesettings" remote="github" />
@draekko
draekko / cherrypick_list.txt
Created February 14, 2019 09:27 — forked from filiprrs/cherrypick_list.txt
cherry-pick list
https://github.com/TeamNexus/android_frameworks_native/commit/eb315db646ffca7bd5e02eb82b680d2cb3a4981f
https://github.com/TeamNexus/android_hardware_interfaces/commit/4fa05e6ab7a1219dd33432abe653ad027fd93413
https://github.com/LineageOS/android_device_samsung_universal7880-common/commit/74292bbfcc88e1d0cdeaf89b3dcf042486898bb0
https://github.com/LineageOS/android_kernel_samsung_universal7880/commit/aeb5bcc6ce6e77e880f97f2bcf5f535c7ca99cda