• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
Search This thread

xda general

Senior Member
Jun 21, 2015
52
8
For everyone using RN9 merlin and Lancelot it works. I am on Lancelot with custom rom A11 OSS. You have to put the script in /data/local/tmp and go to recovery and run the script manually using the command: systemrw.sh size=20. Afterwards wipe data and format.

Then reboot back into recovery (don't boot rom) and flash your rom again. Once rom is flashed please go ahead and reboot to recovery again.

Once back in recovery please go to mount and select (SYSTEM ONLY!!) Then go to your terminal in your recovery and type: "mount -o remount,rw /system_root" once done flash magisk and your gapps and flash disable encryption last and reboot.
Screenshot_20210908-102731202 (1).jpg
Screenshot_20210908-102916853.jpg
 

xda general

Senior Member
Jun 21, 2015
52
8
Also if you run the script again without following the above steps you will lock all the partitions again. So thanks much dev!!!!!! Confirmed working on Redmi 9 Lancelot.
 
  • Like
Reactions: Ayoub$#

Pachacouti

Senior Member
Jul 8, 2020
157
14
52
The Capital above the Lower one...
I'm curious, have you considered dynamic partitioning?

Drives suddenly changing names and mount points etc?

I'm curious as to how to pin point a dynamic partition when it mounts a partition for each individual app...

Might explain your 'wtf' moment's lol ;)

I tested it, it works on my fone, till I reboot wondering if it's my recovey or magisk or system_1_32's system I'm actually working with, that's locked while it aint in recovery on a clean slate?
 

lebigmac

Senior Member
Jan 31, 2017
834
483
Still cant modify any files on vendor with latest update on my poco m3 global android 10 12.0.10
Update : Able to rw now on vendor partition if i change the size from 15 to 50 on the flashable zip on my Poco m3 android 10 global
Hi @samsungics1200.
Thanks for your additional feedback. I had absolutely no idea that running script again with larger size parameter would actually fix this /vendor still R/O issue. Go figure.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.

Congratulations! I am happy you found a solution to your problem and that script now works great on your Xiaomi Poco m3 global android 10.
Enjoy a R/W capable system!

regarless of how I flash this my system stays as read only (android 11 proton aosp pixel 2) when flashing through twrp it gives 255 error when running script manually it runs till partition detected (then fails to find shared block) for sys parts a and b and vendor a and b

(wont let attach log uploaded to drive link provided sorry late edit)

Hi @XS37. I'm sorry but your device don't have shared_blocks read-only feature so script don't have anything to do. Your device must have a different read-only protection mechanism. Good luck trying to figure it out! Please let us know if you find a solution to your device's read-only problem. Thanks!

Were my mesage?I kill thise forum!
In Log all OK.First boot RW, after reboot RO.
Hi @slaveci. It's sad that you lost your message.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
What you mean first boot RW then RO? Please show screenshots like this! Thanks!
1-jpg.5235933


Successfully got RW in OnePlus Nord with android 11 rom. Only one thing compulsory to work script is current slot b need to be active.
But system/reserve folder is RO.
How to make this folder also RW because this folder also has bloatware.
~ $ mount -o remount,rw /system/reserve
mount: '/dev/block/loop6' not user mountable in fstab
Hi again @Facebooook. Thanks for your log files. Your log looks perfect.
I can't believe script actually works on your OnePlus device 😲
Wait a second /system AKA / is R/W and /system/reserve is R/O ? That's just silly.
Please show root file manager screenshot! Thanks.

Hi guys, my device is on Android 9, I know this thread refers to Android 10, but I can't make system RW. I've tried it anyway. Could I follow this thread even though I'm on A9?
Hi @FredMontteiro. Thanks for your interest in this projecft. I'm afraid this script will not work properly in Android 9 :(
Did you check if your device has shared_blocks feature or is your read-only lock caused by another different protection feature? Good luck mounting your device as R/W! Please let us know if you find a solution to your device specific problem. Thanks!
Try this code to check shared_blocks feature:
Bash:
adb shell
su
tune2fs -l /dev/block/dm-0 | grep "features"

I hope this makes it easy for some, a laymans perspective...

You do NOT need twrp, unless you need twrp. If your fone has no twrp, use a magisk root to extract the files as shown using a term in your fone, this is what magisk does, gets you to tranfer magisk patched boot, so your doing the same only without a button, instead, your using commands. If you can get root without twrp, manual is the way.

Then again, you could tranfer the extracted files to an sd card and maybe try from there inserting sdcard in fone and adjusting dir's of course..

Think dos lol... aka python aka linux aka fone... extract to dir, run.

IN THE FONE!
Works on my ulefone Armor x5 mt6765/6762, android 10_Q with the 32 mb boot and recovery, not the android 9 version!!

UPDATE:

When I first tested it, all went well, then after a reboot, it was gone.

Even Magisk tried over and over to re-install itself..

I think these two clash on my fone, since magisk appears to create it's own overlay file system, which woul most likely conflict with the super image, dunno really, in the end system is still read only on mine, yet I got nethunter running, kl as..
I tested it, it works on my fone, till I reboot wondering if it's my recovey or magisk or system_1_32's system I'm actually working with, that's locked while it aint in recovery on a clean slate?
Hi @Pachacouti. Thanks for your interest in this project.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ Thanks (y)
It works or it not works on your device? Please show some screenshots too!
My script should work in custom recovery regardless of whether Magisk is installed or not as you get a root shell by default in custom recovery and that's usually all you need to remove shared_blocks read-only lock in Android 10/11

Apply AppSystemless module mentioned,
Can only find in Magisk Modules, a
App Systemised (Terminal Emulator) v17.3.1 by veez21.
Turns all apps to System Apps Systemlessly.

Is that the module to which you are referring to, or another only available on XDA. Cheers,
Hi @BeeJ1109. Thanks for your interest in this project. Please keep the discussion on topic. Thanks.
Did you run script yet? What was the result? Does it work on your device? Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ Thanks (y)
Please see my reply to @Pachacouti above.

working well on my note 9s curtana, thanks to everyone :)
format data
flash flashable rw
format data (did not start, it was necessary to format again. )
flash magisk
enjoying miui 12.5 eea without bloatware
Hi @LostFade. You're very welcome! I am happy my script works on your Redmi Note 9s curtana.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
Thanks for your feedback!

Why do you format /data twice?
You only need to decrypt and mount /data partition for script to work in custom recovery ;)
If you run script from within Android operating system then /data partition will be automatically decrypted and mounted by Android operating system.

Have the problem...

Preamble:
Xiaomi.eu weekly ROM 21.9.1 + script systemrw_1.32_flashable (script is applied successfully)


1. Installed the ROM 21.9.1, booted into the system. Camera OK.
2. Installed Magisk, booted into the system. Camera OK.
3. Executed in TWRP the script for make the system in RW (tried size=300 and size=500), booted into the system. The camera crashes.

