[Q] My Phone reboots into TWRP after debloating it - Redmi Note 8 Pro Questions & Answers

Hello,
i recently installed magisk rooted my phone using TWRP. Then I debloated it and deleted the MI cloud services. Now when I start my phone it reboots into TWRP and shows:
“Android Rescue Party trigger! Wipe data and caches and/or clean-flash you ROM!"
Is there a method to reinstall these apps from TWRP?

Depends on how you debloated. either copy these files back to device and wipe dalvik-cache
Code:
/system/app/CloudService/CloudService.apk
/system/app/CloudService/oat/arm64/CloudService.vdex
/system/app/CloudService/oat/arm64/CloudService.odex
or re-enable the package in package-restrictions.xml
Code:
adb pull /data/system/users/0/package-restrictions.xml
delete the enabled flag with Notepad++
<pkg name="com.miui.cloudservice" ceDataInode="300224" e̶n̶a̶b̶l̶e̶d̶=̶"̶3̶"̶ ̶e̶n̶a̶b̶l̶e̶d̶C̶a̶l̶l̶e̶r̶=̶"̶s̶h̶e̶l̶l̶:̶1̶0̶0̶0̶"̶ ̶i̶n̶s̶t̶a̶l̶l̶-̶r̶e̶a̶s̶o̶n̶=̶"̶4̶"̶/>
push the modified file back and write its content into existing file
Code:
adb push package-restrictions.xml /tmp
adb shell cat /tmp/package-restrictions.xml > /data/system/users/0/package-restrictions.xml

/system/app/CloudService/CloudService.apk /system/app/CloudService/oat/arm64/CloudService.vdex /system/app/CloudService/oat/arm64/CloudService
adb pull /data/system/users/0/package-restrictions.xml
adb push package-restrictions.xml /tmp
adb shell cat /tmp/package-restrictions.xml

you need platform-tools for this and type commands on your PC in cmd.exe

Related

I need to create an update.zip please help

i want to create an update.zip i can install via the recovery console.
i have the apk which is
com.lookout.apk
i have created folders system/app
zipped it and signed it but when i try to flash it needs an update .script how do i create an update script to tell the recover console to install the app to system/app
If you have the apk, why not just install it via a file manager (Astro), adb install (adb install <path:\package.apk>), or adb push (adb shell -> mount /system -> exit -> adb push <path:\package.apk> /system/app) in recovery?
Plenty of ways to install without needing a flashable zip if it's just for you.
If you really need a zip, I'd find somebody else's who is doing the same thing and just replace the APKs and resign it.
Just thoughts.
Hi,
I´m kind of in the same situation. I want to install Sim Checker Pro as a system App.
It is currently installed.
The author told me to copy the simchecker15.apk from /data/app/ to the sd card. Then delete the original. Then copy it over to /system/app/ and finally delete the apk on the sdcard.
Code:
adb remount
adb shell cp /data/app/org.ajeje.locservice15.apk /sdcard
adb shell rm /data/app/org.ajeje.locservice15.apk
adb shell cp /sdcard/org.ajeje.locservice15.apk /system/app
adb shell rm /sdcard/org.ajeje.locservice15.apk
Since I´m not able to write to /system unless I mount it in (pauls) recovery mode can anyone tell me how to do this on the Desire exactly.
I get adb working in recovery and can also mount /system but how do I push the files from /data/app/ to sd and from there to /system/app?
Edit: I got it sorted out
it was
Code:
adb shell mount /system
adb shell cp /data/app/org.ajeje.simchecker15.apk /sdcard
adb shell rm /data/app/org.ajeje.simchecker15.apk
adb shell cp /sdcard/org.ajeje.simchecker15.apk /system/app
adb shell rm /sdcard/org.ajeje.lsimchecker15.apk

Helppp removing .apks with sdk method

