Disable New User Creation in Marshmallow - Nexus 9 Q&A, Help & Troubleshooting

I have a rooted Nexus 9 for which I'd like to disable new user account creation (both full access users and guest users). This is prompted by the fact that I cannot figure out how to restore either adb or Titanium app data backups to a non-primary user.
The google led me to an archived thread on disabling new user creation on 5.X lollipop.
On my Nexus 9, running 6.0.1, I can't find the settings.db database that holds the setting to disable guest account creation. I first used adb shell commands and then ES File Explorer to locate the db file, without any success. Any ideas what I'm doing wrong, or is the settings.db no longer stored there?
I also searched reference materials at http://developer.android.com/ for "guest_user_enabled" and didn't find any indication that it had moved.
If there is a better place for this thread, please let me know and/or move it.

Related

[Q] SU as a Service?

Mods, in case this is the wrong forum for this kind of discussion, feel free to move it. I'm a newbie here and the rules are always a bit ambiguous until you get a feel for how that particular community interprets them.
The problem I'm having is this: My phone is rooted and I've written a short application that moves the apk of another application to the SD, replacing it with a dummy file that in turn launches my application.
Moving the data to the SD isn't a problem and neither is moving it back, but informing the OS that it has been moved back is a different matter, as the particular broadcast message needed to inform other applications of the availability is protected by a UID check which will only allow root or system to proceed. While I can spawn a root shell, I haven't found a way to make this shell interact with the Android system, so the broadcast comes from my application which has a non-system UID and is therefoe denied.
I know I could sign my application with the system keys and add it to the shared system UID group, but let's be honest: that's more trouble than it's worth and would require me to re-sign all system applications on any device where I want my little app to run.
So I need a few API calls executed by an application that is already owned by a system user; a mediator which listens for requests from unprivileged applications and, after a user prompt, executes them in its own context.
I'm quite willing to write such a mediator service myself, but I don't want to duplicate work that's already being done... does anybody else know about
a) methods that would make such a mediator unnecessary
b) existing mediator services available on custom ROMs?
Update:
Right now I'm digging through the app_process source code, as it interfaces with the Android runtime from C++, which might allow for executing Android code under the UID of a Linux binary...

[Q] SD CARD fix (KitKat or higher)