Code:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Redmi/apollo/apollo:10/QKQ1.200419.002/V12.0.3.0.QJDCNXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2021-09-06 19:09:27+0300
pid: 7804, tid: 8038, name: ParallelDataZip  >>> com.android.camera <<<
uid: 10101
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'terminating with uncaught exception of type std::bad_cast: std::bad_cast'
    x0  0000000000000000  x1  0000000000001f66  x2  0000000000000006  x3  0000007304cb1a50
    x4  fefefefefefefeff  x5  fefefefefefefeff  x6  fefefefefefefeff  x7  7f7f7f7f7f7f7f7f
    x8  00000000000000f0  x9  007fa8ae7cb74770  x10 0000000000000000  x11 ffffffc0fffffbdf
    x12 0000000000000001  x13 0000000061363d37  x14 0006ea04ef634400  x15 00003e70b354ef08
    x16 0000007428057948  x17 0000007428036390  x18 00000000000000ac  x19 0000000000001e7c
    x20 0000000000001f66  x21 00000000ffffffff  x22 ffffff80ffffffc8  x23 0000007304cb1ca0
    x24 0000007304cb1b80  x25 0000007304cb1bc0  x26 00000072f41e3f50  x27 00000072ef2b16b0
    x28 00000072ef2b1530  x29 0000007304cb1ad0
    lr  0000007427fe9aa0  sp  0000007304cb1a30  pc  0000007427fe9acc  pst 0000000000001000

