Note: Must have an work profile already setup, So that we can modify fw.sys.max_profiles to allow more work profiles
su # to gain root access
resetprop ro.debuggable 1
am restart
以下分析基于 Magisk 76ddfeb93a8b3612cd68988323f422e996751e16
由于 Magisk 更新太快了,决定弃坑,自己去看源码罢!
Zygisk 加载是通过替换 app_process ,修改 LD_PRELOAD ,再执行原 app_process 实现的。
#!/system/bin/sh | |
# install multi-file apk with pm | |
if [ "$(id -u)" -ne 0 ]; then | |
echo "Access denied!" | |
exit 1 | |
fi | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 name apk [[[apk] apk] ...]" | |
exit 1 |
#unsecure - SELinux enabled. | |
ro.build.selinux=1 | |
#unsecure - SELinux set permissive (not enforcing), disable re-applying policy and context. You must also edit the boot.img with those props and add 'setenforce 0' according to https://gist.github.com/eladkarako/5694eada31277fdc75cee4043461372e#gistcomment-3475304 -- then repack the boot.img and flash it (init.rc will launch at boot). | |
ro.boot.selinux=permissive | |
androidboot.selinux=permissive | |
persist.android.strictmode=0 | |
persist.selinux.enforcing=0 | |
ro.build.selinux.enforce=0 | |
security.perf_harden=0 |
Java.perform(function() { | |
var RootPackages = ["com.noshufou.android.su", "com.noshufou.android.su.elite", "eu.chainfire.supersu", | |
"com.koushikdutta.superuser", "com.thirdparty.superuser", "com.yellowes.su", "com.koushikdutta.rommanager", | |
"com.koushikdutta.rommanager.license", "com.dimonvideo.luckypatcher", "com.chelpus.lackypatch", | |
"com.ramdroid.appquarantine", "com.ramdroid.appquarantinepro", "com.devadvance.rootcloak", "com.devadvance.rootcloakplus", | |
"de.robv.android.xposed.installer", "com.saurik.substrate", "com.zachspong.temprootremovejb", "com.amphoras.hidemyroot", | |
"com.amphoras.hidemyrootadfree", "com.formyhm.hiderootPremium", "com.formyhm.hideroot", "me.phh.superuser", | |
"eu.chainfire.supersu.pro", "com.kingouser.com" | |
]; |
Java.perform(function(){ | |
console.log("\nRoot detection & SSL pinning bypass with Frida"); | |
var CertificateFactory = Java.use("java.security.cert.CertificateFactory"); | |
var FileInputStream = Java.use("java.io.FileInputStream"); | |
var BufferedInputStream = Java.use("java.io.BufferedInputStream"); | |
var X509Certificate = Java.use("java.security.cert.X509Certificate"); | |
var KeyStore = Java.use("java.security.KeyStore"); | |
var TrustManagerFactory = Java.use("javax.net.ssl.TrustManagerFactory"); | |
var SSLContext = Java.use("javax.net.ssl.SSLContext"); | |
var Volley = Java.use("com.android.volley.toolbox.Volley"); |
The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.
BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:
$ sudo sh -c 'curl --location --silent --fail "http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.iso" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.
then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:
#!/bin/sh | |
# | |
# A simple script to create a skype launcher | |
# that will pass alternative data home directory | |
# thus making it easy to run two Skype instances alongside | |
# | |
# Tesed on Mint 18 | |
# Requires the latest skypeforlinux.deb (v.8) from Microsoft |
#!/bin/sh | |
for d in */ ; do | |
HOME=$(pwd)/$d; | |
echo $d; | |
# Remove the comment by your need | |
# megasync # first run (configure client by client at once) | |
# megasync 2> /dev/null & # load all clients at non blocking way | |
done |
Howto execute system commands in Perl and possible danger | |
There are various ways to run system subproces in Perl. I will mention only 7 - few native (exec(), system, qx{}/``) and few which use additional libraries (Open("|"), IPC::Open2, IPC::Open3, IPC::Cmd) which are in fact in standard Perl distribution so they can be used without worries. | |
Introduction | |
Most people think that running system command from Perl is only done by system() or exec(), but there are many ways to achieve this task - some are better some are worse. Each of them has different performance, even specific usage of function could increase/decrease performance. This post is written only to help programmer choose right solution for task (solution secure, flexible and with best performance). | |
Note: I am using in this article some (quite much) text which is copied from PerlDoc - it will be in tag: <cite>. | |
Executing system command - possible ways | |
exec() - PerlDoc Page | |
system() - PerlDoc Page |