I have a question, and if possible the answer should be as wide as possible to work on as many systems as possible. While I am not fully conversed in Android functions, syntax, and interfaces, I have been programing various computers since the mid 80's and have applied rooting/jailbreaking methods to several systems (if it functions like a computer, I want my Admin rights, much thanks to each and all authors of these). I know that someone somewhere out there may have asked and already found a solution to this very annoying problem.
Thanks to the Google's decision to increase security in the Android OSes (KitKat and higher) by removing write access to the SD Card (as I call it a very 'bonehead' and brute force decision), most of the older apps do not work properly anymore with the user added SD Cards and most are not being updated with some form of support (create a folder on SD Card). The solution for most persons is to root the system then either run an app that corrects the problem or install a new LRAM image (Lockable RAM: 'unlock' the RAM and overwrite its data with a new image then re-lock it. I don't like the term 'ROM' for this as it has been incorrectly used since the late 80's). I have found at least 2 file managers that say they have a (in-app) solution, but these solutions don't extend to all of your other apps (ie "Root Explorer" or "B1" solution doesn't help your File server/uTorrent/Photo Gallery app).
But what of the owners that for one reason or another can't root their system (unable to root, not authorized or allowed to root, etc.) but want/need to have write access to the user added cards (mainly because their internal storage is just too small)? Example, in my case my personal phone has several apps that require it to remain in an unrooted state for certain work related programs (security issues).
So here is my question:
Is it possible, on an unrooted and stock LRAM android device, using ADB to PULL the "platform.xml" file, add the line '<group gid=”media_rw” />' to it, then PUSH the edited file back to the android device?
I realize this may require entering (various name versions) Recovery or Update mode which is specific to each device (I think Samsung calls their ODIN). But I think the ADB commands and computer side instructions should be the same. So if it is possible, please list all ADB instructions (I know the text editor used will depend on the PC/MAC OS used).
Thank you one and all that give any advice or assistance.
Well it looks like there have been a lot of lookers since I first posted this but still no reply by anyone that knows Android OS inside and out. Most of you are probably thinking "tl:dr" to all of it.
I know there has to be a way to update/upgrade system files that doesn't require rooting or a way to find the manufacturer's or cellular vender's access path or password.

Chrome: How to safely clone the set of open tabs from one device to another in bulk?

If I get a new phone and want to make Chrome run exactly as I left it on my old phone, cloning/restoring the set of open tabs seems to be complicated.
Note: Let's assume Chrome version 46 and Android 6 (Marshmallow) to be somewhat modern with respect to versions in this Q&A
Here's why:
I don't want to do a full Titanium Backup restore of all Chrome data because I think this is unsafe from some past experience. Chrome's data contains some elements that are specific to the instance of chrome on a given device that I think are primarily used to control synchronization and perhaps also cloud printing.
You can see here that the files in /data/data/com.android.chrome/app_tabs seems to be critical, especially ....../app_tabs/0/tab_state
But restoring the app_tabs folder alone does not seem to work. The browser does not become aware of the tabs
Sadly, there is no in-app way to restore tabs in bulk from one Chrome instance on device A to another chrome instance on device B on Android. You can tap on the clock icon (or select "recent tabs" from the menu) to see tabs open on other devices, but you cannot restore a set of them in bulk as you can on Chrome for the desktop. In addition, this approach would be further hindered by this bug.
Any ideas?
I was able to get this to work on Android 7.1.2 using Chrome 58.
Here are the steps I used (as root):
1) Use Titanium Backup to "Freeze" Chrome so that it cannot interfere with what you are about to do while things are in progress
2) Copy over the contents of /data/data/com.android.chrome/app_tabs/0/ to your new device (this is the state of all tabs)
3) Correct the file permissions for everything in this folder to "-rw-------" (that's "u=rw,g=,o=" using chmod)
4) Correct owner/group for everything in this folder to be the correct user for the Chrome app on this specific device by running "chown XXX.XXX *" where XXX is that user
5) Correct the selinux context for everything in this folder using "chcon" by running "chcon YYY *" where YYY is that context. You can see this by running "ls -lZ" on other files owned by Chrome
6) Repeat the steps above for everything in /data/data/com.android.chrome/app_textures/ so that you also restore the tab thumbnail images
7) Unfreeze chrome

rooted phone user changes & dir permissions

Is there a way, once rooting is done, and i have customized my phone a bit (a change in one of the config files of linux), to change the user accounts and permissions? To create a new user account and change the user that is used by the phone to be a non-root, non-sudo, standard user. And all apps to use this or another standard user account.
And my app (that i installed after rooting) use another account. Only this account will have permission to read and write my app's directory.
Finally change the root user password, so that others cannot get into it unless they have that password.
So in effect protect my apps directory and allow the phone to work with a non sudo user from then on?
Next time phone re boots it uses another user say A (non sudo); without access to my apps directory. And when my app runs it uses user B (also non sudo) which has access to its dir. Others cannot read or list files in it or change permissions. So in effect my apps directory cannot be read by the user of the phone, in this new set up. I understand there will be ways around this.
But is this possible and how?
Rooted using https://forum.xda-developers.com/android/general/root-samsung-galaxy-on5-t3435457 but i can do systemless root if that is the way.
Phone model : Samsung On 5 Pro SM-G5550FY. Thank you much.

how to backup user Minecraft worlds stored in App-specific storage?