backtrace:
      #00 pc 0000000000089acc  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: a790cdbd8e44ea8a90802da343cb82ce)
      #01 pc 00000000000e19e0  /vendor/lib64/libHalSuperSensorServer.so (BuildId: 6c82ca93616ec62ee9238aaa59cd6dc9323031fc)
      #02 pc 00000000000e1b38  /vendor/lib64/libHalSuperSensorServer.so (BuildId: 6c82ca93616ec62ee9238aaa59cd6dc9323031fc)
      #03 pc 00000000000deb74  /vendor/lib64/libHalSuperSensorServer.so (BuildId: 6c82ca93616ec62ee9238aaa59cd6dc9323031fc)
      #04 pc 00000000000de278  /vendor/lib64/libHalSuperSensorServer.so (BuildId: 6c82ca93616ec62ee9238aaa59cd6dc9323031fc)
      #05 pc 00000000000de1f8  /vendor/lib64/libHalSuperSensorServer.so (__cxa_throw+120) (BuildId: 6c82ca93616ec62ee9238aaa59cd6dc9323031fc)
      #06 pc 0000000000083994  /vendor/lib64/libc++_shared.so (std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const+216) (BuildId: ef6e7301b33650c6ab99d63132badbf97c1a64a8)
      #07 pc 0000000000057304  /vendor/lib64/librelight_only.so (BuildId: 34ad81e23a86650cd65b89a49df7552e122eb661)
      #08 pc 0000000000130c48  /vendor/lib64/librelight_only.so (BuildId: 34ad81e23a86650cd65b89a49df7552e122eb661)
      #09 pc 0000000000131f04  /vendor/lib64/librelight_only.so (BuildId: 34ad81e23a86650cd65b89a49df7552e122eb661)
      #10 pc 0000000000027f2c  /vendor/lib64/librelight_only.so (BuildId: 34ad81e23a86650cd65b89a49df7552e122eb661)
      #11 pc 000000000004a1e4  /apex/com.android.runtime/bin/linker64 (__dl__ZL10call_arrayIPFviPPcS1_EEvPKcPT_mbS5_+284) (BuildId: 367fc1a689db1d4009e02060b806a9f7)
      #12 pc 000000000004a3e4  /apex/com.android.runtime/bin/linker64 (__dl__ZN6soinfo17call_constructorsEv+380) (BuildId: 367fc1a689db1d4009e02060b806a9f7)
      #13 pc 000000000004a2f0  /apex/com.android.runtime/bin/linker64 (__dl__ZN6soinfo17call_constructorsEv+136) (BuildId: 367fc1a689db1d4009e02060b806a9f7)
      #14 pc 0000000000035b28  /apex/com.android.runtime/bin/linker64 (__dl__Z9do_dlopenPKciPK17android_dlextinfoPKv+2308) (BuildId: 367fc1a689db1d4009e02060b806a9f7)
      #15 pc 00000000000310e8  /apex/com.android.runtime/bin/linker64 (__dl__ZL10dlopen_extPKciPK17android_dlextinfoPKv+80) (BuildId: 367fc1a689db1d4009e02060b806a9f7)
      #16 pc 0000000000001020  /apex/com.android.runtime/lib64/bionic/libdl.so (dlopen+12) (BuildId: 0ef8b9fd3ba84892809321b735317a50)
      #17 pc 0000000000006054  /vendor/lib64/libcom.xiaomi.pluginutils.so (mialgo2::DLibrary::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+64) (BuildId: 939eb646d43ec42e62066ecdd9ab06db)
      #18 pc 000000000000654c  /vendor/lib64/libcom.xiaomi.pluginutils.so (mialgo2::PluginManager::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)+88) (BuildId: 939eb646d43ec42e62066ecdd9ab06db)
      #19 pc 0000000000006fc8  /vendor/lib64/libcom.xiaomi.pluginutils.so (mialgo2::PluginManager::loadFromFolder(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool)+372) (BuildId: 939eb646d43ec42e62066ecdd9ab06db)
      #20 pc 00000000000268cc  /vendor/lib64/libmialgoengine2.so (mialgo2::MPluginModule::MPluginModule()+276) (BuildId: 0f1eae3e3e3dcb9513c0fae9d76aba2b)
      #21 pc 0000000000026490  /vendor/lib64/libmialgoengine2.so (mialgo2::MPluginModule::GetInstance()+72) (BuildId: 0f1eae3e3e3dcb9513c0fae9d76aba2b)
      #22 pc 000000000000ffd8  /vendor/lib64/libmialgoengine2.so (mialgo2::MiaNode::Init(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, mialgo2::PostProcCreateParams*, bool)+64) (BuildId: 0f1eae3e3e3dcb9513c0fae9d76aba2b)
      #23 pc 0000000000021820  /vendor/lib64/libmialgoengine2.so (mialgo2::MiaOfflinePostProcSession::buildGraph(mialgo2::PostProcCreateParams*)+1568) (BuildId: 0f1eae3e3e3dcb9513c0fae9d76aba2b)
      #24 pc 000000000001e534  /vendor/lib64/libmialgoengine2.so (mialgo2::MiaOfflinePostProcSession::InitializeSessionParams(mialgo2::PostProcCreateParams*)+80) (BuildId: 0f1eae3e3e3dcb9513c0fae9d76aba2b)
      #25 pc 000000000001df80  /vendor/lib64/libmialgoengine2.so (mialgo2::MiaOfflinePostProcSession::Create(mialgo2::PostProcCreateParams*)+40) (BuildId: 0f1eae3e3e3dcb9513c0fae9d76aba2b)
      #26 pc 0000000000017754  /vendor/lib64/libmialgoengine2.so (CameraPostProc_Create+140) (BuildId: 0f1eae3e3e3dcb9513c0fae9d76aba2b)
      #27 pc 00000000000114f4  /vendor/lib64/libmialgoengine.so (mialgo::MiPostProcSessionIntf::Initialize(mialgo::GraphDescriptor*, mialgo::SessionOutput*, mialgo::MiaSessionCb*)+652) (BuildId: 7eb38365f2ac27c3553be0c294255746)
      #28 pc 000000000000fd2c  /vendor/lib64/libmialgoengine.so (mialgo::MiPostProcServiceIntf::createSession(mialgo::GraphDescriptor*, mialgo::SessionOutput*, mialgo::MiaSessionCb*)+200) (BuildId: 7eb38365f2ac27c3553be0c294255746)
      #29 pc 000000000000a3b8  /vendor/lib64/libmialgoengine.so (MIACreateSession+184) (BuildId: 7eb38365f2ac27c3553be0c294255746)
      #30 pc 00000000000084d4  /system/lib64/libcamera_algoup_jni.xiaomi.so (Java_com_xiaomi_engine_MiCamAlgoInterfaceJNI_createSessionByOutputConfigurations+1188) (BuildId: 8c0a12a9e10987b5d98554d32819a0da)
      #31 pc 000000000013ded4  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 0148748321a155a1f417258148786a03)
      #32 pc 00000000001347e8  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 0148748321a155a1f417258148786a03)
      #33 pc 00000000001a9a94  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+228) (BuildId: 0148748321a155a1f417258148786a03)
      #34 pc 000000000031b10c  /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+376) (BuildId: 0148748321a155a1f417258148786a03)
      #35 pc 0000000000311438  /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+996) (BuildId: 0148748321a155a1f417258148786a03)
      #36 pc 00000000006825f4  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+548) (BuildId: 0148748321a155a1f417258148786a03)
      #37 pc 000000000012e994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0148748321a155a1f417258148786a03)
      #38 pc 0000000000ce4116  /data/dalvik-cache/arm64/[email protected]@[email protected]@classes.vdex (com.xiaomi.engine.MiCameraAlgo.createSessionByOutputConfigurations+14)
      #39 pc 0000000000682898  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: 0148748321a155a1f417258148786a03)
      #40 pc 000000000012e994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0148748321a155a1f417258148786a03)
      #41 pc 0000000000cbfbb4  /data/dalvik-cache/arm64/[email protected]@[email protected]@classes.vdex (com.xiaomi.camera.core.PostProcessor.configCaptureSession+304)
      #42 pc 000000000067f93c  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: 0148748321a155a1f417258148786a03)
      #43 pc 000000000012e814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 0148748321a155a1f417258148786a03)
      #44 pc 000000000054c5f8  /data/dalvik-cache/arm64/[email protected]@[email protected]@classes.vdex (com.android.camera.LocalParallelService$LocalBinder.configCaptureSession+116)
      #45 pc 000000000067f93c  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: 0148748321a155a1f417258148786a03)
      #46 pc 000000000012e814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 0148748321a155a1f417258148786a03)
      #47 pc 00000000006cb690  /data/dalvik-cache/arm64/[email protected]@[email protected]@classes.vdex (com.android.camera.module.Camera2Module.configParallelSession+912)
      #48 pc 0000000000681fb8  /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1248) (BuildId: 0148748321a155a1f417258148786a03)
      #49 pc 000000000012e914  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 0148748321a155a1f417258148786a03)
      #50 pc 00000000006cde2a  /data/dalvik-cache/arm64/[email protected]@[email protected]@classes.vdex (com.android.camera.module.Camera2Module.initParallelSession+14)
      #51 pc 0000000000681fb8  /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+1248) (BuildId: 0148748321a155a1f417258148786a03)
      #52 pc 000000000012e914  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_direct+20) (BuildId: 0148748321a155a1f417258148786a03)
      #53 pc 00000000006ca8a8  /data/dalvik-cache/arm64/[email protected]@[email protected]@classes.vdex (com.android.camera.module.Camera2Module.access$4900)
      #54 pc 0000000000682898  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: 0148748321a155a1f417258148786a03)
      #55 pc 000000000012e994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0148748321a155a1f417258148786a03)
      #56 pc 00000000006c7390  /data/dalvik-cache/arm64/[email protected]@[email protected]@classes.vdex (com.android.camera.module.Camera2Module$12.run+4)
      #57 pc 0000000000681374  /apex/com.android.art/lib64/libart.so (MterpInvokeInterface+1808) (BuildId: 0148748321a155a1f417258148786a03)
      #58 pc 000000000012ea14  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_interface+20) (BuildId: 0148748321a155a1f417258148786a03)
      #59 pc 000000000062c884  [anon:dalvik-classes2.dex extracted in memory from /system/framework/framework.jar!classes2.dex] (android.os.Handler.handleCallback+4)
      #60 pc 0000000000682898  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: 0148748321a155a1f417258148786a03)
      #61 pc 000000000012e994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0148748321a155a1f417258148786a03)
      #62 pc 000000000062c8c8  [anon:dalvik-classes2.dex extracted in memory from /system/framework/framework.jar!classes2.dex] (android.os.Handler.dispatchMessage+8)
      #63 pc 000000000067f93c  /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual+1520) (BuildId: 0148748321a155a1f417258148786a03)
      #64 pc 000000000012e814  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 0148748321a155a1f417258148786a03)
      #65 pc 000000000065649c  [anon:dalvik-classes2.dex extracted in memory from /system/framework/framework.jar!classes2.dex] (android.os.Looper.loop+500)
      #66 pc 0000000000682898  /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+1224) (BuildId: 0148748321a155a1f417258148786a03)
      #67 pc 000000000012e994  /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0148748321a155a1f417258148786a03)
      #68 pc 000000000062d3a0  [anon:dalvik-classes2.dex extracted in memory from /system/framework/framework.jar!classes2.dex] (android.os.HandlerThread.run+56)
      #69 pc 0000000000308a34  /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.10797705155203627836)+268) (BuildId: 0148748321a155a1f417258148786a03)
      #70 pc 000000000066e3a4  /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+780) (BuildId: 0148748321a155a1f417258148786a03)
      #71 pc 000000000013dff8  /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 0148748321a155a1f417258148786a03)
      #72 pc 0000000000134564  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 0148748321a155a1f417258148786a03)
      #73 pc 00000000001a9a78  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200) (BuildId: 0148748321a155a1f417258148786a03)
      #74 pc 0000000000557b68  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+460) (BuildId: 0148748321a155a1f417258148786a03)
      #75 pc 00000000005a71a8  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1308) (BuildId: 0148748321a155a1f417258148786a03)
      #76 pc 00000000000eb868  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: a790cdbd8e44ea8a90802da343cb82ce)
      #77 pc 000000000008ba88  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: a790cdbd8e44ea8a90802da343cb82ce)

Any idea why this is happening? It seems that the file system is broken after the script.

