[Root] [Script] OTA Killer for LG K7 m1 and other devices - Upgrading, Modifying and Unlocking

Disclaimer: I nor XDA nor anyone else is responsible for your lack of reading or comprehension skills, ignorance on your part or anyone else's nor just plain stupidity on your part or anyone else's, so if you don't know what you're doing and or don't know how to fix any bad things that could happen then just don't do it.
Root and Busybox required.
This is a more permanent solution to stop OTA updates from downloading on your rooted device that is designed to survive when you wipe /cache. I'm including the script which will work on any device that downloads it's OTA updates as update.zip to /cache without modification and a flashable zip, the flashable zip is for the LG K7 m1 Metro PCS variant rooted with Magisk ONLY (unless modified) and was fully tested, you're free to edit the script and or the updater-script in the flashable zip for your device (be sure you get the /system partition for your device right, the init process right if not rooted with Magisk and the proper location and file name for your OTA updates) and you may release it for others to use if you like but please give appropriate credit. The script can simply be dropped in your appropriate init folder (/data/adb/service.d/ for Magisk) and set chmod 0700 before rebooting your device.
Alternately you can use MacroDroid to run the script at boot.
Trigger > Device Events > Device Boot
Action > Applications > Shell Script (Paste script on line)
The rest should be self-explanatory.
Thanks to QuickNET Tech for coming up with this method. You can and should read about it HERE and follow up with part 3 from their post so you don't get the annoying notifications. Instructions for reversing this modification are also in that thread, in addition to those instructions you'll also need to delete the 22otakiller script from your init directory (default is /data/adb/service.d/).
QuickNET Tech said:
-Part 3. [Optional]
The annoying update notifications are actually Google Play Services fault. All you have to do is go to "Settings > Apps" and find Google play services and disable the apps ability to show you notifications.
Click to expand...
Click to collapse
What this script does:
The script (see bottom of this post) when ran either automatically on boot or manually will check for update.zip in /cache, if it exist but wasn't created by the script or using the same method with the appropriate attribute applied then it will delete it (regardless of size including an authentic update.zip file) and create the appropriate 0 byte update.zip file with the appropriate attribute and permissions, if it doesn't exist it will create the appropriate file with the appropriate attribute and permissions. It creates a 0 byte update.zip that can not be modified or deleted by anyone including the super user without removing the file attribute which can only be removed by the super user. The flashable zip for the LG K7 rooted with Magisk ONLY (unless edited for your device and or root method) will install the script to /data/adb/service.d/ and set it's permissions to 0700.
Please let me know and post your device information if the updater-script in the flashable zip works as-is with your device.
Enjoy!
Script (22otakiller):
Code:
#!/system/bin/sh
uzip="/cache/update.zip"
if [ -f "$uzip" ] && lsattr "$uzip" | cut -c 6 | fgrep -q 'i'
then
exit
elif [ -f "$uzip" ]
then
rm -f $uzip
touch $uzip
chmod 7400 $uzip
chattr +i $uzip
exit
else
touch $uzip
chmod 7400 $uzip
chattr +i $uzip
exit
fi

Been a long time since I've been on this site seeing as most every device after the K7 hasn't had any development. Glad to see people are still messing with this device. Good work man!

Related

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

(Q) Best recovery?