i try this on the comment prompt while phone running.
cd\sdk
cd android-sdk-windows
cd tools
adb devices
adb shell
#mount /dev/block/mtdblock4 /system
cd /system/app
ls
i get all the apk. files
i try removing an apk.file
typing this syntax:
rm -f thenameoftheapp.apk
and it'll say:
rm failed for -f, read only file system
it wont let me write on the system im guessing.
Now i tried doing the same thing but phone mode is on recovery.
I have the nand protection unlocked so when i get to recovery mode
i have already the custom recovery setup showing, i don't run the recovery-windows.bat.
now when i type this on the comment prompt
cd\sdk
cd android-sdk-windows
cd tools
adb devices
adb shell
#mount /dev/block/mtdblock4 /system
cd /system/app
ls
i get all the apk. files
i try removing an apk.file
typing this syntax:
rm -f thenameoftheapp.apk
after i hit enter it shows me
#
so im assuming the apk. has been removed
after i exit the comment prompt and i wipe the dalvik-cache
i reboot the phone and all the apps i removed are still there and running still.
help please

Maybe this can help for rooting the new sbf

1. How can I root my phone?
1.1 General information/Basic adb-commands
Rooting a phone enables you to do things, which normally aren't possible for the average user like:
- Removing apps which were preinstalled by the provider (like Orange, Vodafone, etc.). My Tattoo had Vodafone apps for buying music and other sh*t, which was installed on the system partition (to which a "normal" user has no rights to write to, including deleting).
The Tattoo was successfully rooted by a bunch of guys here, namely -bm-, mainfram3 and Coburn64 (maybe, I don't remember quite correctly ). Also the Tattoo was the first phone having a security mechanism hindering a user to mount the filesystems as read/write, which had to be overridden by remapping the read only memory region to a read/write one. This is done by the module Tattoo-hack.ko, also made by mainfram3. He also created the first boot.img, which enabled su directly from adb and loading Tattoo-hack directly from boot on.
A few words about adb:
ADB is a tool for communicating from the PC with the mobile phone. For this a service is running on the phone enabling the communication via Terminal Emulator. Here are the most useful adb-commands:
Code:
adb push localFileFromPC /path/on/mobilephone
-> pushes a file "localFileFromPC" to a specified location on the phone
adb pull /path/to/file pathFromPC
-> receives a file from the phone and stores it to "pathFromPC"
adb remount
-> This is only possible in custom ROMs, remounts the file system to r/w automatically
adb shell "command"
-> executes "command" and returns to the computer shell
adb shell
-> opens a shell session on the phone (from here on you have to be very careful! Also you can execute now normal linux commands like rm, mv, ls, chmod and so on, but not cp (this can done through busybox)). You will have to use this more often, so get used to it
1.2 Do I have to create a goldcard?
I read this question quite often. For rooting, you don't need it, but for SIM-locked phones you can't flash custom unbranded ROMs (I think).
A guide to create a goldcard follow this link: http://forum.xda-developers.com/show...88&postcount=1 (thanks to MiSSigNNo to this point)
1.3 Tools you need
A complete set of tools can be found here Feel free to mirror it:
http://rapidshare.com/files/403766494/Tattoo.rar.html
Mirror(s):
http://www.bild-ton.net/Tattoo.rar
http://www.megaupload.com/?d=CI9AW83F
This package contains:
- adb binaries for Windows (sorry Linux users )
- su (Please note: use the su-binary attached in this post, not the one in the archive!!!!!)
- m7 exploit
- Amon_RA recovery.img
- mainfram3 boot.img
- flash_image binary
- tattoo-hack.ko
1.4 The automated way
This method was created by maverixx and can be found here. This basically consists of a package doing everything you need by itself. It roots the phone and flashes maverixx recovery.img, which (no offense) I don't like as much as I like Amon_RA's one!). Just click the batchfile and it does the rest (you have to connect your phone via USB to your PC though ).
If you want to use the automated way, but flashing Amon_RA's recovery, just replace the recovery.img from maverixx' package with the recovery.img provided in my archive file (see 1.3 for the link).
In my time here I noticed quite a few users experiencing problems either with a fully functional su or with the recovery image not flashing certain update.zip packages. It seems to be a matter of luck.
1.5 The manual way (recommended by the author)
I personally like what is done when and how, that's why I recommend the manual way. So let's get down to business Let's see if you know all the adb-commands I wrote here:
1. Let's say you have everything unpacked into C:\Tattoo
2. In your terminal (on your PC) type:
- adb shell "mkdir /data/local/bin" (if it returns an error it means that the directory already exists, just proceed)
- adb push m7 /data/local/bin/
- adb push su /data/local/bin/
- adb push flash_image /data/local/bin/
- adb push tattoo-hack.ko /data/local/bin/
- adb push recovery.img /sdcard
- adb push boot.img /sdcard
3. We have every needed file on the phone now. Type now (we are still in your terminal):
- adb shell
$ cd /data/local/bin
$ chmod 766 m7 (I don't retain this step as mandatory, so if this process fails, just proceed)
$ while ./m7 ; do : ; done
lots of text until you see something like "wrote shell code", press enter 2 or 3 times enter to see:
#
4. Then perform this:
- # export LD_LIBRARY_PATH=/system/lib
- # export PATH=/system/bin
- # insmod ./tattoo-hack.ko
- # mount -o rw,remount /dev/block/mtdblock5 /data
- # mount -o rw,remount /dev/block/mtdblock3 /system
- # cat ./su > /system/bin/su
- # chmod 4755 /system/bin/su
- # chmod 755 ./flash_image
Questions?
1.6 Problems and (hopefully good) solutions
Q: How do I execute my command line tool?
A: On your Windows host, go to Start->Run...->type "cmd"
Q: Where is my adb? When I type it in my shell it says that it was not found!
A: The adb binary is found in the archive I supplied above or in the Google SDK. As my archive-file is quite smaller than the Google SDK you should take mine. Let's suppose your adb binary is unpacked in C:\Tattoo, then type:
Code:
Your\Current\Location> cd C:\Tattoo
C:\Tattoo> adb <command>Q: adb says "error: device not found" when I try to launch the shell on the phone!
A: Connect the phone with the usb cable and make sure the sd card is not mounted as drive on your PC!!!
Q: When I want to copy something the phone returns that "cp" is not found! Also when I try to move a file, it says "cross-link device".
A: Well, copying from one partition to another is only possible either via busybox or via
Code:
cat file > /location/filename
Example:
cp /data/su /system/bin
is realized by typing
cat /data/su > /system/bin/suAlso make sure that system is r/w!!!
Q: flash_image returns write errors when flashing recovery/boot image!
A:
For boot: Try to redo the flash procedure
For recovery: Note that you can't flash the same recovery.img as the one already installed, so install another recovery.img first (like maverixx) and then Amon_RA's again. If it still doesn't work reboot, remount the partitions r/w, insmod tattoo-hack.ko and retry flashing.
Q: How can I unroot my device?
A: Just delete su from /system/xbin and restore the old boot.img. Alternatively see here for retrieving a stock ROM to flash it on your phone.
i hope someone try this i don't have time

[How-to] Unbrick soft brick

I successfully followed itiskonrad instructions how to brick your phone by copying framework-res.apk with ES Explorer.
The result was a soft brick, when phone would freeze at LG logo.
Hopefully at that point it can be accessed from PC with adb.
So here are the steps I took to unbrick it
Before you start, have a copy of working framework-res.apk in C:\ (path doesn't matter as long as you change it at command below:
1) re-root with SuperOneClick (v2.3.1.0). I had to do this because su command would fail.
2) open cmd and type in: adb shell it should show you either $ or # before the cursor. (how to install adb you can find on google)
3) type (each line separate command which you must finish by hitting ENTER key):
su
mount -oremount,rw /dev/block/mtdblock3 /system
exit
exit
adb push "C:\framework-res.apk" /system/framework-res.apk
adb reboot

Updating LineageOS unroots device

Is there anyway around this? Or do I have to root every time I update LineageOS?
My method from cmd in Win10do:
C:\Users\Greg\TWRP_bups> type bup.bat
adb devices -l
adb reboot recovery
pause Check Phone...
adb backup -f %date:~-4,4%%date:~-7,2%%date:~-10,2%_backup.ab --twrp
echo All Done.
C:\Users\Greg\TWRP_bups> cd ..\Downloads\LOS-13-01-18
C:\Users\Greg\Downloads\LOS-13-01-18> adb push lineage-14.1-20180113-nightly-w7-signed.zip /sdcard/
C:\Users\Greg\Downloads\LOS-13-01-18> adb push open_gapps-arm-7.1-nano-20180114.zip /sdcard/
C:\Users\Greg\Downloads\LOS-13-01-18> adb push ..\SuperSU-v2.82-201705271822.zip /sdcard/
I do this every week on my LG L90
NB: You _must_ load the zips in that SAME order on the android device ! ! ! [SuperSU = LAST ]

Categories

Resources