Hi @mclaude74. Thanks for your interest in this project.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
Script works? Can you remount partitions as R/W now?

Did you try different camera app yet? I don't think this error is caused by script.
You run script on a fresh stock firmware right?
If Xiaomi.eu is custom ROM why it cannot mount as R/W by default? Custom firmware should be able to do that by default!

According to your log your system is already RW capable. Download a root file manager and set it to RW from within the file manager you choose.
Hi @NinjaPerv. Thanks for your interest in this project. That's a good suggestion!
Does the script work on your device? Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.

Code:
Filesystem features:      ext_attr resize_inode dir_index filetype extent sparse_super large_file huge_file uninit_bg dir_nlink extra_isize shared_blocks
i appreciate your help!! :)

Hi again @The_Tablet. Did you check yet using df -ha command if you've got enough free space to dump the partitions in /data partition?
Did you try running the script from custom recovery yet?

For everyone using RN9 merlin and Lancelot it works. I am on Lancelot with custom rom A11 OSS. You have to put the script in /data/local/tmp and go to recovery and run the script manually using the command: systemrw.sh size=20. Afterwards wipe data and format.

Then reboot back into recovery (don't boot rom) and flash your rom again. Once rom is flashed please go ahead and reboot to recovery again.

Once back in recovery please go to mount and select (SYSTEM ONLY!!) Then go to your terminal in your recovery and type: "mount -o remount,rw /system_root" once done flash magisk and your gapps and flash disable encryption last and reboot. View attachment 5404989View attachment 5404991
Hi @xda general.
Thanks for your feedback and your nice screenshots. I'm happy you got the script to work on your Redmi Note 9 merlin and/or Redmi 9 Prime lancelot device.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.

Formatting /data partition after running script is not necessary.
Usually if you are unable to properly decrypt/mount /data partition in custom recovery, then you might have to format /data partition once BEFORE running script for script to function properly.

Flashing ROM again afterwards is NOT necessary. You only need to flash super_fixed.bin if you're running script manually...

Yes remounting your partitions as R/W after running script is a good idea.

Yes you can flash magisk before or after running my script and it should work. You might have to reboot to recovery once in between the two procedures.

I've never tried to flash encryption disabler but it sounds like a good idea! Thanks. I'll give it a try one day.

Also if you run the script again without following the above steps you will lock all the partitions again. So thanks much dev!!!!!! Confirmed working on Redmi 9 Lancelot.
You're welcome. Why would it relock all the partitions again?
It's not like shared_blocks read-only feature will be restored if your steps are not followed ;)

well done. Is working Xiaomi Remi Note 9T 5G (cannong),But still impossible on Redmi note 9 (Merlin) despite my many attempts
Hi @jc-b. I'm happy that script is working on your Xiaomi Redmi Note 9T 5G (cannong) device.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/
of your Redmi Note 9T 5G device. Thanks (y).

I'm sad that you didn't get it to work yet on your Redmi Note 9 (Merlin) device.
You didn't send me screenshot yet:
Hi. According to your log your device don't have shared_blocks read-only feature. Not sure why you cannot mount your partitions as r/w.
Try this command and send me screenshot. Thanks.
1-jpg.5235933
Did you try remount partitions as r/w yet? What was the result?

here my log files
if I try to rewrite the partitions my result id " dev/block/dm-1' is read only"

Are you running custom ROM or stock MIUI? Please keep in mind this script was designed for stock MIUI.
I checked again your Redmi Note 9 merlin log and your device don't have shared_blocks read-only feature. According to your log it looks like script already did its job. If you still get read-only error when remounting partition as R/W that means your firmware must have a different read-only protection mechanism that's stopping you from going fully R/W. Try again with stock MIUI. Good luck!

tab s6 lite samsung

SM-P610

gta4xlwifi
Hi @ARIES4RR script works on your Samsung device? That would be wonderful news!
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
 
Last edited:

XS37

Senior Member
Jan 26, 2015
93
15
Bell island nfld
Hi @samsungics1200.
Thanks for your additional feedback. I had absolutely no idea that running script again with larger size parameter would actually fix this /vendor still R/O issue. Go figure.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.

Congratulations! I am happy you found a solution to your problem and that script now works great on your Xiaomi Poco m3 global android 10.
Enjoy a R/W capable system!


Hi @XS37. I'm sorry but your device don't have shared_blocks read-only feature so script don't have anything to do. Your device must have a different read-only protection mechanism. Good luck trying to figure it out! Please let us know if you find a solution to your device's read-only problem. Thanks!


Hi @slaveci. It's sad that you lost your message.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
What you mean first boot RW then RO? Please show screenshots like this! Thanks!
1-jpg.5235933




Hi again @Facebooook. Thanks for your log files. Your log looks perfect.
I can't believe script actually works on your OnePlus device 😲
Wait a second /system AKA / is R/W and /system/reserve is R/O ? That's just silly.
Please show root file manager screenshot! Thanks.


Hi @Pachacouti. Thanks for your interest in this project. Did script work on your device? Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.


Hi @FredMontteiro. Thanks for your interest in this projecft. I'm afraid this script will not work properly in Android 9 :(
Did you check if your device has shared_blocks feature or is your read-only lock caused by another different protection feature? Good luck mounting your device as R/W!

Bash:
adb shell
su
tune2fs -l /dev/block/dm-0



Hi @Pachacouti. Thanks for your interest in this projecft.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
It works or it not works on your device? Please show some screenshots too!
Yes you are right Magisk creates a systemless mirrored setup.
My script should work in custom recovery regardless of whether Magisk is installed or not as you get a root shell by default in custom recovery and that's usually all you need to remove shared_blocks read-only lock in Android 10/11


Hi @BeeJ1109. Thanks for your interest in this project. Please keep the discussion on topic. Thanks.
Please see last sentence in my reply to @Pachacouti above.


Hi @LostFade. You're very welcome! I am happy my script works on your Redmi Note 9s curtana.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
Thanks for your feedback!

Why do you format /data twice?
You only need to decrypt and mount /data partition for script to work in custom recovery ;)
If you run script from within Android operating system then /data partition will be automatically decrypted and mounted by Android operating system.



Hi @mclaude74. Thanks for your interest in this project.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
Script works? Can you remount partitions as R/W now?

Did you try different camera app yet? I don't think this error is caused by script.
You run script on a fresh stock firmware right?
If Xiaomi.eu is custom ROM why it cannot mount as R/W by default? Custom firmware should be able to do that by default!


Hi @NinjaPerv. Thanks for your interest in this project. That's a good suggestion!
Does the script work on your device? Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.



Hi again @The_Tablet. Did you check yet using df -ha command if you've got enough free space to dump the partitions in /data partition?
Did you try running the script from custom recovery yet?


Hi @xda general.
Thanks for your feedback and your nice screenshots. I'm happy you got the script to work on your Redmi Note 9 merlin and/or Redmi 9 Prime lancelot device.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.

Formatting /data partition after running script is not necessary.
Usually if you are unable to properly decrypt/mount /data partition in custom recovery, then you might have to format /data partition once BEFORE running script for script to function properly.

