Stop Android OS auto-update - android

We have a variety of devices for testing purposes, and now that Froyo is being pushed (to the Nexus One so far at least), we have to constantly dismiss upgrade requests. There is no apparent "stop asking me" button.
So, is there any way I can disable OTA OS updates? We want a number of these phones to stay on old OS versions.

Remove SystemUpdater.apk from /system/app. From terminal (with ADB)
adb pull /system/app/SystemUpdater.apk C:/Path/to/your/desktop //Backup the file (just in case)
adb remount //Remount the system partition to read-write
adb shell rm /system/app/SystemUpdater.apk //Remove the apk
Warning - this will permanently disable system updates, until you push SystemUpdater back to /system/app

For XOOM running android 3 honeycomb. You have to remove Upgrader.apk (not SystemUpdater).
adb pull /system/app/Upgrader.apk C:/Path/to/your/desktop //Backup the file (just in case)
adb remount //Remount the system partition to read-write
adb shell rm /system/app/Upgrader.apk //Remove the apk

From ADB with root access:
adb shell pm disable com.google.android.systemupdater
Not need delete apk.

I have a very old Lenovo Yoga 2 1050F tablet, Android 5.0.1(Lollipop). Today year 2020 it made an unexpected OTA firmware download. After downloading a file reboot gives a signature error which may relate to my root and half broken recovery boot app. This is how I disabled a system update
adb devices | adb shell | su | pm disable com.lenovo.ota

Related

Can't set android package as system app on my phone

Hello I have 2 Phones 1 it's work on it and the other not
am trying to make Android Package as system \
$ adb shell
$ mv /sdcard/base.apk /system/app/
$ cd /system/app/
$ chmod 644 base.apk
also tryed
$ adb shell am start com.****
didn't work
it's work fine
but in the other phone oppo 1201 Color os App never show app i tryed different launchers didn't work
can please some one told me why this dumb phone wont show apk as system or there system linker verify those applications !
Oppo runs Color OS which is heavily customised over android. It has a lot of restrictions compared to stock android, Oppo only has read access over its system partition. So you might need root access to move files into a system folder. Consider rooting your phone if you really want to do this.

adb missing in marshmallow device

Basically, I am trying to use
adb backup -all -f /sdcard/some_folder/some_file_name.ab
ques 1. why adb is removed in marshmallow devices.
ques 2. what is the worked around for using adb related commands in devices with 6.0 and greater versions.
I am trying to fire adb command from terminal inside an android device link
Marshmallow device not showing adb file in /system/bin
JellyBean device showing adb file in /system/bin

Unable to run app - "The target device does not support the 'run-as' command"

Running Android Studio on a Macbook for the first time and I'm getting this error. The program does not start on my device, I just get a crash message.
On Android Studio, I get "The target device does not support the 'run-as' command" and when I plug this into google I get no results. I get a "Learn More" section though which points to this link under the heading "About Instant Run": https://developer.android.com/studio/run/index.html?utm_medium=android-studio#instant-run.
Any suggestions would be highly appreciated.
I recently upgraded to AS 2.2 and this message suddenly appeared today.
Restarting Studio caused this message to disappear.
But the build in general seemed slow - so I used the adb commands to stop and start the server and now it seems Instant run is working better
adb kill-server
adb start-server
my phone is Moto G x1032 w lollipop
I had this same problem after rooting my device and the other answer didn't solve it.
When I ran adb run-as command in the terminal I kept getting
Could not set Capabilities: operation not permitted.
It's a permissions issue. You have to change permissions on run-as file in /system/bin folder. This solved it for me (needs root access):
1. remount /system rw
2. chmod 4750 /system/bin/run-as
3. remount /system ro
If running custom recovery:
1. reboot to recovery
2. find the mount system and check it (make sure 'mount system as read-only' is unchecked)
3. open a terminal and type: adb shell
4. type: chmod 4750 /system/bin/run-as
5. uncheck the System mount and reboot!
See here issue 58373: https://code.google.com/p/android/issues/detail?id=58373

adb shell su works but adb root does not

