Total Pageviews

Sunday 19 June 2022

用Magisk使Android获得Root权限

 Introduction

Magisk1 is a suite of open source software for customizing Android, supporting devices higher than Android 5.0.

Some highlight features:

    MagiskSU: Provide root access for applications
    Magisk Modules: Modify read-only partitions by installing modules
    MagiskBoot: The most complete tool for unpacking and repacking Android boot images
    Zygisk: Run code in every Android applications' processes

This is my notes on installing it on my op6 following the official installation guide:
https://topjohnwu.github.io/Magisk/install.html

Download and install Magisk app
Download latest Magisk apk from github releases:
https://github.com/topjohnwu/Magisk/releases/latest ,Install it:
adb insatll Magisk.apk

After launching the app, notice the Ramdisk value (mine is Yes), it means whether or not your device has boot ramdisk.
    if Yes, patch boot partition (I’ll choose this)
    if No, patch recovery partition

 

backup images:
This will need root access, so reboot to twrp recovery first.

# go to twrp recovery to get root access to your image partition
# adb reboot recovery
adb shell # commands below are executed in the android shell
# get current slot (A/B)
/bin/getprop ro.boot.slot_suffix
# _a, so I will backup /dev/block/by-name/boot_a
dd if=/dev/block/by-name/boot_a of=/sdcard/boot.img
# optional, if you have vbmeta partition
# dd if=/dev/block/by-name/vbmeta_a of=/sdcard/vbmeta.img
# adb pull /sdcard/vbmeta.img 
 

patch image and install:

patch image inside magisk app.

  • press install button in the magisk card
  • select the image just extracted

pull the patched image to your computer, reboot to bootloader, flash the new patched image to your android device.

adb pull /sdcard/Download/magisk_patched-xxx.img
adb reboot bootloader
fastboot flash boot magisk_patched-xxx.img
# if you patched the recovery partition
# fastboot flash recovery magisk_patched-xxx.img
# optional, patch and install the vbmeta partition
# fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
fastboot reboot

Now open Magisk app again, you can see it’s installed:

Magisk – The Magic Mask for Android 
-----------------------------------------------------------------------------------
Magisk 可以获取 ROOT 权限,以及可以安装各种好玩的模块,另外这个版本还带了谷歌 GApps 服务。

下载好带 Magisk 的 Android 13 后,解压缩,然后右键文件夹,选择 "复制文件路径"。
快捷键 Win+X - Windows终端 (管理员),依次输入下面的命令,等待安装。
CD ”空格" 粘贴你复制的文件路径
Add-AppxPackage -Register .\AppxManifest.xml

WSA开启调试模式:设置 - 开发人员模式 - 开启。然后利用 ADB 命令安装 Magisk 面具管理器:

ADB下载:
https://xia1ge.lanzoui.com/iPT5ivm2heb
Magisk面具管理器下载:
https://xia1ge.lanzoui.com/icIhow0h2pg

Windows终端输入命令:./adb connect 127.0.0.1:58526 (查看端口在 WSA 设置里面的开发人员模式位置)*如果连接失败,请尝试卸载安装的安卓模拟器,或者其它安卓手机管家类的软件。
接着输入命令:./adb install E:\路径\XXX.apk (具体 APK 路径自己修改)。安装 Magisk 面具管理器。

安装成功后,首次运行 Magisk 面具管理器会提示修复,确定等待修复后重启应用就可以正常使用了。模块和 ROOT 使用这里就不多介绍了,之前也给大家分享过 55G 模块,有兴趣的自己折腾。

网盘下载:
https://www.123pan.com/s/c8zA-XELN3
项目地址:
https://github.com/LSPosed/MagiskOnWSALocal 
------------------------------------------------------------
android手机内存不够用?试试这个 "A1内存管理" 模块

随着应用越来越臃肿、占用内存也越来越大,一些小内存的安卓机就容易出现杀后台、系统卡顿等情况。想要解决内存不够用可以冻结 / 阻止一些应用唤醒,例如你可以用小黑屋、冰箱等工具来冻结你很少用到的应用,不过需要手动比较麻烦。

现在酷安大佬 @HChai 制作了 Magisk 模块「A1内存管理」据介绍,是利用精神网络和退化算法,自动管理和优化内存,经测试可用内存提升 15% 左右,后台可挂应用提升 30% 还多。

A1内存管理介绍

使用 Magisk 模块 手机必须 ROOT 后刷入 Magisk 管理器,这里就不多介绍了,不会刷机的可以参考这篇文章:安卓刷机教程《从入门到变砖》

用 Magisk 刷入后「A1内存管理」重启,通过文件管理器,在 Android / Hc_memory 文件夹里面可以看到白名单、乖巧名单。


 

  • 白名单:表示不清理的应用包名,一般不用填。
  • 乖巧名单:自定义的进程清理,进阶玩家可以自行抓取软件进程,也可以从共享白名单下载即可。普通玩家用不到。

然后点击执行启动面板,勾上 ROOT。

下面是「A1内存管理」任务面板,勾选 A1 内存管理,点击保存参数,在退出面板。


其它功能介绍:

  • 乖巧进程:还记得文件夹里的「乖巧名单.conf」吗?勾选这里就会生效。
  • 增强杀后台:加大对子进程的限制,但注意有些 APP 在子进程被杀后主进程也会退出,相当于 APP 被完全杀后台。
  • 守护进程:增强保活主进程,下面的守护保活参数,负数越小保活系数越大。

一些说明

简单说明

  • 可以直接刷入无脑使用,"智能"调整参数开关模块功能
  • 守护进程功能与部分模块prop参数冲突,该冲突可以无视
  • mgui面板仅支持安卓9-安卓13,模块支持安卓8-安卓13

配置路径

  • 白名单路径:/sdcard/Android/Hc_memory/白名单.conf
  • 乖巧名单:/sdcard/Android/Hc_memory/乖巧名单.conf
  • imgui面板:/sdcard/Android/Hc_memory/执行启动面板.sh
  • 终端面板:/sdcard/Android/Hc_memory/无法使用面板的执行该备用面板.sh

根据作者介绍「A1内存管理」只删除无用进程并无太多优化,稍微调点参数保活后台而已,模块后台运行但并不耗电,建议配合墓碑食用。

下载地址

  • 网盘下载:
    https://www.123pan.com/s/c8zA-QtzN3
  • 作者视频介绍:
    https://www.bilibili.com/video/BV18e4y1279T/
  • 相关文章:拯救 8G RAM,A1 + 墓碑
    https://www.coolapk.com/feed/40999211
  • 原文地址:
    https://www.coolapk.com/feed/40394414?shareKey=N2MyMjM3YmJkNjYzNjM3NjAzMjU
 

 

 

 

 


 

 


No comments:

Post a Comment