Flashing ROM again afterwards is NOT necessary. You only need to flash super_fixed.bin if you're running script manually...

Yes remounting your partitions as R/W after running script is a good idea.

Yes you can flash magisk before or after running my script and it should work. You might have to reboot to recovery once in between the two procedures.

I've never tried to flash encryption disabler but it sounds like a good idea! Thanks. I'll give it a try one day.


You're welcome. Why would it relock all the partitions again?
It's not like shared_blocks read-only feature will be restored if your steps are not followed ;)


Hi @jc-b. I'm happy that script is working on your Xiaomi Redmi Note 9T 5G (cannong) device.
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/
of your Redmi Note 9T 5G device. Thanks (y).

I'm sad that you didn't get it to work yet on your Redmi Note 9 (Merlin) device.
You didn't send me screenshot yet:



Are you running custom ROM or stock MIUI? Please keep in mind this script was designed for stock MIUI.
Why xda general above got it to work on same Redmi Note 9 (Merlin) device?
It must be your firmware. Try again with stock MIUI. Good luck!


Hi @ARIES4RR script works on your Samsung device? That would be wonderful news!
Please send me your log files from this folder /data/local/tmp/systemrw_1.32/log/ (y) Thanks.
Thank you for trying I figured it out with a lot of trial and error but I didn't end up needing the script I ended up reformating partitions thru twrp and changing certain format types then changing back I'm unsure on what the issue was however changing the partitions format then changing it back seems to have fixed my read only I can now flip between the 2 when I need
 
  • Love
Reactions: lebigmac

Pachacouti

Senior Member
Jul 8, 2020
157
14
52
The Capital above the Lower one...
Dude, I figured out your problem, and in return for your answer, I'll ask in return if you got an

A only BOOTLOADER with buildvariant=eng at the beginning when opened in hex? (Mt6762)

Your problem has been answered.

variant=user, vmeta prevents system changes, and cant mount and keep changes :(

Bet your using user build bootloader?

(as is everyone else with problems with your script. I reckon your script works, but not on user build bootloaders :)

Magisk dont convert user to eng :) <ther u go john wu hint hint

I read your quote, I dont do logs, but In testing with and without, a rooted bootloader, your script works, but user built booloaders wont mount system_root wether vmeta blanked was flashed or not, yes they can be mounted in twrp, but only with a rooted bootloader (duh), but if that bootloader is a user build, NO GO.

I foresee a new bootloader section in the developers section brewing after reading this...

If we posted our magisk'd boots, (instead of recoveries...) we'd soon see...
 
Last edited:

Pachacouti

Senior Member
Jul 8, 2020
157
14
52
The Capital above the Lower one...
Ps, when I origionally ran this, your script stored super_fixed.bin, and I could pull this using adb, now you delete it, I understand others are limited on space, but could you offer an option to save this to adb or keep it long enough to actually adb pull it manually? It's just that while testing, it's a pain to keep running this script after some test wipes it all... when we could simply re-flash the super_fixed which works even after a bad flash... quicker that re-kr8ing the super every bad flash?

Thanks
 

lebigmac

Senior Member
Jan 31, 2017
834
483
Dude, I figured out your problem, and in return for your answer, I'll ask in return if you got an

A only BOOTLOADER with buildvariant=eng at the beginning when opened in hex? (Mt6762)

Your problem has been answered.

variant=user, vmeta prevents system changes, and cant mount and keep changes :(

Bet your using user build bootloader?

(as is everyone else with problems with your script. I reckon your script works, but not on user build bootloaders :)

Magisk dont convert user to eng :) <ther u go john wu hint hint

I read your quote, I dont do logs, but In testing with and without, a rooted bootloader, your script works, but user built booloaders wont mount system_root wether vmeta blanked was flashed or not, yes they can be mounted in twrp, but only with a rooted bootloader (duh), but if that bootloader is a user build, NO GO.

I foresee a new bootloader section in the developers section brewing after reading this...

If we posted our magisk'd boots, (instead of recoveries...) we'd soon see...
Hi @Pachacouti. Thanks for your message.
Please see my device screenshot below for an answer to your question. I have no boot slots which is same thing as _a only boot slot I believe. And script works perfectly on my Xiaomi Poco X3

Engineer builds like custom recovery are root by default!

but user built booloaders wont mount system_root wether vmeta blanked was flashed or not
Why would you want to mount /system_root inside Android? You usually only do this inside custom recovery.
In Android operating system the root path it's not called /system_root but only this symbol /

I foresee a new bootloader section in the developers section brewing after reading this...
Yes that's a great idea. Are you a developer? If yes then contact me! I am always happy to receive messages from fellow developers!

If we posted our magisk'd boots, (instead of recoveries...) we'd soon see...
Yeah I saw you were posting some files in your thread. What the hell is it? Is it just your stock boot.img file with Magisk flashed to it?

Ps, when I origionally ran this, your script stored super_fixed.bin, and I could pull this using adb, now you delete it, I understand others are limited on space, but could you offer an option to save this to adb or keep it long enough to actually adb pull it manually? It's just that while testing, it's a pain to keep running this script after some test wipes it all... when we could simply re-flash the super_fixed which works even after a bad flash... quicker that re-kr8ing the super every bad flash?

Thanks
Open script with text editor and
@ line #198 simply add # symbol in front
From this:
rm -f "$sDumpDir/super_fixed.bin"
Change to this:
#rm -f "$sDumpDir/super_fixed.bin"
Now save file
This way when you run script super_fixed.bin will not be deleted in the end.

When you manually flash super_fixed.bin phone actually boots? I'd call that a success :ROFLMAO:
Where is your log files? Without your log files it's very difficult to give technical support. Thanks.

screenshot_for_pachacouti.jpg
 
Last edited:

lebigmac

Senior Member
Jan 31, 2017
834
483
Hey guys how are we doing. Just a quick question, does this mod works on A12?
Hi b4minee. I don't know. Did you try it yet? Please let us know your results. You would be the first person in the world to try my script in Android 12! I am very curious for the results. Thanks (y)
Does your Android 12 device still have shared_blocks read-only feature? You can check it like this:

Bash:
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $a | grep "features"; done
 
  • Like
Reactions: b4minee

gravityz3r0

Senior Member
Jun 29, 2010
160
20
Hmm, tried installing it on my xiaomi 10 ultra Android 11. The auto twrp method returned error 255. Manually install and running the .sh script returned error Android version is not supported yet. Is 11 supported yet actually?
Screenshot_2021-09-15-05-28-50.png
 
Last edited:
  • Wow
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
834
483
Hmm, tried installing it on my xiaomi 10 ultra Android 11. The auto twrp method returned error 255. Manually install and running the .sh script returned error Android version is not supported yet. Is 11 supported yet actually?View attachment 5409755
Hi that looks weird. Something wrong with your shell interpreter in recovery. Try running script manually while device is booted into Android. And then please send me your log files. Good luck!
 

