Skip to content

Instantly share code, notes, and snippets.

View Quarx2k's full-sized avatar
🏠
Working from home

Nickolay Semendyaev Quarx2k

🏠
Working from home
View GitHub Profile
@Quarx2k
Quarx2k / gist:a96dd95f2d71b9d478280690cb6098c8
Last active October 21, 2021 10:41
Oneplus 7Pro 48M Mode Enabler
private int[] getSensorsModeTable(CameraCharacteristics characteristics) {
//OP7 Pro return. Used by video recording.
//Sensor modes: [9, 3, 4000, 3000, 30, 4000, 3000, 30, 4000, 3000, 60, 2000, 1128, 240, 1296, 736, 480, 2000, 1500, 120, 4000, 3000, 23, 4000, 3000, 30, 8000, 6000, 21]
Constructor<CameraCharacteristics.Key> cameraCharacteristicsConstructor;
try {
cameraCharacteristicsConstructor = CameraCharacteristics.Key.class.getDeclaredConstructor(String.class, Class.class);
cameraCharacteristicsConstructor.setAccessible(true);
CameraCharacteristics.Key KEY_SENSOR_MODE_TABLE =
cameraCharacteristicsConstructor.newInstance("org.quic.camera2.sensormode.info.SensorModeTable", int[].class);
@Quarx2k
Quarx2k / The WTF KEK
Last active September 26, 2018 10:44
WTF KEK
package com.company;
import java.io.*;
import java.nio.CharBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
#include <stdio.h>
#include <string.h>
/* 2.6.32 */
#define OMAP343X_PADCONF_OFF_WAKEUP_ENABLED (1 << 14)
#define OMAP343X_PADCONF_OFF_PULL_UP (1 << 13)
#define OMAP343X_PADCONF_OFF_PULL_DOWN (0 << 13)
#define OMAP343X_PADCONF_OFF_PUD_ENABLED (1 << 12)
<1>[ 0.666046] Muxdump!
<1>[ 0.666992]
<1>[ 0.666992] Muxdump: 30: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<1>[ 0.666992] Muxdump: 32: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<1>[ 0.666992] Muxdump: 34: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<1>[ 0.666992] Muxdump: 36: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<1>[ 0.666992] Muxdump: 38: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<1>[ 0.666992] Muxdump: 3a: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<1>[ 0.666992] Muxdump: 3c: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<1>[ 0.666992] Muxdump: 3e: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456085] Muxdump!
<4>[ 0.456085]
<4>[ 0.456085] Muxdump: 30: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456115] Muxdump: 32: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456115] Muxdump: 34: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456115] Muxdump: 36: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456146] Muxdump: 38: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456146] Muxdump: 3a: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456146] Muxdump: 3c: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
<4>[ 0.456176] Muxdump: 3e: | OMAP343X_PADCONF_INPUT_ENABLED| OMAP343X_PADCONF_MUXMODE0
@Quarx2k
Quarx2k / gist:df73cf647e9e837cbfc9
Created October 22, 2014 11:51
Detailed MUX Defy
<4>[ 0.000000] Setting: 0x500. Offset = 0x30 + base: 0x48002000 == 0x48002030
<4>[ 0.000000] Setting: 0x100. Offset = 0x32 + base: 0x48002000 == 0x48002032
<4>[ 0.000000] Setting: 0x100. Offset = 0x34 + base: 0x48002000 == 0x48002034
<4>[ 0.000000] Setting: 0x100. Offset = 0x36 + base: 0x48002000 == 0x48002036
<4>[ 0.000000] Setting: 0x100. Offset = 0x38 + base: 0x48002000 == 0x48002038
<4>[ 0.000000] Setting: 0x100. Offset = 0x3a + base: 0x48002000 == 0x4800203a
<4>[ 0.000000] Setting: 0x100. Offset = 0x3c + base: 0x48002000 == 0x4800203c
<4>[ 0.000000] Setting: 0x100. Offset = 0x3e + base: 0x48002000 == 0x4800203e
<4>[ 0.000000] Setting: 0x100. Offset = 0x40 + base: 0x48002000 == 0x48002040
<4>[ 0.000000] Setting: 0x100. Offset = 0x42 + base: 0x48002000 == 0x48002042
@Quarx2k
Quarx2k / gist:a74402a2b822d544e0b3
Created October 22, 2014 11:15
RAW Full Defy MUX conf
/* Do not ask me wtf is this */
omap_writew(1280, 1207967792);
omap_writew(256, 1207967794);
omap_writew(256, 1207967796);
omap_writew(256, 1207967798);
omap_writew(256, 1207967800);
omap_writew(256, 1207967802);
omap_writew(256, 1207967804);
omap_writew(256, 1207967806);
omap_writew(256, 1207967808);
<3>[ 0.000000] padconf override, offset = 0x007a setting = 0x411f
<3>[ 0.000000] padconf override, offset = 0x007c setting = 0x411f
<3>[ 0.000000] padconf override, offset = 0x007e setting = 0x411f
<3>[ 0.000000] padconf override, offset = 0x0080 setting = 0x411c
<3>[ 0.000000] padconf override, offset = 0x0082 setting = 0x411f
<3>[ 0.000000] padconf override, offset = 0x0084 setting = 0x411c
<3>[ 0.000000] padconf override, offset = 0x0086 setting = 0x411f
<3>[ 0.000000] padconf override, offset = 0x0088 setting = 0x411f
<3>[ 0.000000] padconf override, offset = 0x008a setting = 0x011f
<3>[ 0.000000] padconf override, offset = 0x008c setting = 0x011c
diff -r /mnt/sdc1/kernels/jordan-kernel/drivers/usb/Kconfig /mnt/sdc1/kernels/usb/Kconfig
171,172d170
< source "drivers/usb/ipchost/Kconfig"
<
diff -r /mnt/sdc1/kernels/jordan-kernel/drivers/usb/Makefile /mnt/sdc1/kernels/usb/Makefile
54d53
< obj-$(CONFIG_USB_IPC) += ipchost/
diff -r /mnt/sdc1/kernels/jordan-kernel/drivers/usb/core/hub.c /mnt/sdc1/kernels/usb/core/hub.c
796,797d795
< #ifndef CONFIG_MACH_OMAP_MAPPHONE_DEFY
@Quarx2k
Quarx2k / akmd2.txt
Created August 20, 2012 13:45
Patch the defy akmd2 for TLS.
00002D6A: 72 71
0000539C: 59 58
00005460: F7 F6
000054AE: D0 CF
000054C6: C4 C3
000054D2: BE BD
000054EA: B2 B1
000054F6: AC AB
00005504: A5 A4
00005682: E6 E5