What is the most reliable recovery currently? I'm using twrp at the moment. It's probably an older version so I'm curious what is recommended before i update it.
Sent from my Kindle Fire using Tapatalk 2
pwned3 said:
What is the most reliable recovery currently? I'm using twrp at the moment. It's probably an older version so I'm curious what is recommended before i update it.
Sent from my Kindle Fire using Tapatalk 2
Click to expand...
Click to collapse
My suggestion would be for you to stay with TWRP. Version 2.1.1 is the latest.
kinfauns said:
My suggestion would be for you to stay with TWRP. Version 2.1.1 is the latest.
Click to expand...
Click to collapse
I agree
Sent from my Galaxy Nexus using XDA
pwned3 said:
What is the most reliable recovery currently? I'm using twrp at the moment. It's probably an older version so I'm curious what is recommended before i update it.
Click to expand...
Click to collapse
You already know that TWRP is intuitive and easy to use. I'm using TWRP 2.1.1 and I have used recovery many times when trying out new ROM builds. Occassionally with 2.1.1 I find that the operation that you want to do just fails with either an error outright or will fail during the recovery process. It even failed on me once while creating a backup. I didn't pay much attention to the backup output log text once and I did want to recover that backup and could not due to an image file being zero bytes in size. I have my own app and data backup script that I wrote that keeps me current so recovery in such a failed case is simply flashing a new ROM and executing my recovery script; couldn't be simpler.
If you pay attention to TWRP's output and not just make an assumption that the backup or recovery succeeded then you can just repeat the operation until it's successful. This is rare but has happened to me more than once but even with that issue, I still like TWRP 2.1.1 (plus my own app backup script).
I'll include my app backup and recovery script here in case others can find it useful (I make no claims that will work to your liking however or that it will even work for you)
rebaseline.sh
Code:
#!/system/xbin/bash
cd /sdcard/BACKUP/
for i in `/system/bin/pm list packages -3 -f`
do
read junk apk pkg <<< =`echo $i | sed -e 's/[=:]/ /g'`
echo "Processing $pkg..."
echo " backing up $apk..."
cp $apk baseline/
touch /sdcard/BACKUP/baseline/`basename $apk`
echo " backing up data..."
busybox tar czf /sdcard/BACKUP/baseline/$pkg.tar.gz --exclude lib --exclude cache /data/data/$pkg 2>/dev/null
done
echo "Processing accounts..."
echo " backing up data..."
busybox tar czf /sdcard/BACKUP/baseline/accounts.tar.gz /data/system/accounts.db 2>/dev/null
Here is my recovery script:
restore-from-baseline.sh
Code:
#!/system/xbin/bash
cd /sdcard/BACKUP
pm set-install-location 1
chmod 777 /data/data
for i in baseline/*apk
do
X=${i/-[0-9].apk}
Y=`basename $i`
Y=${Y/-[0-9].apk}
echo $X
pm install -r $i
# Find out what the new app ID is for the package
OWNER=`/system/bin/ls -l /data/data | grep $Y | awk '{print $3;}'`
echo $OWNER
# Restore data as the app owner ID
chmod 777 /data/data/$Y
su --command "tar xvf /sdcard/BACKUP/$X.tar.gz -C /" $OWNER
echo "tar rc=$?"
chmod 751 /data/data/$Y
echo
done
chmod 771 /data/data
echo "Restoring accounts.db - reboot will be required"
tar xvf /sdcard/BACKUP/baseline/accounts.tar.gz -C /
There is one limitation that I haven't worked into the script yet. Any time there is an app update you will see a duplicate app in the baseline folder differentiated by -1 or -2. Before recovery you can just get rid of the oldest version of the apk file; the data is always current.
I'm sure that there are a lot of apps that this script would not work with but it does work very well with mine and cuts down recovery to a minute or two. I don't use Titanium Backup myself.
I've been sticking with TWRP 2.1.1, simply because I really like how it can compress backups, meaning more space for music and videos. Haven't had any issues with it, but I do prefer the look of CWRecovery, particularly Hashcode's latest release.

[Q] linux deploy fails when mounting any of the linux OS's

At first I thought it was maybe because I didnt'nt have enough free space on my sd card so I made sure I had 3GB's free but I still got this when I clicked install:
[13:04:26] Updating configuration file ... done
[13:04:27] >>> begin: install
[13:04:27] Checking mount points ... done
[13:04:27] Checking installation path ... done
[13:04:27] Making new disk image (512 MB) ... fail
[13:04:27] <<< end: install
And this when I try to reconfigure:
[13:02:49] Updating configuration file ... done
[13:02:50] >>> begin: configure
[13:02:50] Mounting partitions:
[13:02:50] / ... fail
[13:02:50] <<< end: configure
When I check my root stutus I get this message:
Congratulations! You have root access!
Super User Application Status:
SuperSU application by Chainfire - version 2.36 - is installed!
System File Properties for Root Access:
Standard Location
Check Command: ls -l /system/bin/su:
Result: /system/bin/su: No such file or directory
Analysis: File /system/bin/su does not exist.
Standard Location
Check Command: ls -l /system/xbin/su:
Result: -rwxr-xr-x root root 71264 2014-11-30 16:22 su
Analysis: Root access IS correctly configured for this file! Executing this file can grant root access! Root user ownership is present and setuid attribute is not present.
Alternative Location
Check Command: ls -l /sbin/su:
Result: /sbin/su: Permission denied
Analysis: File system permissions restricted and denied access.
Alternative Location
Check Command: ls -l /system/xbin/sudo:
Result: /system/xbin/sudo: No such file or directory
Analysis: File /system/xbin/sudo does not exist.
Root User ID and Group ID Status:
Root user id:
uid=0(root)
Root group id:
gid=0(root)
System Environment PATH: /sbin /vendor/bin /system/sbin /system/bin /system/xbin
ADB Shell Default User:
ADB shell setting for standard access, stored in default.prop, is configured as: shell (non root) user - ro.secure=1
Results provided on your SM-T800 - Android 4.4.2 device by Root Checker Pro version 1.3.9 from joeykrim in the Android Market
Can anybody tell me why I get this fail message after clicking install?i
Please help
Thank You
AO!
Same issue
Im currently having the same issue with trying to install kali on my tab s. Have root and even sd formated to ext4 but still issues .
Check your SE(Linux) status on Settings / About Device. If it says Enforcing then this is the cause of the problem.
You need to change it to permissive, but you can't do it on a stock rom. You need a kernel with permissive mode
enable or a custom rom with a permissive kernel.
Good Luck
eupeso4 is wrong. You don't need a different kernel. There is an app called SELinuxModeChanger... It works charms
I've attached the app below.
soulcrusher101 said:
eupeso4 is wrong. You don't need a different kernel. There is an app called SELinuxModeChanger... It works charms
I've attached the app below.
Click to expand...
Click to collapse
Also, go to terminal emulator after this.
Code:
su
getenforce
If you get "Enforcing" as a response, it's FUBAR. you can try to run the command "setenforce 0" as su as a workaround but if the app didn't work, it won't likely work either.
Molikai1988 said:
Also, go to terminal emulator after this.
Code:
su
getenforce
If you get "Enforcing" as a response, it's FUBAR. you can try to run the command "setenforce 0" as su as a workaround but if the app didn't work, it won't likely work either.
Click to expand...
Click to collapse
Okay i got enforcing. my deviceis SC-04E thats is S4 (docomo). i want to set SE Linux to premissive tell me the solution
soulcrusher101 said:
eupeso4 is wrong. You don't need a different kernel. There is an app called SELinuxModeChanger... It works charms
I've attached the app below.
Click to expand...
Click to collapse
Doesn't work on stock kernels.
I tried everything. But it doesn't work even after changing the SELinux to permissive., But after searching a lot, I found a thread which said me to change the partition to ext2. I changed the partition and then it all worked like charm.., If you still have issues, follow the guide in this link from start to end-https://github.com/meefik/linuxdeploy/issues/183, This solved most of the issues I had..
Linux Deploy Mounting Partitions Fail
Bro problem solved by me..
Check out this video
https://youtu.be/n5opus76c3k

ADAway and Desire 820n a51_ul Lollipop 5.0.2

Anyone try to install adaway on stock rooted Lollipop ? I think Lollipop ignoring entires in hosts. I've moved hosts file to /data and linked /system/etc/hosts to /data/hosts cuz S-ON and does not block. Why? Entires are corrcet in hosts.
Its about the write protection from the stock kernel. We need a custom kernel, than we can write to the system. With Tomals rom adaway works great. Tomal modified the kernel, so adaway works. And you need to flash busybox from the development section.
Think You write protection in kernel causes ignoring entires in hosts? Every Linux use hosts file. Lollipop does not?
Temporary solution for advanced users only.
CAUTION: I am not responsible if You delete and/or brick Your device!!!
1. Let AdAway create hosts file on /data/ (Preferences->Target hosts file->/data/hosts)
2. Enter recovery, mount /system and /data
3. Plug in your usb cord and open a command line on your pc.
4. Enter adb shell from HTC Sync
5. Type rm /system/etc/hosts
6. Type cp /data/hosts /system/etc/hosts
7. Exit from adb shell, unmount /data and /system
Reboot
To update AdAway hosts file You need to repeat all steps eg. one per week.
Lollipop ignoring symlink to hosts file, I don't know why atm.
Tested on my own 820n.

Disable automatic system updates

Does anybody know of a way to disable the automatic system updates in the watch? (with or without root) I would rather have control over them.
I have found a way to do it after getting some inspiration from a reddit thread.
First connect to your device via ADB.
In order to disable OTA updates, you have to create a dummy update.zip file that cannot be removed or updated by the OS. Execute the following commands (I did it in custom recovery):
adb shell
cd /cache/
echo "" > update.zip
chattr +i update.zip
In order to enable OTA updates, you have remove the immutable flag on the dummy update.zip file and then delete it. Execute the following commands (I did it in custom recovery):
adb shell
cd /cache/
chattr -i update.zip
rm update.zip
i managed to downgrade my HW1 to 1.5 from 2.0
BUT HOW i disable and remove update notification from 1.5 to 2.0???
is the above method can e done ?
https://forum.xda-developers.com/hu...aw-1-5-build-m9e42c-to-downgrade-2-0-t3607859
Please please do you have any video tutorial to explain how to do that
It is very complicated to me and i can't do it

Categories

Resources