Pachacouti

Senior Member
Jul 8, 2020
157
14
52
The Capital above the Lower one...
Its best if I dont quote 2 much so to answer as much as I can in a one-er...

I tested this and it works. To a point.

I tested it extensively...

In a nutshell, clean slate, adb pushed your zip, though unzipped, to /storage/emulated/0/Download

Followed your commands, all went well. The first time I did it, I managed to and pull (but lost) a copy of the super_fixed from the img folder in your root dir, to store for further tests, put that aside, and continued the test's.. so I reboot from ORIGIONAL recovery, see, I Didn't have a twrp at this point, I made my own magisk'd bootloader, so have magisk but cant su offline, so flash the apk, got su, and dm-1, 2, or 3 read only.

I then get a working twrp from lopstom, and suss whats wrong, for I see the mounting of system_root. I never wanted to mount this till I see you mention it, so I test it, and yes... I can enable it, but no writes... yet.. Once twrp was flashed to recovery, I could see system_root in red. this is because after the super flashing reboot, I then flashed stock bootloader and reflash twrp, booting back into recovery, test it, no su in the twrp tho, (soon sort that) so reboot to reflash my bootloader offering the magisk greyed out on desktop once rebooted, but before going into gui, I go back into twrp and nothing is writable, dm-1, 2, 3, which I learn is system/vendor etc... but I can mount them in twrp. What now? reboot into gui and flash magisk apk, reboot back into twrp, voila, your script works... but not in gui when rebooted (my aim)

And writes are not saved. I put this down to we can fool the root and system, but not the basic point of user builds. If they cant flash a magisk bootloader in gui, your script will act same.

I'm not really a developer, but I guess I'm good at finding things, and creating new things, by giving others ideas that lead to the scripits I need, I'm too out of touch nowadays, man, my first pc was a zx81....

Edit: I forgot, once you've made your super_fixed bin, you can reflash this super after, say a bad flash, without need for the script, just use the vbmeta before you flash it... just a positive note for ya :)

Ps, remember my notes, a usr build will fail to mount your partitions once booted into fone, hence folks think it dont work. It does in twrp, if you have a rooted bootloader, but user builds freeze system changes if vbmeta is false, like we use... this is why magisk fails to flash in the gui... variant=user

All pie are using variant=eng, but they are for PIE, Pie works, but I'm on android 10 a only arm64-v8a... so no go, but can get you to flashing magisk manually from a twrp recovery.
 
Last edited:

b4minee

Member
Nov 25, 2018
18
4
Hi b4minee. I don't know. Did you try it yet? Please let us know your results. You would be the first person in the world to try my script in Android 12! I am very curious for the results. Thanks (y)
Does your Android 12 device still have shared_blocks read-only feature? You can check it like this:

Bash:
adb shell
su
for a in /dev/block/dm-*; do tune2fs -l $a | grep "features"; done
Sure bro let me find out.
 

FredMontteiro

Senior Member
Dec 18, 2015
82
16
Hi @Lebigmac

I always mounted this exact same device (on the same Android 9) as RW. Suddenly changes made to /System/priv-app revert to original after reboot. I used to mount RW with any root file manager app. It's a mystery.

I got it in a way that I don't like, but I'll share the solution:

I flashed twrp and through the twrp file manager I did what I wanted, which was to install a third-party app in Priv-app.
As I don't want a custom recovery, I flashed boot.img in slots A and B to remove the twrp, of course I lost root access too, and the app I installed in Priv-app disappeared, but then I just reinstalled magisk in the form "without twrp" and everything came back including the app in Priv-app. And of course without twrp which is what I wanted.

I have attached the result of Termux to the code you gave me. Thanks!

Edit:
A method like the "app systemizer" magisk module is not useful for me, as I want my app to resist a factory reset.
 

Attachments

  • Screenshot_20210915-015317~2.png
    Screenshot_20210915-015317~2.png
    22 KB · Views: 10
Last edited:
  • Like
