Skip to content

Instantly share code, notes, and snippets.

View PIPIPIG233666's full-sized avatar
🐖
Michigan Engineering

Pig PIPIPIG233666

🐖
Michigan Engineering
View GitHub Profile
@PIPIPIG233666
PIPIPIG233666 / gist:986d2675de7abcff0c5f6407de7bdff8
Last active July 27, 2019 00:38 — forked from DD3Boh/gist:6c51fd3c5f91b1042e956771483714de
How to merge a newer CAF tag in an android kernel (For msm kernel)
For msm
Go into your kernel folder with a terminal and do
git fetch https://source.codeaurora.org/quic/la/kernel/msm-xxx/ LA.UM.x.x.rx-0XXXX-xxxxxx.x
Then to do the merge you just have to do
git merge FETCH_HEAD
Now just fix the conflicts if there and then do
@PIPIPIG233666
PIPIPIG233666 / gist:c1c421b2e35ec9ea097ecee474e0a8f7
Created May 18, 2019 22:22 — forked from msfjarvis/sepolicy.md
How to write sepolicy to fix a denial

Denial in question

*scontext=u:r:system_app:s0 tcontext=u:object_r:ipa_dev:s0 tclass=chr_file permissive=0

sepolicy fix

allow system_app ipa_dev:chr_file {read write};
#!/bin/bash
set -e
sed -i -e 's/^#\(en_US\|zh_CN\)\(\.UTF-8\)/\1\2/g' /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
ln -sf /usr/share/zoneinfo/Asia/New_York /etc/localtime
hwclock --systohc
@PIPIPIG233666
PIPIPIG233666 / gist:10378208aa7c42cdb43a5b465cd46847
Created February 10, 2020 11:39
LA.UM.8.9.r1-07700-SM6xx.0 telephony crash
02-10 01:15:28.015 25699 25699 D AndroidRuntime: Shutting down VM
02-10 01:15:28.016 25699 25699 E AndroidRuntime: FATAL EXCEPTION: main
02-10 01:15:28.016 25699 25699 E AndroidRuntime: Process: com.android.phone, PID: 25699
02-10 01:15:28.016 25699 25699 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method getEssentialRecordsLoaded()Z in class Lcom/android/internal/telephony/uicc/IccRecords; or its super classes (declaration of 'com.android.internal.telephony.uicc.IccRecords' appears in /system/framework/telephony-common.jar)
02-10 01:15:28.016 25699 25699 E AndroidRuntime: at com.qualcomm.qti.internal.telephony.dataconnection.QtiDcTracker.onRecordsLoadedOrSubIdChanged(QtiDcTracker.java:82)
02-10 01:15:28.016 25699 25699 E AndroidRuntime: at com.android.internal.telephony.dataconnection.DcTracker$DctOnSubscriptionsChangedListener.onSubscriptionsChanged(DcTracker.java:412)
02-10 01:15:28.016 25699 25699 E AndroidRuntime: at android.telephony.SubscriptionManager$OnSubscriptions
@PIPIPIG233666
PIPIPIG233666 / gist:6b4bf1ee4817a9e9c3279aaf0c1aa7e0
Created April 1, 2020 23:29
script to remove OEM Copyright
string="Copyright (C) $1 XiaoMi, Inc."
while IFS= read -r file; do
sed -i "/$string/d" "$file" || continue;
done < <(grep -R "$string" . | cut -d ':' -f 1)
@PIPIPIG233666
PIPIPIG233666 / kernel-module
Last active September 14, 2022 11:25
Simple script to import/update kernel modules
#!/bin/bash
#
# Copyright (C) 2020 Pig <pig.priv@gmail.com>
#
# Simple script to import/update kernel modules
# Version 0.2
#
# Aliases
cai='git commit --amend --no-edit'
__int64 __fastcall enable_snd_device(__int64 a1, unsigned int a2)
{
unsigned __int64 v2; // x22
unsigned int v3; // w20
__int64 result; // x0
__int64 v5; // x19
__int64 v6; // x21
__int64 v7; // x0
const char *v8; // x2
signed __int64 v9; // x21
#!/bin/bash
source build/envsetup.sh
breakfast davinci
git -C device/xiaomi/davinci/ fetch https://github.com/sm6150-dev/android_device_xiaomi_davinci && git -C device/xiaomi/davinci/ checkout FETCH_HEAD
git -C device/xiaomi/sm6150-common/ fetch https://github.com/sm6150-dev/android_device_xiaomi_sm6150-common && git -C device/xiaomi/sm6150-common/ checkout FETCH_HEAD
git -C kernel/xiaomi/sm6150/ fetch https://github.com/sm6150-dev/android_kernel_xiaomi_sm6150 && git -C kernel/xiaomi/sm6150/ checkout FETCH_HEAD
set -e
changes=(
278020 # FODCircleView: handle more visibility cases
278021 # FODCircleView: let's smoothly fade-out the view, before going to View.GONE
@PIPIPIG233666
PIPIPIG233666 / gist:b3e51b79089700e7bef9431c6b893d4f
Created August 17, 2020 13:35
stock platform_set_echo_reference
int __fastcall platform_set_echo_reference(int a1, int a2, int a3)
{
int v3; // r5
int v4; // r7
int v5; // r8
int v6; // r4
int v7; // r4
int v8; // t1
int v9; // r0
int v10; // r6
yikes, gh.