Hi folks, I am a computer programmer, but NOT for Android. So although I've used adb on my Linux box before to install different Android images onto my phone, I have only a shallow understanding of how Android actually works. I'm hoping you can give me advice...
Short version of the question:
By default, the Minecraft android app stores its user game data ("worlds") in Android "App-specific storage". How can I backup that user data, and move it to a new device? The best online resources I could find recommend copying the data via "adb backup", something like so:
Code:
adb shell pm path com.mojang.minecraftpe
adb shell am force-stop com.mojang.minecraftpe
adb shell am start com.mojang.minecraftpe/.MainActivity
adb backup -noapk com.mojang.minecraftpe
java -jar abe.jar unpack backup.ab mc.tar
However, when I do that, the output "backup.ab" file is tiny, only 47 bytes long. Clearly it is NOT finding any of the actual data (many MBs) in the com.mojang.minecraftpe App-specific storage. Am I doing something wrong? How else should I try to get a copy of that data?
I've never rooted a phone, and I don't know if rooting would help with this problem or not.
Long version of the question:
My kids are big fans of Minecraft Bedrock Edition (aka Pocket Edition), which they play on their Android devices, currently older Google Pixel 3a phones running stock Android 11. They have created dozens of Minecraft worlds on their phones, using the default settings the app came with.
The Minecraft app, as I recently learned, has TWO choices for where it stores the user's worlds. This this its "File Storage Location" setting, which is global for the whole app. The choices are either "External" or "Application". Now, if you choose External BEFORE creating any worlds, all should be well, your data is stored in a normal folder and to backup, you simply copy the files off the phone the normal way.
But in Minecraft, the default File Storage Location is "Application", which is what Android calls "App-specific storage":
https://developer.android.com/training/data-storage
Worse, once you have world data saved in the App-specific storage, the Minecraft app gives you NO WAY to copy it anywhere else! Really, no joke. When you upgrade to a newer phone, and connect your two phones with a USB cable, the normal Android "Copy Apps and Data" process does NOT copy ANY of the Minecraft game worlds the user created! So Mojang/Microsoft, in their wisdom, have made it essentially IMPOSSIBLE for anyone to backup their own game data, or to move it to a newer device, if you used the default File Storage Location = "Application".
I see that Android includes standard APIs for backing up and restoring user data, but apparently Minecraft never uses any of that:
https://developer.android.com/guide/topics/data/backup
In older versions of the Minecraft app, there was a UI widget to change the storage location of individual worlds, one at time. But at least as of Minecraft version 1.19.71.02, that no longer exists. Mojang silently removed it at some point, probably long ago. Mojang's bug tracker has lots of user-entered bugs about this (often confusingly written), but they seem to have no intention of ever doing anything to fix the problem. E.g.:
https://bugs.mojang.com/browse/MCPE-136918
There is no 'File storage location' option in my game
Mojang officially supports only ONE way of moving those worlds to a new device. Basically, paying them a monthly subscription to their "Realms" servers, uplading each of your worlds to a Realm server, and then downloading each one to your new device. This may be the way to go but I have not tried it yet:
https://help.minecraft.net/hc/en-us/articles/4409165790605#h_01FG9YRQBDPNJ8JYNKVGXK04FX
Managing Data and Game Storage in Minecraft
I've tried using "adb backup -noapk com.mojang.minecraftpe" to copy the data (see above), but it never works for me. I'm doing this on Linux, Ubuntu 22.04.2 LTS (jammy), which reports:
$ adb --version
Android Debug Bridge version 1.0.41
Version 28.0.2-debian
Installed as /usr/lib/android-sdk/platform-tools/adb
I don't know if I'm doing something wrong with adb, something has changed in Android such that this can no longer work correctly, what.
Do you have any advice on what else I should try to copy the data?
Thanks for your help!
I found some external discussions which give likely reasons WHY adb backup isn't working for me:
Does adb backup/restore still work because it says it's deprecated?
I want to reset my phone but want to recover the system data before doing so. I tried to create a backup with adb and tried to restore it on a virtual device to see if it works. So I tried to resto...
android.stackexchange.com
How to pull non-debuggable app user data on a non-rooted device (with a broken screen!)
I recently broke my Pixel 3a's screen and I've bought a replacement. Almost everything's ported over, except for some key app data that I want if at all possible. The Google backup didn't work, ADB
android.stackexchange.com
Behavior changes: Apps targeting Android 12 | Android Developers
Learn about changes in Android 12 that will affect apps when they target Android 12.
developer.android.com
E.g.:
For apps that target Android 12 (API level 31) or higher, when a user runs the adb backup command, app data is excluded from any other system data that is exported from the device.
Click to expand...
Click to collapse
I also heard from "Tikolu", creator of the Minecraft World Exporter tool:
MCPE WorldExporter by Tikolu
WorldExporter allows you to export worlds from Minecraft Pocket Edition if your Storage Type is set to Application in Minecraft Settings.
tikolu.net
GitHub - Tikolu/WorldExporter: Minecraft Pocket Edition World Exporter
Minecraft Pocket Edition World Exporter. Contribute to Tikolu/WorldExporter development by creating an account on GitHub.
github.com
Tikolu reports that "adb backup" worked well 5 years ago, but has gotten "very glitchy and unreliable" since then, especially on newer phones.

Categories

Resources