[Q] Script To Flash - General Questions and Answers

Hi
I need an script sh or other that permit, when started from terminal (on the phone) restart my phone in recovery and automatic flash an zip file. This procedure is like OTA update that download and flash the update, but i need only a part that do the reboot and flash.
Soru for my english and thanks is in avance d.

Related

[Q] important problem with nexus s i9023

Hi , I have a problem with Samsung i9023. I can not change any things in i9023 such as files, apps, settings,sdcard and all other . I reset it too factory but factory reset not work and any things not change . I flash it by 2.3.3 flash file with Odin and z3x box, flash finished normally but any thing not change such as settings, apps, messages, ...! I flash it with higher version of flash file, but device not boot and stay in Google logo and after that reflash it by 2.3.3 flash file, device boot up normally but all settings,apps,files do not change. I copy file in sdcard with my PC, copy finished normally but can't find my file in sdcard. Help me plz!
What ROM n kernel are you using?
Sent from my Nexus S using xda 'donation' apps
Thanks for replay . my rom is default nexus s android 2.3.3 with android default kernel build number GRI54. I don't use custom rom .
jafar5401 said:
Hi , I have a problem with Samsung i9023. I can not change any things in i9023 such as files, apps, settings,sdcard and all other . I reset it too factory but factory reset not work and any things not change . I flash it by 2.3.3 flash file with Odin and z3x box, flash finished normally but any thing not change such as settings, apps, messages, ...! I flash it with higher version of flash file, but device not boot and stay in Google logo and after that reflash it by 2.3.3 flash file, device boot up normally but all settings,apps,files do not change. I copy file in sdcard with my PC, copy finished normally but can't find my file in sdcard. Help me plz!
Click to expand...
Click to collapse
First you need : http://www.4shared.com/zip/2L09-JyW/Root_Nexus_S.html
After that you need : remove install-recovery.sh just in .....
run in windows-> Start->at the search bar write cmd and navigate into your android sdk is installed
For me :
C:/"Programs and Files (x86)"/Android/android-sdk/tools/>adb shell
# rm /system/etc/install-recovery.sh
#exit
or with Root Explorer into system/etc/install-recovery.sh just renam it (ex. : .sh.old)
Now you can download this Stock Romv2.3.4 : http://www.4shared.com/file/cJbNf1Nf/NexusS.html
just unpack Nexus.7z with passw: surdupetru
Now , copy NexusS.zip into sdcard, and than you can install it with CWM
( shut down your phone -> press power and volume up at the same time -> choose recovery mod-> wipe data/factory reset, wipe cache partition , advanced Wipe Dalvick-Cache and now choose install zip from sdcard, yes -> navigate into your sdcard and click NexusS.zip. Waitt for installing ...and you will see a nice Stock Android 2.3.4 with root permission, fast & more stable! Good luck!
hi and thanks for replay . it's very good but i can't copy file to my sdcard . copy with pc finished normaly but copied file is not in my sdcard so i think settings,apps,msgs,sdcard a.d all other is read only ! i install recovery by adb and recovery load normaly but can not copy custom rom file !
plz heeeeeeeeelp meeeeeeeeee!

[HOW TO] Flash recovery from phone.

HEY FOLKS,
This THREAD will GUIDE you to flash recovery.img from PHONE.
I found many of the people found difficult to flash recovery via FASTBOOT and TERMINAL EMULATOR by using CODES.
Here is a SIMPLE method to flash recovery from phone through app.
STEPS:
1) Download recovery flasher utility.apk
download link
2) install the recovery flasher utility.apk file.
3) download your preferred recovery.img
4) copy the downloaded recovery.img file to sd-card and place it in ROOT of your sd-card (Don't keep the file inside any folder because the app may not recognize the file)
5) rename the downloaded recovery.img file as recovery.img(all in lower case)
6) Open the app and flash the recovery by pressing the "install recovery" button (Please be patient, wait for the complete flash, wait till you get the display "reboot into recovery")
7) done!!! :good: enjoy your new recovery.:victory:
(note: this method worked very well for me, app flashed recovery within 2sec, and i am not responsible if it wont work for you or anything is messed up.)
:victory: hit :good: if this guide was helpful. :highfive:
.apk to flash recovery
Is there any way to find the success of flashing ?
cvpillai said:
Is there any way to find the success of flashing ?
Click to expand...
Click to collapse
yes mate, after flashing through app, the app will show reboot into recovery. after that just boot into recovery(manually).
hit thanks if i helped :highfive:
does it work on all rooted mobiles
aashking said:
HEY FOLKS,
This THREAD will GUIDE you to flash recovery.img from PHONE.
I found many of the people found difficult to flash recovery via FASTBOOT and TERMINAL EMULATOR by using CODES.
Here is a SIMPLE method to flash recovery from phone through app.
STEPS:
1) Download recovery flasher utility.apk
download link
2) install the recovery flasher utility.apk file.
3) download your preferred recovery.img
4) copy the downloaded recovery.img file to sd-card and place it in ROOT of your sd-card (Don't keep the file inside any folder because the app may not recognize the file)
5) rename the downloaded recovery.img file as recovery.img(all in lower case)
6) Open the app and flash the recovery by pressing the "install recovery" button (Please be patient, wait for the complete flash, wait till you get the display "reboot into recovery")
7) done!!! :good: enjoy your new recovery.:victory:
(note: this method worked very well for me, app flashed recovery within 2sec, and i am not responsible if it wont work for you or anything is messed up.)
:victory: hit :good: if this guide was helpful. :highfive:
Click to expand...
Click to collapse
abhi1607 said:
Click to expand...
Click to collapse
Hopefully it should work in all rooted devices
Hit thanks if i helped :good:

