Skip to content

Instantly share code, notes, and snippets.

@draekko
draekko / lineage20src
Created December 21, 2024 23:55 — forked from filiprrs/lineage20src
LineageOS 20 sources for compiling
Hello A5 And A7 2017 community. :)
This makes the sources I was using to create LineageOS builds for our devices free, open and available for everyone.
Feel free to use this to create personal builds or update the community with newer security patches or small improvements.
Feel free to also use this as a base for creating other third party roms that are not necessarily LineageOS.
However please note that I have spent a lot of my personal time on this project.
And so did numerous other people from LineageOS team and Samsung exynos developer community.
I would only like to kindly request to give proper credits where due.
Thanks.
a5y17lte device tree: https://github.com/LineageOS/android_device_samsung_a5y17lte branch lineage-18.1
@draekko
draekko / lineage21src
Created December 21, 2024 23:55 — forked from filiprrs/lineage21src
LineageOS 21 sources for compiling
Hello A5 And A7 2017 community. :)
This makes the sources I was using to create LineageOS builds for our devices free, open and available for everyone.
Feel free to use this to create personal builds or update the community with newer security patches or small improvements.
Feel free to also use this as a base for creating other third party roms that are not necessarily LineageOS.
However please note that I have spent a lot of my personal time on this project.
And so did numerous other people from LineageOS team and Samsung exynos developer community.
I would only like to kindly request to give proper credits where due.
Thanks
These sources are for building LineageOS 21 before QPR2 merge occured.
@draekko
draekko / convert-wmm-coefficients.sh
Created December 18, 2024 18:18
convert-wmm-coefficients.sh
#!/usr/bin/env bash
inputfile=$1
function printCoeficientCode() {
spaces=" "
coeff=()
coeff+=("0.0") ;
if [ $3 -eq 3 ]; then
list=`cat $2 | awk '{ print $3 }'`
@draekko
draekko / GeomagneticField2025.java
Created December 18, 2024 18:15
GeomagneticField2025.java
/*
* Copyright (C) 2009 The Android Open Source Project
* Copyright (C) 2015, 2019 - 2024 Benoit Touchette
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@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.