I rooted my unlocked Galaxy S3 (SGH-T999)
Now, I'm trying to run adb root from Windows Command Prompt, however, I'm getting adbd cannot run as root in production builds error. So, the very first thing I checked was whether my phone was really rooted?
So I tried the following:
Open Command prompt
$adb devices // lists my device
$adb shell //goes to shell
$su // opens a 'SuperSu' prompt on my phone and I 'Grant' permission
# // Before following the rooting instructions, I was getting 'no su command found' in the previous step. So, I believe my phone is ROOTED. **Correct me if I'm wrong.**
However, when I do adb root, I get adbd cannot run as root in production builds error.
So, I thought, I might have to do some additional stuff beyond what I did above. I tried all the solutions in the following SO questions:
Launch a script as root through ADB
adb remount permission denied, but able to access super user in shell -- android
Unable to run 'adb root' on a rooted Android phone
None of the above worked for me. All they do is give the ROOT access INSIDE of SHELL. I want adb root to work so that I can execute various adb commands WITHOUT going into shell.
By design adb root command works in development builds only (i.e. eng and userdebug which have ro.debuggable=1 by default). So to enable the adb root command on your otherwise rooted device just add the ro.debuggable=1 line to one of the following files:
/system/build.prop
/system/default.prop
/data/local.prop
If you want adb shell to start as root by default - then add ro.secure=0 as well.
Alternatively you could use modified adbd binary (which does not check for ro.debuggable)
From https://android.googlesource.com/platform/system/core/+/master/adb/daemon/main.cpp
#if defined(ALLOW_ADBD_ROOT)
// The properties that affect `adb root` and `adb unroot` are ro.secure and
// ro.debuggable. In this context the names don't make the expected behavior
// particularly obvious.
//
// ro.debuggable:
// Allowed to become root, but not necessarily the default. Set to 1 on
// eng and userdebug builds.
//
// ro.secure:
// Drop privileges by default. Set to 1 on userdebug and user builds.
In some developer-friendly ROMs you could just enable Root Access in Settings > Developer option > Root access. After that adb root becomes available. Unfortunately it does not work for most stock ROMs on the market.
I ran into this issue when trying to root the emulator, I found out it was because I was running the Nexus 5x emulator which had Google Play on it. Created a different emulator that didn't have google play and adb root will root the device for you. Hope this helps someone.
I use for enter su mode in abd shell
adb shell "su"
I have a rooted Samsung Galaxy Trend Plus (GT-S7580).
Running 'adb root' gives me the same 'adbd cannot run as root in production builds' error.
For devices that have Developer Options -> Root access, choose "ADB only" to provide adb root access to the device (as suggested by NgaNguyenDuy).
Then try to run the command as per the solution at Launch a script as root through ADB.
In my case, I just wanted to run the 'netcfg rndis0 dhcp' command, and I did it this way:
adb shell "su -c netcfg rndis0 dhcp"
Please check whether you are making any mistakes while running it this way.
If it still does not work, check whether you rooted the device correctly.
If still no luck, try installing a custom ROM such as Cyanogen Mod in order for 'adb root' to work.
You need to replace the adbd binary in the boot.img/sbin/ folder to one that is su capable. You will also have to make some default.prop edits too.
Samsung seems to make this more difficult than other vendors. I have some adbd binaries you can try but it will require the knowledge of de-compiling and re-compiling the boot.img with the new binary. Also, if you have a locked bootloader... this is not gonna happen.
Also Chainfire has an app that will grant adbd root permission in the play store: https://play.google.com/store/apps/details?id=eu.chainfire.adbd&hl=en
Lastly, if you are trying to write a windows script with SU permissions you can do this buy using the following command style... However, you will at least need to grant (on the phone) SU permissions the frist time its ran...
adb shell "su -c ls" <-list working directory with su rights.
adb shell "su -c echo anytext > /data/test.file"
These are just some examples. If you state specifically what you are trying to accomplish I may be able to give more specific advice
-scosler
adbd has a compilation flag/option to enable root access: ALLOW_ADBD_ROOT=1.
Up to Android 9: If adbd on your device is compiled without that flag, it will always drop privileges when starting up and thus "adb root" will not help at all.
I had to patch the calls to setuid(), setgid(), setgroups() and the capability drops out of the binary myself to get a permanently rooted adbd on my ebook reader.
With Android 10 this changed; when the phone/tablet is unlocked (ro.boot.verifiedbootstate == "orange"), then adb root mode is possible in any case.
If you really need to have ADB running as root, the quickest and easiest way is to install Android Custom ROMs and the most popular is CyanogenMod for it has the Root Access options in developer options menu where you can choose to give root access to apps and ADB. I used CM before but since it wasn't developed anymore, I tried looking for some solutions out there. Although CyanogenMod is still a good alternative because it does not have bloatware.
One alternative I found out from a friend is using adbd insecure app which you could try from here: https://forum.xda-developers.com/showthread.php?t=1687590. In my case, it works perferct with an Android custom kernel, but not with the Android stock ROM (vanilla android only). You may try other alternatives too like modifying boot.img of the Android ROM.
in my case, ( device is rooted )
linux$ adb shell # in linux shell
mobile$ su root #=> notice the $ will become #
mobile# whoami #=> root
if you installed "adb root" module in Magisk, you still have to manually switch to root by su root, otherwise, it just LOOKS LIKE you are root, but actually you are NOT root.
I have a Samsung Galaxy Tab S2 running Android 7.0.
Here's how I rooted it today:
Root the device using Odin
Read Alex P.'s answer in this thread regarding editing system\build.prop file.
download onto your tablet: v1.3.9 System Tools Android: All-In-One toolbox
run the app; under "System Utilities" confirm your Odin root worked using "Root Check"
in the same app goto "Root Manager" and use the "Build.prop editor" to effect the changes in the system\build.prop (as specified by Alex P.).
Final Confirmation:
C:\Android\sdk\platform-tools>adb shell
gts28vewifi:/ $ whoami
shell
gts28vewifi:/ $ su
gts28vewifi:/ # su root
gts28vewifi:/ # whoami
root
Upvote Alex P.'s answer.
Further info
and here
and here too
Root Access in Windows Command: adb shell su
Root Access in MacOS Command: ./adb shell su

