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 / 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'
@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 / 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
#!/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: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};
@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