OTA update bootloop fix [S-ON] [BU] [Stock Rooted ROM]

Hi, I found a way to fix this bootloop which happens after you flash the latest ota update if you have unlocked and rooted your stock rom.
I own a HTC E8 China Unicom [M8Sw - dual sim], but I think it will work on other variants.
It is the SU binary/files which are preventing the phone from updating correctly.
You can also restore a clean unrooted TWRP backup and do the OTA update.. it will work just fine.
This tutorial is for those who don't want to lose their app data and modifications.
To be able to update... you need to fully unroot the phone before. Well, this was previously not possible due to system write protection.
(There are also other methods of unrooting. (deleting the SU files manually with the file manager of TWRP recovery) This doesn't work, I have tried it myself..often cause bootloops.)
But now we have a custom recovery mod which enables us to write to the system partition and thus can fully unroot with SuperSU app itself.
Requirements:
-some expertise with adb/flashing/twrp recovery management will be needed.
-stock firmware.zip, inside the OTA zip file, where you will find you stock recovery,boot image, etc
-Stock ROM, rooted with no modified existing system files
-TWRP Recovery from @Captain_Throwback works fine. I used the 2.8.6.0 one. http://forum.xda-developers.com/one-e8/orig-development/recovery-twrp-touch-recovery-t3060188
-untouched Stock Kernel Modules (IMPORTANT)
-SchKernel Extra 3.3, to gain write permission to /system http://forum.xda-developers.com/one-e8/general/schkernel-extra-3-3-t3200090
[UPDATE: SchKernel Extra has been updated to 3.5 and the old one is not available for download on the other thread. You can find attached at the bottom of this section ver3.3 which I had used. Please don't use ver3.5 as a user has reported having bootloop with that.)
-Battery +80 charge recommended...the process gonna demand a lot of power.
-Patience... loads of it....
Disclaimer: I am not responsible if you brick or damage you phone!!
Before you flash anything, be sure to have a working twrp full backup of you phone! In case anything goes wrong.
STEPS:
1. Copy the untouched kernel 'modules' folder [found in system/lib/ in your phone] to another location ( for e.g. to your internal phone memory), you're gonna need it later.
2. Flash the twrp recovery if you haven't already and boot into TWRP recovery.
3. flash SchKernel Extra 3.3 kernel mod. It will launch the aroma installer. There will be options as overclocking/underclocking etc..
I left everything on STOCK option, disabled Swipe2sleep, unselected the everything in the optional addition page. Then went to install it.
4. Reboot, and open SuperSU app, go into setting, tap the FULL UNROOT option, this might take a while. The first time, when the unrooting notice shows and it seems that the app is not doing anything, you might be required to exit the app by pressing home button. Then open the app again and redo FULL UNROOT option. If you exit the app and when re-opening it, the "unrooting notice" is still there, then it means it is working. This might take a bit of trial and error.
5. Ultimately, SuperSU app will close. Then you will need to reboot. You will see that SuperSU is gone and that you have no root access.
6. Now, turn it off again to go to fastboot. Connect to PC and flash the stock boot.img via adb to restore the stock kernel.
8. Then, in twrp recovery, mount /system partition and got to advanced >> file manager..
9. Now browse to /system/lib/ and delete the 'modules folder'.
This is because the SchKernel Extra 3.3 kernel mod flashed previously has modified your kernel modules and when you will try to update the OTA, the stock recovery will report that the kernel modules (xxxxx.ko) has be modified and it will stop the OTA update process.
10. Remember the previous untouched stock 'modules' folder you copied previously, now move it to /system/lib/HERE , to replace the deleted folder.
[DO STEP 9 BEFORE - Don't try to overwrite the folder, it won't be possible. It said operation failed for me. ]
Optional: You might also want to delete su.d folder in \system and init.d folder in system\etc
these files were for the custom kernel and won't be needed anymore.
11. Reboot into fastboot mode, connect to PC (if not already), flash stock recovery.
12. Now, you're good to flash the OTA updates. :good:
-Download it, if not already done.
If ever you have downloaded from PC and copied it to phone, and for whatever reason the phone is not detecting the zip file and asking for install.
Just move it to you exeternal SD card and rename it to "ptt.zip" , go into stock recovery and go down the list to "apply update from SD card"
and it should flash the zip file. When done, select the reboot option and it will say reboot to flash firmware.zip and the will boot. :fingers-crossed:
When booting it will take some time (3 to 8 mins), and then go to the "Android is updating - optimizing apps" screen. This might take a lot of time if you have a lot of apps installed. The phone might get really hot during this process.
When the OS finally boot completely there will be an "HTC" screen and an exclamatin mark in the notification bar. NO WORRIES, it is the just the update working. It will go away when the update is fully processed.
After OTA update is done, you can make a twrp backup of the unrooted system, so that you can restore it for future OTA updates.
If some steps are confusing, feel free to ask for any clarification
Hope I helped you. Don't forget to hit thanks
problem
hi after i flashed SchKernel Extra 3.3 my phone just turned off and won't turn on. what should i do?
neekless said:
hi after i flashed SchKernel Extra 3.3 my phone just turned off and won't turn on. what should i do?
Click to expand...
Click to collapse
how did you flash it exactly?
Did you flash it thought TWRP recovery?
also...what variant of HTC e8 are you using?
Thank you for this guide. :good:
For the newbies, here are exact instructions for each step. TWRP is required; presumably you have this because you've rooted your phone. (If you haven't rooted your phone, what are you doing here?)
Note that rebooting to TWRP can be accomplished in several ways:
Long-press the power button; when prompted choose Reboot. When the screen goes black, press and hold the Volume Down key. This will take you to hboot; from there choose Recovery.
Enable developer mode from settings, plug in to a computer, and issue the command adb reboot recovery.
Also note that it is prudent to do a full TWRP backup to external storage (microSD, USB OTG) before anything else, so you have a good recovery point if things go wrong.
To copy the system/lib/modules directory, you can use a root-enabled file explorer or TWRP. To do it in TWRP:
Reboot to TWRP.
In TWRP, select Mount. Make sure that system is checked.
Back to the main TWRP menu, select Advanced.
In the advanced menu, select File Manager. Then navigate to /system/lib/modules.
Tap on Select, then Copy Folder. Navigate to a new location - I used /sdcard/Backup - and tap Select again. Don't use your external SD or USB-OTG, they may not preserve permissions correctly.
To flash the SchKernel Extra, copy the ZIP file to your device, reboot into TWRP, and select Install. From there, navigate to where you copied the ZIP file and select it; then follow the prompts as sanijsnj specified.
Removing SuperSU works exactly as described. Don't forget to reboot at the end (although it may not be necessary).
To flash the stock boot, in a cmd window where you have the Android SDK, typically in the sub-folder platform-tools enter: fastboot flash boot boot.img (boot.img from the OTA ZIP).
To delete and restore /system/lib/modules, follow the steps above, starting of course from your saved 'modules' directory and copying to /system/lib.
To flash the stock recovery, again in the cmd window enter: fastboot flash recovery recovery.img (recovery.img from the OTA ZIP).

Root Infinix Zero 5 (X-603) (Systemless root Support OTA)

Systemless Root Magisk Beta 15.2 ( Thanks @topjohnwu for Magisk)
As it is systemless so it doesn’t change system file. It only changes in Boot image.
Whenever you got OTA just Reflash Stock Boot img and update your device to latest version.
This Boot.img is taken from latest version of XUI 3.0 Nougat version Build No. X603-H575A-N-IN-171227V175. So When it will update need to Patch again boot.img with updated version or this can also be used.
Warning:-
I am not responsible for bricked devices.
Your warranty will void now. Do it at your own Risk.
Follow Step as Mentioned Below:
1. Unlock Boot loader as mentioned on following link:
https://forum.xda-developers.com/android/development/unlock-bootloader-infinix-zero-5-t3715360
2. If you want to install TWRP recovery then follow:
https://forum.xda-developers.com/android/development/infinix-zero-5-x-603-twrp-recovery-t3712491
Now the step for Systemless root with unlocked bootloader and usb debugging on is must. (with stock recovery no need TWRP)
1. Download the Zip file on following link: https://drive.google.com/open?id=1vne0IdPrW1isGoCJbYTCl4GRG5mh6QF5
2. Extract zip file in a folder.
3. Press and ctrl+Shift and right click on mouse.
4. Now press option open cmd window here, in window 10 it may be open powershall window here just select it.
5. In cmd window follow the following command.
A. adb reboot bootloader (phone will reboot and light blank dark screen)
B. fastboot devices (it will show your device if connected well)
C. fastboot flash boot patched_boot.img (it will flash new boot img in your phone.
D. fastboot reboot (will reboot your phone)
E. Install magisk manager app from XDA lab or from attached here in zip just extract it.
Your phone is rooted now with stock recovery.
OTA Update Support: Just follow above cmd again and at point C. just change flash cmd to stock boot. (fastboot flash Stock boot.img) then reboot and update your system OTA.
Thanks.
Last Updated on 05/01/2018
I can't install any module
/data/adb/xxx.img mount failed
Failed
Installation failed

[SOLVED] Bootloop-ish on Fastboot Mode but TWRP works

Hello, I'm new here, so if I'm doing something wrong have mercy .
My 1+7Pro GM1913 is unlocked, rooted with Magisk (I think 22.1), TWRP 3.5.0_9-0-guacamole and OOS (last flashed version was 10.0.11.GM21BA considering I still have on the phone the OnePlus7ProOxygen_21.E.32_OTA_032_all_2101280020_c39273ef1f205b6.zip).
Last time I've flashed something I think was about a month ago, with the last update. No problem so far, until today. This morning my phone had problems with wifi, so I rebooted it.
From that moment on, it boots only to Fastboot Mode. I can get to TWRP and I can access my phone directories from the pc only from TWRP, every other mode makes my phone unreachable from usb, and installing or updating drivers doesn't work.
I would love to avoid any data loss or anything related to having to reinstall every 2FA I have.
I tried deleting everything from /data/adb/modules but nothing changed.
I looked around on XDA but I usually get people stuck on Fastboot only and accessible via usb, which is not my case.
So I was thinking about flashing the latest available OTA, then TWRP, then Magisk from TWRP but I'm not sure if it will works or just worsen my problem.
Has anyone had this problem before? Any idea about how to solve this?
Thanks for anyone willing to help me.
Have a nice day!
EDIT:
Solved flashing the full OTA.zip, twrp.zip, reboot and Magisk.zip after renaming the apk.
I think this will help you:
Twrp --> flash your boot.img (with "payload dumper" it can be extracted from the full OTA update file)
Then flash twrp.zip, reboot in to twrp, flash magisk.zip, wipe dalvik cache
Reboot and provit ;-)
Being a monday and everything, I'll write down what I've done so far, this way if anyone find this post with the same luck as mine maybe it will be less painful for him\her.
I followed this guide on XDA in merit of the "payload dumper" suggested by Ghost323 and followed the instruction on the Github page, which are:
google protobuf for
Code:
python pip install protobuf
Make you sure you have Python 3.6 installed.
Download payload_dumper.py and update_metadata_pb2.py
Extract your OTA zip and place payload.bin in the same folder as these files.
Open PowerShell, Command Prompt, or Terminal depending on your OS.
Enter the following command:
Code:
python -m pip install protobuf
and being my zip a full OTA​
When that’s finished, enter this command:
Code:
python payload_dumper.py payload.bin
This will start to extract the images within the payload.bin file to the output folder you are in.
Click to expand...
Click to collapse
All good until the
Code:
python payload_dumper.py payload.bin
gave me a "no module named bdsiff4" error.
So I used
Code:
pip install bsdiff4
and turns out I'm missing Microsoft Visual C++ 14.0, which is absurd because I'm staring at it in my programs and I used it last week.
Anyway, one vs_BuildTools.exe, 12Gb downloaded and a reboot later, this time
Code:
pip install bsdiff4
works and the
Code:
python payload_dumper.py payload.bin
command finally starts.
Once that's done in the output folder I found the boot.img and made a copy into my phone root folder /.
At this point, I was looking for a flashable zip of Magisk, but I found out in a tweet dated 11:55 AM · Jan 22, 2021 that "the Magisk Manager APK *itself* is a custom recovery flashable zip", so back to Github to download the Magisk-v22.1.apk and copy that on the same root folder on my phone, following the instruction under the Magisk v22.0 updated installation guide. Under "Custom Recovery" it is written to rename the .apk into .zip.
On TWRP, Install, Install Image, and selected boot.img.
At that point I can choose between Boot, System Image, Vendor Image and Install Recovery Ramdisk.
But on the installation guide of Magisk is written "Never, ever try to restore either boot or recovery partitions back to stock! You can easily brick your device by doing so, and the only way out is to do a full Odin restore with data wipe."
So now I'm stuck. Please help.
Later I'll flash twrp-installer-3.5.2_9-0-guacamole.zip, reboot to TWRP and flash the Magisk-v22.1.zip.
You can install your full OTA update file in TWRP. Then install TWRP.zip. Restart into TWRP, install Magisk.zip (rename Magisk 22.1.apk to Magisk 22.1.zip). Wipe dalvik cache and reboot into the system.
That should work the same way. The main thing is that your Boot.img is fine again.
Both ways of mine should lead to the same success.
I wish you success.
Yes, flashing the full OTA, twrp, reboot and Magisk gave me back my phone.
However now my SafetyNet is having problems.
Thanks for the help!

Categories

Resources