Reactions: lebigmac

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Works on a Motorola Moto G30 with super. However, since there is no TWRP for this device and the stock recovery is brain-dead, you have to use the sysrw_repair.sh method and flash with fastboot.
    Code:
    systemrw: Initiating procedure...
    
    systemrw: Device is in Android mode. Ignoring
    systemrw: Current device: motorola
    systemrw: Current Android version: 11
    systemrw: Current SELinux status: Permissive
    systemrw: Current slot is: 0
    systemrw: Your super partition is located at: /dev/block/mmcblk0p75
    systemrw: / is read-only
    systemrw: /product is read-only
    systemrw: /vendor is read-only
    systemrw: Adjusting permissions...
    systemrw: Attempting to disable dm-verity and verification...
    verification is already disabled on slot with suffix _a.
    verity is already disabled on slot with suffix _a.
    systemrw: Dumping super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
    systemrw: Please wait patiently...
    
    21102592+0 records in
    21102592+0 records out
    10804527104 bytes (10 G) copied, 160.101076 s, 64 M/s
    
    systemrw: Successfully dumped super partition to: /data/local/tmp/systemrw_1.32/img/super_original.bin
    systemrw: Unpacking embedded partitions from /data/local/tmp/systemrw_1.32/img/super_original.bin
    systemrw: Nested partitions were successfully extracted from super
    
    systemrw: Current size of system_a.img in bytes: 857608192
    systemrw: Current size of system_a.img in MB: 817
    systemrw: Current size of system_a.img in 512-byte sectors: 1675016
    
    systemrw: 'shared_blocks feature' detected @ system_a.img
    
    systemrw: Increasing filesystem size of system_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img to 261721 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img is now 261721 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_a.img...
    systemrw: Read-only lock of system_a.img successfully removed
    
    systemrw: Shrinking size of system_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img to 227660 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_a.img is now 227660 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_b.img in bytes: 30310400
    systemrw: Current size of system_b.img in MB: 28
    systemrw: Current size of system_b.img in 512-byte sectors: 59200
    
    systemrw: 'shared_blocks feature' detected @ system_b.img
    
    systemrw: Increasing filesystem size of system_b.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 9250 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 9250 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_b.img...
    systemrw: Read-only lock of system_b.img successfully removed
    
    systemrw: Shrinking size of system_b.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img to 7259 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_b.img is now 7259 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_ext_a.img in bytes: 649871360
    systemrw: Current size of system_ext_a.img in MB: 619
    systemrw: Current size of system_ext_a.img in 512-byte sectors: 1269280
    
    systemrw: 'shared_blocks feature' detected @ system_ext_a.img
    
    systemrw: Increasing filesystem size of system_ext_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img to 198325 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img is now 198325 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of system_ext_a.img...
    systemrw: Read-only lock of system_ext_a.img successfully removed
    
    systemrw: Shrinking size of system_ext_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img to 160226 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/system_ext_a.img is now 160226 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of system_ext_b.img in bytes: 0
    systemrw: Current size of system_ext_b.img in MB: 0
    systemrw: Current size of system_ext_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Current size of vendor_a.img in bytes: 776093696
    systemrw: Current size of vendor_a.img in MB: 740
    systemrw: Current size of vendor_a.img in 512-byte sectors: 1515808
    
    systemrw: 'shared_blocks feature' detected @ vendor_a.img
    
    systemrw: Increasing filesystem size of vendor_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img to 236845 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img is now 236845 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of vendor_a.img...
    systemrw: Read-only lock of vendor_a.img successfully removed
    
    systemrw: Shrinking size of vendor_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img to 194394 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/vendor_a.img is now 194394 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of vendor_b.img in bytes: 0
    systemrw: Current size of vendor_b.img in MB: 0
    systemrw: Current size of vendor_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Current size of product_a.img in bytes: 2554847232
    systemrw: Current size of product_a.img in MB: 2436
    systemrw: Current size of product_a.img in 512-byte sectors: 4989936
    
    systemrw: 'shared_blocks feature' detected @ product_a.img
    
    systemrw: Increasing filesystem size of product_a.img...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img to 779677 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img is now 779677 (4k) blocks long.
    
    systemrw: Removing 'shared_blocks feature' of product_a.img...
    systemrw: Read-only lock of product_a.img successfully removed
    
    systemrw: Shrinking size of product_a.img back to minimum size...
    Resizing the filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img to 633770 (4k) blocks.
    The filesystem on /data/local/tmp/systemrw_1.32/img/product_a.img is now 633770 (4k) blocks long.
    
    =================================================
    
    systemrw: Current size of product_b.img in bytes: 0
    systemrw: Current size of product_b.img in MB: 0
    systemrw: Current size of product_b.img in 512-byte sectors: 0
    
    =================================================
    
    systemrw: Joining all extracted images back into one single super image...
    systemrw: Please wait and ignore the invalid sparse warnings...
    
    
    systemrw: Error! failed to create super_fixed.img file. Error code: 73
    There's kernel source for this device but very little else.
    2
    For everyone using RN9 merlin and Lancelot it works. I am on Lancelot with custom rom A11 OSS. You have to put the script in /data/local/tmp and go to recovery and run the script manually using the command: systemrw.sh size=20. Afterwards wipe data and format.

    Then reboot back into recovery (don't boot rom) and flash your rom again. Once rom is flashed please go ahead and reboot to recovery again.

    Once back in recovery please go to mount and select (SYSTEM ONLY!!) Then go to your terminal in your recovery and type: "mount -o remount,rw /system_root" once done flash magisk and your gapps and flash disable encryption last and reboot.
    Screenshot_20210908-102731202 (1).jpg
    Screenshot_20210908-102916853.jpg
    2
    I really would like to try the script with Redmi Note 9 (miui 12.0.4.0) but the yandex link doesn't work.
    Could you please use some universal file hosting with less limitations, like gdrive, mega, ...

    why using yandex. I don't want create a account for downloading

    New download mirror available on front page ;)
    More official download mirrors coming soon!
    2
    why using yandex. I don't want create a account for downloading
    1
    it worked on my one fusion device with dynamic partition. you are a genius bro
  • 95
    If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni


    logo_large.jpg

    *NEW* SystemRW v1.32 *NEW*
    automated bash script by lebigmac for Android 10 and above

    Creation date: February 2021
    Updated: August 2021

    Requirements:
    • rooted STOCK Android 10 or newer (custom ROM should already be R/W!)
    • at least 20 GB free space on phone for dumping data
    Description:
    A script for all Android power users that wish to make their read-only Android 10+ system read-write-able again to remove bloatware and make more thorough customizations to their device.

    In a nutshell this is what the script is doing:
    • dumps your existing super OR your system / product / vendor partitions depending on whether or not you have super partition
    • extracts embedded read-only partitions (system, vendor, product...) from super if applicable
    • makes these partitions read-write-able
    • joins everything back together to new super.img OR NOT depending on whether or not you have super partition
    • flashes read-write-able images back to device using the super fast Kolibass technique (only in recovery mode)
    User data is not affected.

    Manual installation:
    extract flashable.zip and copy systemrw_*VERSION* folder into /data/local/tmp/
    run this command to make the script executable:
    chmod +x /data/local/tmp/systemrw_*VERSION*/systemrw.sh
    Automatic installation:
    Installation of the script has never been this easy!
    Download the flashable zip below, do NOT enable zip signature verification and simply install it in your custom recovery (works in TWRP, OrangeFox and PBRP!)
    The installer binary will auto-detect whether or not your device has a super partition and launch the script accordingly with the proper command line arguments.
    Before launching script make sure you've got full read/write access to the /data partition and that /data partition is not encrypted!

    Flashable zip custom usage:
    You can set these custom installation arguments in the included config.ini file.
    Simply extract the flashable.zip and modify the included config.ini file and then save the file. Then compress the systemrw_*VERSION* and META-INF folders again as a new .zip and install it in recovery.
    First line of config.ini contains the script arguments for those WITHOUT super partition.
    By default this line is completely empty (no space).
    Second line of config.ini contains the script arguments for those WITH super partition.
    For example if you already dumped your super_original.bin and want to skip that process next time you install the .zip then put this in line #2 of config.ini :
    in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=15
    Remember if you decide to use custom arguments in config.ini then the first character should always be an empty space. If no arguments are used such as by default in line #1 (no super) then the line should be completely empty, no space, nothing.

    Script usage:
    If you've got no super partition then simply call the script with no arguments from the shell (see examples below).
    If you've got a super partition I would recommend using the optional size=15 parameter as well to give some extra free space (in MB) to each partition.
    The script can be run both inside custom recovery and inside Android operating system. If you run it in Android you will need to fastboot flash the patched image(s) manually!
    Optional arguments: (replace x with your custom value)
    • in=x : *THIS IS IGNORED IF YOU HAVE NO SUPER PARTITION*
      With this flag you can specify an existing super image as input and skip the entire dumping of the super image process. Here you can use the super_original.bin which you dumped earlier with systemrw or the official unsparsed super.img from your downloaded firmware. (unsparse with simg2img). It's also possible to use your super partition block device as input.
      If omitted, systemrw will dump super image from phone to ./img/super_original.bin
      (path is relative to the script)
    • out=x : *THIS IS IGNORED IF YOU HAVE NO SUPER PARTITION*
      With this argument you can specify the output path of the new patched super file.
      If omitted, default output value is ./img/super_fixed.bin
    • size=x : *ONLY RECOMMENDED IF YOU HAVE SUPER PARTITION*
      With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
      If omitted, default extra size is 0 (shrink to minimum)
    Examples:
    Code:
    # Run this command *IF YOU HAVE NO SUPER PARTITION*
    ./systemrw.sh
    
    # Run this command if you're first time user *AND YOU HAVE SUPER PARTITION*
    # Specify the extra free space in megabytes for each partition:
    ./systemrw.sh size=15
    
    # Plug an existing super image into the script like this *ONLY IF YOU HAVE SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin size=15
    
    # Specify both the input file as well as the output destination *ONLY IF YOU HAVE SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15
    
    # EXPERT EXAMPLE:
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` out=./img/super_fixed.bin size=50

    To check whether or not you've got a super partition on your device you can run this command:

    adb shell "ls -l /dev/block/by-name/super"

    Troubleshooting:
    If you get error 255 in custom recovery when trying to install flashable zip then try to install it manually. If you encounter this error please send me this file /tmp/recovery.log
    Make sure the script folder was correctly extracted to:
    /data/local/tmp/systemrw_*VERSION*
    If you can't run the script try making the file executable like this: chmod +x ./systemrw.sh
    If you still can't get it to work run which sh in your shell and replace the shebang in the first line of the script with the output of that command. Don't remove the first two #! symbols though. Then save the file and try again.
    Make sure you have full read write access to the /data/local/tmp directory and that the containing files are not encrypted in custom recovery!

    NOTE:
    I did not come up with all this by myself. After searching for a solution for countless days without success, going even as far as learning hex editing - I accidentally came across a couple of very interesting threads burried deep inside the new forum interface where this method has been described by various enthousiasts (links can be found in the credits section below). So I take absolutely no credit for the underlying core mechanisms of the script. I'm only the amateur who put it all together into a compact script so that everybody can enjoy an Android system that's read-write-able again. Just like it used to be in Android 9 or earlier. Before this annoying 'shared_blocks feature' was implemented.

    Credits:
    Huge thanks to @Kolibass for allowing me to use his partition tools for Android. Without your tools this script would not work on the Android platform! This genius also showed me how to flash a 5GB file to my partition in just under 30 seconds! Much faster than fastboot! I still can't believe it!
    Big thanks to @Brepro1 for allowing me to basically copy his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Also big thanks @munjeni for allowing me to use his superunpack V1 tool in the previous version. It helped me to understand how these super images work.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the previous version which helped me to create this version. It's still part of the troubleshooting repair script to fix error 73.
    More thanks @gabrielfrias for his helpful comment
    Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'
    Thanks @HemanthJabalpuri for assisting me in optimizing the underlying algorithm!

    Disclaimer:
    This is open source software and is provided as is without any kind of warranty or support whatsoever.
    By using and viewing this software you agree to the following terms:
    Under no circumstances shall the author be held responsible for any damages that may arrise from the (inappropriate) use of this software.
    All responsibility, liability and risk lies with the end-user. You hereby agree not to abuse this software for illegal purposes.
    The end-user is free to improve the underlying algorithm (as long as no malicious code is added) as well as redistribute this script in his own project as long as the comment and title section of the script (lines #1 - #65) as well as the included update-binary are not modified or removed.

    Please make sure to post your feedback, suggestions and improvements in the official thread right here.
    Enjoy customizing your read-write-able Android device!


    v1-31d_01-jpg.5309953
    v1-31d_02-jpg.5309955
    v1-31d_03-jpg.5309957


    1-jpg.5235933


    Confirmed working on these devices :

    Download v1.32 mirror #1
    Download v1.32 mirror #2
    current status:
    experimental
    If you like this project and want to support the developer at finishing this project & creating more amazing projects like this then please feel free to donate to the developer by clicking the link below. Thanks! Your support is very much appreciated!

    Donate
    8
    If the script works on your device please write me your phone model, Android version, script version and if you have super partition or not. Also please send me your log files.

    I will add you to the list of success and it will be helpful for further development. Thank you!
    6
    New version 1.20 is ready! DOWNLOAD HERE
    Good news for those that don't have TWRP or couldn't get it to work in their TWRP. Now the script can also be run directly inside Android. Keep in mind that you will have to flash the patched images manually in this case using fastboot flash.

    The zip can still be flashed in TWRP (make sure zip signature verification isn't checked). This time I bundled my device's stock sh binary (which I used to develop the script) with the archive. Hopefully this will prevent avoidable sh-related syntax errors for some folks. The flashable zip installer update-binary automatically launches the script with the proper arguments using this bundled sh program (it's inside the tools subfolder).

    To those that were having difficulties running the previous version due to empty partitions or multiple partition groups inside their super : this has finally been fixed :D

    Please give this new version a try and let me know if it works for you or not and I will add it to the first post. Thanks for your feedback!
    5
    I try to redo the procedure, i want to change the size. but i get error, can't remove lock.

    Good news. New hotfix available HERE
    I got rid of that buggy get minimum size function and reworked the size querying algorithm a little bit. Should be more stable now.

    Next step will be to make the script compatible with those devices that have empty partitions embedded inside their super partition...
    Also ronnie was complaining about syntax error but I have yet to find the syntax error... If anyone finds it please let me know so I can fix it. Thank you!
    4
    @lebigmac
    I am happy to say that, all the things went fine with my Realme C12.

    I have removed original super.img right after lpunpack finishes. This makes me use your tool with just 15GiB free space.

    A small thing is that, in your update-binary, please create a dir /data/local/tmp if it does not exist.
    If it does not exist, your tool will fail to install.
    It will be not present if a person clean flashes your tool(wipe data).

    Also system RW works fine, but vendor RW gives operation not permitted.
    Do I need use chattr with the block of vendor?


    Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

    Thanks

    Hello HemanthJabalpuri. Did you actually get my script to work on your device? This is wonderful news.

    Thanks for the suggestion about creating /data/local/tmp folder if it doesn't exist. I will do it in the next version.

    vendor RW gives operation not permitted.
    Do I need use chattr with the block of vendor?


    Operation not permitted? I never seen this error before. Do you get this error in the script or elsewhere?
    Sorry I don't know what is chattr.

    Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

    Thank you very much for this precious piece of advice. Some people have old sh version in their twrp that don't even support basic array functions. Do you think it's possible to bundle my own sh file (that I used for development) with the flashable zip and rule out any sh compatibility issues this way?

    In the next version of the script I would like to remove twrp completely from the requirement list so that everybody can enjoy a system that's read write-able, not only those with twrp. Some devices have no twrp or orange fox available.

    No Orangefox recovery too for Oneplus 7T , unfortunately. Oneplus really messed up 7T's decryption with android 10. I'm hoping for it to fixed with OOS 11 update which too, got delayed because they didn't care for its decryption issues in the first place. Its mind boggling that the 7T doesn't have a working TWRP even after 1 ½ years of being launched.

    Hi shady_soldier
    Yes that kind of sucks I agree. I wish I knew how to actually compile recovery. Too bad I'm only an amateur!
    I tried to compile Xiaomi stock recovery the other day but no luck so far...

    @lebigmac Any chance to uninstall It?
    Thx!!

    Hi Morello12. Did you actually run the script successfully or not?
    Sure simply delete the entire folder /data/local/tmp/makesysrw_1.15c

    But is it a new version or what?
    Does it work without disabling DM-verify?

    No. Disable dm verity and verification is always a good idea!
    @Ayoub$# You could also try flashing an empty vbmeta with fastboot if you can't disable dm verity manually.

    Code:
    fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img