Android: Difference between User vs System App development [duplicate]

I need create my app as system, because i need get permission android.permission.WRITE_SECURE_SETTINGS.
After install to virtual device (Eclipse) my app appears in '/data/app'. I try manually move him to '/system/app', set rights 644, but when i launch my app - toast 'App isn't installed'. After reboot (close virtual device and restart) my app disappeared from '/system/app'.
Add:
- 1. Why android can not see my application in '/system/app'?
- 2. Why after restart virtual device my app disappeared from '/system/app'?
What the best way make my app system on Eclipse Emulator and real devices?
The apps installed on your Android devices can be broadly categorized as system apps or user apps, based on their installation location. The user apps are just all your normal app installations through the Google Play Store, Amazon Appstore or sideloading. These go into the /data partition of your Android phone, which is the part of the internal memory made available for user data and apps.
System apps are basically the apps that come pre-installed with your ROM. In a standard Android user environment, the user doesn’t have write access to the /system partition and thus, installing or uninstalling system apps directly isn’t possible. The process isn’t as hard as it may sound. However, there is a catch.
In order to install an app as a system app on your Android device, your device must either be rooted, or have a custom recovery installed (or both). Usually pretty much everyone who has a custom recovery installed uses a rooted ROM, so we’ll just be using the method for rooted phones.
Go to below tutorial.it might help you.
Make Your app System App
You cannot make your app by default as the system app. There are some other ways though through which you could make other normal apps as system apps on rooted phones.
You can install an APK to /system/app with following steps.
Push APK to SD card.
$ adb push SecureSetting.apk /sdcard/
Enter the console and get the shell
$ adb shell
Switch to superuser. If your device is not rooted, get it rooted first. (If you don't know how to do that, just Google.)
$ su
Remount the system partition with WRITE permission.
$ mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Cat your APK from /sdcard/ to /system/ , some guys get a fail with cp command due to cp is not supported. So use cat instead.
$ cat /sdcard/SecureSetting.apk > /system/app/SecureSetting.apk
Remout /system partition back to READ-ONLY, and exit
$ mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
$ exit
Then reboot your device, the APK should have been installed on /system/app.
As stated here.
You can't make an application as system app on emulator.But you can make an app as system app on device.For that, you need to have the git repo set up on your pc,and after setting up repo, copy the app folder in repo folder/packages/apps and put it for compile.and you will get system.img in out folder of repo.Then you can flash the system.img on sd card, so that you will get your app as a system app.And this is the only way is there to make an app as system app.
If the device is not rooted, you cannot copy anything to the System or Data partitions.
With root do the following commands in a command prompt or linux shell and all should be fine:
adb push fileName /data/local/tmp
adb shell
su
mount -o remount, rw /system
cp /data/local/tmp/fileName /system/folderOfYourChoise
chmod 644 (if its an apk and you want the system to use it as a system app)
exit (exits the su shell)
exit (exits the adb shell)
adb reboot (to apply and see changes on the device)

Categories

Resources