Related
Hello everyone,
I'm writing an android application that needs to swap between 2G/3G networks.
I wasn't able to find any suitable function in the SDK documentation.
I tried "digging" into the android code to see how other activities (such as Settings.ACTION_WIRELESS_SETTINGS, the Phone Information technician code [*#*#4636#*#*]) implement it and came across com.android.internal.telephony.Phone which is in charge of the switching.
I guess the device has to be rooted to perform this (and of course, my application needs root privileges), however, I can't change the android code on the device.
So, my question is: How do I access com.android.internal.telephony.Phone from my application without changing the android code?
Many thanks,
Omri.
Anyone has an idea?
Thank you
CDMA or GSM?
And a lot of the telephony is private.
Sent from my iPhone with the bigger GeeBees.
I have good news: I got it working and I wanted to share on how.
I had a few problems on the way, but I faced them all.
First of all, being able to access com.android.internal.* from the SDK (with ADT) wasn't that comfortable before I ran into this guide, which lets you include all the hidden & internal APIs in your android.jar library and override the access rules limiting you not to access them in ADT.
After that was done, I thought I'm done, but I was wrong.
To switch from 2G to 3G you need to invoke setPreferredNetworkType() method on the Phone object (com.android.internal.telephony).
To get the Phone object, you'll need to invoke the getDefaultPhone() method on PhoneFactory (com.android.internal.telephony).
But, of course, nothing will be simple, this method only runs when your manifest inclues android:sharedUserId="android.uid.system" (aka, your process runs as system user).
Your process won't be able to run with the android.uid.system UID without your package being signed with the platform certificate.
To sign your package with the platform certificate, you need signapk.jar, platform certificate (platform.x509.pem) and platform key (platform.pk8).
Because I'm using CyanogenMod I was able to put my hands on the platform cert&key pair without recompiling android. (available here)
Once you have these, the rest is pretty simple:
Sign your APK with signapk.jar:
Code:
java -jar signapk.jar platform.x509.pem platform.pk8 Application.apk Application-signed.apk
Because this is a system package, you won't be able to install it with "adb install Application.apk", we'll have to use a different method.
Upload your APK to the /system/app folder (don't forget to mount /system for read-write before you do that):
Code:
adb push Application-signed.apk /system/app/Application.apk
The next thing to do is launch your activity:
Code:
adb shell am start -a android.intent.action.MAIN -n com.your.package/.YourActivity
That's it!
You got it working!
Good luck to whoever runs into this post
Cheers,
Omri.
Parts of a ROM
i. The kernel.
Android (like many other Smartphone operating systems) runs on the Linux kernel. The Linux kernel was created in the early 1990’s by a gentleman named Linus Torvalds in Helsinki, Finland. It’s incredibly stable, incredibly friendly, and incredibly difficult for the layman to understand and modify. Thankfully it’s also very popular so it has been ported on to a multitude of hardware, including our Android devices.
Think of the kernel as an interface layer between the hardware and software on your device. The kernel decides when things happen, such as the LED indicator gets lit or when the soft button's LED gets lit. An application sends a request to the operating system to blink the LED. The operating system then sends the request to the kernel, which makes the light flash for the amount of time requested by the OS.
What sounds like a round-about way to get things done is also what makes the system so scalable and robust. Application developers only have to code in a way the operating system understands and the kernel makes it work on the hardware. This also keeps the application running in it’s own user-space and separate from the kernel. That means when you run the latest uber-cool app that wasn’t designed for your particular OS version, or is still very beta and it crashes, the kernel gives you the option to Force Close the application and the kernel can run untouched.
In a standard Android ROM (we will leave developer images and the like for another discussion) the kernel is bundled along with a set of instructions that tell the device how to load the kernel and the OS during boot. This is the boot.img that you see inside a zipped ROM that your not able to easily open. The device knows to extract this image to internal memory (the ramdisk) and follow a series of scripts (init scripts) to load the kernel and then the other portions of the OS. That’s what’s happening while you’re watching the boot animation. Interestingly enough this is done the same way for a PC, your smartphone, an Android tablet, or even a smart Linux powered toaster. If you’re feeling exceptionally geeky, plug your Android phone into the USB port on your PC and let the PC boot from the USB device. No, it doesn’t actually load, but you can watch the animation while it tries to match up the hardware support with what’s inside your PC. As I said, Linux is amazingly scalable and as a result so is Android.
What is a kernel? If you spend any time reading Android forums, blogs, how-to posts or online discussion you'll soon hear people talking about the kernel. A kernel isn't something unique to Android -- iOS and MacOS have one, Windows has one, BlackBerry's QNX has one, in fact all high level operating systems have one. The one we're interested in is Linux, as it's the one Android uses. Let's try to break down what it is and what it does.
Android devices use the Linux kernel, but it's not the exact same kernel other Linux-based operating systems use. There's a lot of Android specific code built in, and Google's Android kernel maintainers have their work cut out for them. OEMs have to contribute as well, because they need to develop hardware drivers for the parts they're using for the kernel version they're using. This is why it takes a while for independent Android developers and hackers to port new versions to older devices and get everything working. Drivers written to work with the Gingerbread kernel on a phone won't necessarily work with the Ice Cream Sandwich kernel. And that's important, because one of the kernel's main functions is to control the hardware. It's a whole lot of source code, with more options while building it than you can imagine, but in the end it's just the intermediary between the hardware and the software.
When software needs the hardware to do anything, it sends a request to the kernel. And when we say anything, we mean anything. From the brightness of the screen, to the volume level, to initiating a call through the radio, even what's drawn on the display is ultimately controlled by the kernel. For example -- when you tap the search button on your phone, you tell the software to open the search application. What happens is that you touched a certain point on the digitizer, which tells the software that you've touched the screen at those coordinates. The software knows that when that particular spot is touched, the search dialog is supposed to open. The kernel is what tells the digitizer to look (or listen, events are "listened" for) for touches, helps figure out where you touched, and tells the system you touched it. In turn, when the system receives a touch event at a specific point from the kernel (through the driver) it knows what to draw on your screen. Both the hardware and the software communicate both ways with the kernel, and that's how your phone knows when to do something. Input from one side is sent as output to the other, whether it's you playing Angry Birds, or connecting to your car's Bluetooth.
It sounds complicated, and it is. But it's also pretty standard computer logic -- there's an action of some sort generated for every event. Without the kernel to accept and send information, developers would have to write code for every single event for every single piece of hardware in your device. With the kernel, all they have to do is communicate with it through the Android system API's, and hardware developers only have to make the device hardware communicate with the kernel. The good thing is that you don't need to know exactly how or why the kernel does what it does, just understanding that it's the go-between from software to hardware gives you a pretty good grasp of what's happening under the glass. Sort of gives a whole new outlook towards those fellows who stay up all night to work on kernels for your phone, doesn't it?
Click to expand...
Click to collapse
ii. The operating system.
Once the kernel is loaded, the init scripts tell the Operating System to load. Android is the user interface for a custom built Java virtual machine called Dalvik. Dalvik was written by Dan Bornstein, who named it after the fishing village of Dalvik in Iceland, where his family originated from. The debate of which Java VM is superior is best left for another discussion, so I’ll simply say that DalvikVM is a register-based machine versus true JavaVMs which are stack based.
The Dalvik machine creates executable files (.dex files) which can be interpreted by the OS and run by the end user. These .dex files are OS version dependant. That simply means that applications and core functions built to work with one version of Android may or may not work well with other versions. Google provides the tools through it’s Software Development Kit (SDK) for applications to communicate with the OS.
Click to expand...
Click to collapse
iii. Core functions.
No smartphone would be complete without a set of functions that allow the device to be used as intended. Things like the phone and dialer interface, the calendar, the messaging system are core functions of the Operating System. In Android, these are run on top of the kernel as separate applications. The merits (or lack of) of providing these needed functions as separate applications is once again best left for another discussion, but this is what allows developers like HTC or Motorola to replace the standard functions with alternatives that provide a different look and feel from stock. HTC’s onscreen keyboard or Motorola’s MotoBlur contact list are great examples of this. The “little guy” isn’t left out of the mix either. Handcent SMS or Chomp SMS can integrate into the OS very well, as most of us already know.
An additional set of Core Functions are provided by Google. Popularly called GoogleBits, things like Gmail, sync, Gtalk and the Android Market are applications written by Google that give an extra set of useful functions to the OS. You’ll find these on all smartphones, as well as many other Android devices.
Click to expand...
Click to collapse
iv. Optional applications.
These are applications provided by the manufacturer to give the device even more usability. Things like the Amazon MP3 store, PDF readers, Corporate Calendar etc. allow you to do even more with your device. Remember - Droid Does
Click to expand...
Click to collapse
B. How is a ROM packaged?
In most cases a ROM will come packaged in a .zip file. The recovery image’s kernel (yes, it has one too!) has the ability to unzip and copy the contents into the correct place. Inside this zip file is a folder (META-INF\com\google\android\) that contains a script prepared by the ROM “cooker” (another of those techie terms - it means the person(s) who developed the ROM) that tells the system what to format, what to copy and where, and any file operations that need to be done. Each device does things a bit differently, but this script is where it all gets done. More on this folder later.
You’ll also see a /system folder. This is the meat of the ROM. It has the necessary OS files, the Core functions, and any optional applications the cooker decided to include. The folder is structured the same way it is on your device - /system/app, /system/framework, etc. The whole tree is usually copied over and the existing /system folder is overwritten. The cooker uses the script to tell the kernel to erase the existing system folder, copy the new folder over, and set the file permissions.
Sometimes you will also see a data folder. This usually is space set up for optional applications, including optional system tools like busybox or SuperUser white list. These applications could be placed in the /system folder, but placing them in the data folder makes it easier for the end user (you and I) to remove or update them as needed.
You’ll also notice a META-INF folder. This contains the update script we talked about earlier, as well as secure keys that need to be provided so the device knows the update can be trusted. A special note needs made here. Trusted means that the update is trusted to be in the correct form to load the device. It in no way means the ROM is safe from malicious code. Anyone is able to use a set of test keys and create a ROM that will flash and run your device - even those people with bad intentions. Flashing and running a custom 3rd party ROM is putting faith in the cooker that he or she not only knows what they are doing, but are honest as well. Also, some Motorola custom ROMs will have a small update.zip stored inside this folder to be run on first boot of the device.
Finally we are left with the boot.img file. This is the kernel and ramdisk image we discussed earlier. Your phone copies this over to be decompressed and run when the device boots.
Click to expand...
Click to collapse
2. How do I install a ROM?
In this section we’re discussing how to install a custom 3rd party ROM. ROMs from the manufacturer usually have a utility that runs on your PC to flash and load the new image.
A. Got Root???
What is Root?
Android rooting is the process of allowing users of smartphones, tablets, and other devices running the Android mobile operating system to attain privileged control (known as "root access") within Android's subsystem.
Rooting is often performed with the goal of overcoming limitations that carriers and hardware manufacturers put on some devices, resulting in the ability to alter or replace system applications and settings, run specialized apps that require administrator-level permissions, or perform other operations that are otherwise inaccessible to a normal Android user. On Android, rooting can also facilitate the complete removal and replacement of the device's operating system, usually with a more recent release of its current operating system.
As Android derives from the Linux kernel, rooting an Android device is similar to accessing administrative permissions on Linux or any other Unix-like operating system such as FreeBSD or OS X.
The process of rooting varies widely by device, but usually includes exploiting a security bug(s) in the firmware (i.e. in Android) of the device, and then copying the su binary to a location in the current process's PATH (e.g. /system/xbin/su) and granting it executable permissions with the chmod command. A supervisor application like SuperUser or SuperSU can regulate and log elevated permission requests from other applications. Many guides, tutorials, and automatic processes exist for popular Android devices facilitating a fast and easy rooting process.
For example, shortly after the HTC Dream was released, it was quickly discovered that anything typed using the keyboard was being interpreted as a command in a privileged (root) shell. Although Google quickly released a patch to fix this, a signed image of the old firmware leaked, which gave users the ability to downgrade and use the original exploit to gain root access. Once an exploit is discovered, a custom recovery image that skips the digital signature check of a firmware update package can be flashed. In turn, using the custom recovery, a modified firmware update can be installed that typically includes the utilities (for example the Superuser app) needed to run apps as root.
The Google-branded Android phones, the Nexus One, Nexus S, Galaxy Nexus and Nexus 4, as well as their tablet counterparts, the Nexus 7 and Nexus 10, can be boot-loader unlocked by simply connecting the device to a computer while in boot-loader mode and running the Fastboot program with the command "fastboot oem unlock".[9] After accepting a warning, the boot-loader is unlocked, so a new system image can be written directly to flash without the need for an exploit.
Recently, Motorola, LG Electronics and HTC added security features to their devices at the hardware level in an attempt to prevent users from rooting retail Android devices.[citation needed] For instance, the Motorola Droid X has a security boot-loader that puts the phone in "recovery mode" if a user loads unsigned firmware onto the device, and the Samsung Galaxy S II displays a yellow triangle indicator if the device firmware has been modified.
Click to expand...
Click to collapse
Yes ?:good:!!!
Custom ROM’s simply will not load on devices that aren’t rooted. In theory, it may be possible to sign a 3rd party ROM with the keys that the stock recovery image will flash, but for the most part you need to have flashed a custom recovery image before you can change your device’s ROM. Instructions and tutorials on how to root your device are all over the internet. Some are good, some are bad. The hacking forum is a great place to go and learn more about rooting and how to successfully get it done on your device.
Click to expand...
Click to collapse
B. Recovery
Most Android devices have had a custom recovery image written for them. This will overwrite the stock recovery image, allowing you to flash 3rd party ROMs as well as giving extra functionality. Help with finding and flashing the custom recovery image for your device can also be found in the hacking forum. The installation of a custom recovery image also allows for a very important function. Backup and restore.
Click to expand...
Click to collapse
.C. Nandroid
Nandroid is a set of bash scripts and code written by that copies the state of your system and stores it in a folder on your SD card. You can then use the restore function of Nandroid to restore to this point at any time. This is a priceless feature and reason enough to root your phone. It’s included by default in most custom recovery images, and the code is freely available to use if you’re inclined to write your own recovery image.
Click to expand...
Click to collapse
In most situations, using Nandroid to back everything up is easy:
1. Verify you have a memory card with enough free space (~300MB to backup, ~500MB to restore).
2. Reboot your device into recovery. It’s slightly different for each device, once again hacking forum FTW!
3. Navigate through the menu and select the Nandroid Backup function.
4. Apply your choice and wait for the device to tell you it’s finished.
It’s always good practice to copy the entire nandroid folder from your SD card to a safe place. You can then copy it back to the SD card if the card is ever damaged, lost or erased.
D. Copy and Flash
You’re rooted, have downloaded a custom ROM, have your system backed up and are now ready to flash your device. This is not nearly as scary as it sounds.
1. Mount your SD card to your PC, and copy the .zip file to the root folder of the card. Don’t unzip the file, and don’t look for a folder called root. The root folder in this case means the base folder, what you will see when you mount your card to a PC or the device.
2. Reboot your phone into recovery.
3. Navigate through the recovery menu and select the flash update option. Depending on your recovery image, the file may need to be named update.zip, or you may be able to select any zip file on your card as long as it’s the correct format. The cooker knows this as well and if the ROM needs to be named update.zip it will be.
4. Apply your choice and wait for your device to tell you it’s finished.
5. Reboot.
Click to expand...
Click to collapse
It’s worth noting that many times a new ROM will require that you wipe and factory reset your devices data. While inconvenient, it’s often necessary to get rid of the old data as it may be incompatible. As long as you’re using the cloud for calendar and contacts, they will be re- downloaded and stored back on your device automatically.
Dirty flash and Clean flash
A dirty flash is only wiping cache and davlik then flashing your ROM....
a Clean flash is at LEAST factory reset/data wipe + wiping davlik(factory wipe takes care of /cache also)... Maybe doing a format /system also.
ERRORS encountered in CWM Recovery
.
What is CWM Recovery ?
ClockworkMod Recovery is a custom recovery for many Android devices. It is considered to be the most popular recovery for Android due to its easily-ported nature, and integration with ClockworkMod ROM Manager by Koush(Koushik Dutta). The easiest way to recognize it is by the printed name when it first starts, and the background logo of a gear and hat.
Click to expand...
Click to collapse
ERROR STATUS 6
This is usually caused by CR/LF EOL(Windows style End Of Line) in updater-script. Change it to LF EOL(Unix Style EOL) using Linux command: dos2unix updater-script, then re-signing the ZIP, will usually fix this error.
Click to expand...
Click to collapse
ERROR STATUS 7
This is usually caused by a corrupt download, or bad file signature. Re-downloading (or re-signing) the ZIP will usually fix this.
Click to expand...
Click to collapse
We have been consistently seen and heard people facing error “Status 7″ error while trying to flash or install
custom ROMs or firmware packages on their Android smart phones or tablets with ClockworkMod Recovery. Many
of the users are nowadays facing this problem with CWM Recovery while flashing .zip files of modded or custom
Ice Cream Sandwich (ICS) or Jelly Bean (JB) ROMs on their devices. So, you have also downloaded a custom ROM,
placed its .zip file in your phone’s or tablet’s SD card, booted into ClockworkMod Recovery, selected – “install zip
from sdcard” and then chosen the .zip file of the ROM to get it installed on your device. But instead of getting
flashed successfully, if you are facing the issue mentioned below, then just keep reading this article to find out
what’s wrong and fix up the problem :
Finding update package…
Opening update package…
Installing update…
Error in /sdcard/custom-jelly-bean-rom.zip (Status 7)
Installation aborted
Click to expand...
Click to collapse
or the following error right after CWM recovery shows –
Installing update…
assert failed: getprop(“ro.product.device”) == “I9103″ || getprop(“ro.build.product”) == “I9103″ || getprop
(“ro.product.board”) == “I9103″
Error in /sdcard/android-4-1-1-ics-rom-latest.zip (status 7)
Click to expand...
Click to collapse
So, if you are facing any of these errors while trying to install the desired custom ROM package on your Android
phone or tab, then you may try a various things or steps which may turn out to be the workaround of this
problem. Here are a few tips to get this “Status 7” error fixed in ClockworkMod Recovery and flash the ROM
successfully on your device :
(1) First of all, make sure your device’s bootloader is unlocked. If it is already unlocked but you are still
not able to flash the ROM, then just extract the .zip file of the ROM into a new folder, find the boot.img file from
that directory and flash it up on your phone or tablet via fastboot on your PC.
(2) Make sure that you are having the appropriate Radio or Baseband version installed on your device which is
supported by the custom ROM you are trying to flash. Most of the ROMs requires the latest version of Baseband, so
just update or upgrade your device to the latest Baseband version and then try to install the ROM once again.
(3) Update your device to the supported / latest build of official firmware before trying to install the ROM. You can
do it from – Settings > About Phone / Device > Software Update.
(4) Make sure you are having the supported or required kernel installed on your phone or tab. If it’s not, then flash
a new kernel right away and try to install your custom ROM once again.
(5) Is the ROM which you are trying to flash really works ? Find out whether it is working for other users or not.
Click to expand...
Click to collapse
Error Status 0
Well sometimes while flashing some ROMs especially the cooked ones we get Error status 0 in the CWM Recovery
this error is an indicator of Wrong Update Binary.This is usually caused by an incompatible update-binary in edify ZIPs. Replacing it with a compatible one, then re-signing the ZIP, will usually fix this error.
Click to expand...
Click to collapse
Now it's time for the partitions :good:
Let’s start with a list of standard internal memory partitions on Android phones and tablets. These are:
/boot
/system
/recovery
/data
/cache
/misc
In addition, there are the SD card partitions.
/sdcard
/sd-ext
Note that only /sdcard is found in all Android devices and the rest are present only in select devices. Let’s now take a look at the purpose and contents of each of these partitions.
/boot
This is the partition that enables the phone to boot, as the name suggests. It includes the kernel and the ramdisk. Without this partition, the device will simply not be able to boot. Wiping this partition from recovery should only be done if absolutely required and once done, the device must NOT be rebooted before installing a new one, which can be done by installing a ROM that includes a /boot partition.
/system
This partition basically contains the entire operating system, other than the kernel and the ramdisk. This includes the Android user interface as well as all the system applications that come pre-installed on the device. Wiping this partition will remove Android from the device without rendering it unbootable, and you will still be able to put the phone into recovery or bootloader mode to install a new ROM.
/recovery
The recovery partition can be considered as an alternative boot partition that lets you boot the device into a recovery console for performing advanced recovery and maintenance operations on it. To learn more about this partition and its contents, see the ‘About Android Recovery’ section of our guide to ClockworkMod recovery.
/data
Also called userdata, the data partition contains the user’s data – this is where your contacts, messages, settings and apps that you have installed go. Wiping this partition essentially performs a factory reset on your device, restoring it to the way it was when you first booted it, or the way it was after the last official or custom ROM installation. When you perform a wipe data/factory reset from recovery, it is this partition that you are wiping.
/cache
This is the partition where Android stores frequently accessed data and app components. Wiping the cache doesn’t effect your personal data but simply gets rid of the existing data there, which gets automatically rebuilt as you continue using the device.
/misc
This partition contains miscellaneous system settings in form of on/off switches. These settings may include CID (Carrier or Region ID), USB configuration and certain hardware settings etc. This is an important partition and if it is corrupt or missing, several of the device’s features will will not function normally.
/sdcard
This is not a partition on the internal memory of the device but rather the SD card. In terms of usage, this is your storage space to use as you see fit, to store your media, documents, ROMs etc. on it. Wiping it is perfectly safe as long as you backup all the data you require from it, to your computer first. Though several user-installed apps save their data and settings on the SD card and wiping this partition will make you lose all that data.
On devices with both an internal and an external SD card – devices like the Samsung Galaxy S and several tablets – the /sdcard partition is always used to refer to the internal SD card. For the external SD card – if present – an alternative partition is used, which differs from device to device. In case of Samsung Galaxy S series devices, it is /sdcard/sd while in many other devices, it is /sdcard2. Unlike /sdcard, no system or app data whatsoever is stored automatically on this external SD card and everything present on it has been added there by the user. You can safely wipe it after backing up any data from it that you need to save.
/sd-ext
This is not a standard Android partition, but has become popular in the custom ROM scene. It is basically an additional partition on your SD card that acts as the /data partition when used with certain ROMs that have special features called APP2SD+ or data2ext enabled. It is especially useful on devices with little internal memory allotted to the /data partition. Thus, users who want to install more programs than the internal memory allows can make this partition and use it with a custom ROM that supports this feature, to get additional storage for installing their apps. Wiping this partition is essentially the same as wiping the /data partition – you lose your contacts, SMS, market apps and settings.
With this, we conclude our tour of Android partitions. Now whenever you install a ROM or mod that requires you to wipe certain partitions before the installation, you should be in a better position to know what you’re losing and what not and thus, you’ll know what to backup and what not.
ADB-Android Debugging Bridge
Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:
A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
A daemon, which runs as a background process on each emulator or device instance.
You can find the adb tool in <sdk>/platform-tools/.
When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server.
Click to expand...
Click to collapse
The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:
Emulator 1, console: 5554
Emulator 1, adb: 5555
Emulator 2, console: 5556
Emulator 2, adb: 5557
and so on...
As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.
Once the server has set up connections to all emulator instances, you can use adb commands to access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).
Note: When you connect a device running Android 4.2.2 or higher to your computer, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures that USB debugging and other adb commands cannot be executed unless you're able to unlock the device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or higher.
Syntax
You can issue adb commands from a command line on your development machine or from a script. The usage is:
adb [-d|-e|-s <serialNumber>] <command>
If there's only one emulator running or only one device connected, the adb command is sent to that device by default. If multiple emulators are running and/or multiple devices are attached, you need to use the -d, -e, or -s option to specify the target device to which the command should be directed.
LOGCAT
The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the logcat command. You can use logcat from an ADB shell to view the log messages.
-b <buffer> Loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default. See Viewing Alternative Log Buffers.
-c Clears (flushes) the entire log and exits.
-d Dumps the log to the screen and exits.
-f <filename> Writes log message output to <filename>. The default is stdout.
-g Prints the size of the specified log buffer and exits.
-n <count> Sets the maximum number of rotated logs to <count>. The default value is 4. Requires the -r option.
-r <kbytes> Rotates the log file every <kbytes> of output. The default value is 16. Requires the -f option.
-s Sets the default filter spec to silent.
-v <format> Sets the output format for log messages. The default is brief format. For a list of supported formats, see Controlling Log Output Format.
awesome thread to learn everything in a quick while
Again.? :good:
But highlight the Status error with big & bold font.
Disturbed™ said:
Again.? :good:
But highlight the Status error with big & bold font.
Click to expand...
Click to collapse
I think he's trying to take over XDA
But just to keep this on topic, great thread for those who are learning and aren't sure what certain things are for.
I guess I'll have to make another thread in this forum just so other RCs don't take all the ideas
SGS2 FAQ | HTC One FAQ
KidCarter93 said:
I think he's trying to take over XDA
But just to keep this on topic, great thread for those who are learning and aren't sure what certain things are for.
I guess I'll have to make another thread in this forum just so other RCs don't take all the ideas
SGS2 FAQ | HTC One FAQ
Click to expand...
Click to collapse
Lolzzz.. Yes buddy. He is something else.
Collecting Informations & useful stuff for all users. May be in near future, he will take over XDA.
It's all your love guys. Sometimes even my guides correct my mistakes!
Started from the bottom
Guys if you like this thread please press the tip us button so that more and more people who are willing to learn about android phone and how they work can get help.
I will be grateful to you all.
Started from the bottom
Very nice write up TechnoCrat :good::good::good:
TEAM MiK
MikROMs Since 3/13/11
Long way to go mate!
Congo! This thread got featured on XDA Portal
http://www.xda-developers.com/android/android-101-how-it-all-fits-together/
Thank you very much. I needed this definition thread. I kinda understand but it'd nice to hear official language that's understandable.
Sent from that FBI van parked down the street.
Thanks for the CWM errors write up and another bookmark.
Tha TechnoCrat said:
i. The kernel.
If you’re feeling exceptionally geeky, plug your Android phone into the USB port on your PC and let the PC boot from the USB device. No, it doesn’t actually load, but you can watch the animation while it tries to match up the hardware support with what’s inside your PC
Click to expand...
Click to collapse
What. The. Hell. Are you talking about?
If you mean booting the device's kernel on the PC, unless the device uses an x86 processor, it flat out will not boot, let alone mount the device's system, to display the bootanimation.zip
/snarkieness
Sorry, I had to let that out.
Also, init is called/started after the kernel has started, and generally after it has setup most of the hardware.
so I’ll simply say that DalvikVM is a register-based machine versus true JavaVMs which are stack based.
Click to expand...
Click to collapse
I don't even truly understand that, so could add a little more detail, or remove it?
I'm speaking mostly from my implied knowledge, gained from tinkering with android/linux for a few years.
ADB and Logcat added
Hey, Thanks for the article. Can you talk about root? There is some mis-leading information and I really want to learn about it. Thanks again.
ak700 said:
Hey, Thanks for the article. Can you talk about root? There is some mis-leading information and I really want to learn about it. Thanks again.
Click to expand...
Click to collapse
Okay buddy
Editone! !!
"Thanks button is just to avoid "THANKS" posts in threads. Nothing more than that. Don't ask in signature or post for it and defeat the purpose why it was introduced"
Bump to update newbies
"Thanks button is just to avoid "THANKS" posts in threads. Nothing more than that. Don't ask in signature or post for it and defeat the purpose why it was introduced"
Hello, I have a stock XOOM WiFi (Wingray) and have been looking at installing a custom ROM. I am doing it for fun, knowledge, and to hopefully get a little better performance out of my XOOM.
I currently use my xoom for Web Browsing, XBMC, and Sling Player...
I have been searching the Web and this Forum for information on how i can do this, step by step but i am lost. I know that i have to do the following:
1.Unlock Boot loader (Lord AIO Tool, was unsuccessful which is why i started the thread to post useful links after i succeed.)
2.Modify the Recovery Partition.
3.BigPart
4.Install Custom ROM (Based on whatever Android Ver / Kernel)
I am running Mac OSX 10.8, have a windows VM, and access to a windows laptop if needed.
*EDIT*
Results: I used my Windows Laptop and started to have some success with the Lord AIO Tool. i dont see why the VM wouldn't work, but i had given up on the VM thinking it may have cause a problem.
Steps Needed:
1. Download Motorola Fastboot Drivers:
https://motorola-global-portal.custhelp.com/app/answers/detail/a_id/88481
2. Download ADP Tool (or Install Android SDK and add appropriate locations to your System Path)
ADP Tool: (Awesome)
http://forum.xda-developers.com/showthread.php?t=2588979
Android SDK:
http://developer.android.com/sdk/index.html
3. Download Lord AIO Tools: (also, Awesome)
http://forum.xda-developers.com/showthread.php?t=1468298
4. Download the ROM you need. I used OMNI 4.4.2 (Also needed Big Part, and this too is Awesome)
http://forum.xda-developers.com/showthread.php?t=2593757
Big Part:
http://forum.xda-developers.com/showthread.php?t=2506997
5. Download Super User Root zip file.
6. Format an microSD Card FAT32 and copy over the following files:
TeamWin Recover Partition
TeamWin Recovery Partition Big Part (only needed for ROMs that need larger partition.
Super User
OMNI ROM (or whatever ROM you want)
GApps (one of the Google Apps. I used the gapps-wingray-kk-20131223.zip)
7. Follow Instructions for Lord AIO Tool installation and then do the following:
Run the tool and unlock the boot loader (enter option 03, not 3, but 03)
When done you need to install The recovery partition, i used TeamWin RP. (This is option 09 in the Lord AIO Tool)
Then i rebooted into recovery mode and was in the TeamWin RP menu. From there i Flashed the BigPart, then ROM, then Gapps, and then the Super User to Root.
I think there is an option to Root from the Lord AIO Tool, but i dont think i used it at all.
I was trying stuff all day and when it's all said and done I think that's basically what i did, things didnt always work on the first try and i had some trouble mounting the microSD in the Recovery Partition.
I put this here to hopefully give people new to the game a run down of what to do. i did a lot of searching yesterday and was spinning my wheels. and some of the old threads i found were quite technical and had dead links. (not necessarily from XDA) It's not a Step by Step for the XOOM but will hopefully get people who are late to the game a good start.
tonycajjo said:
Hello, I have a stock XOOM WiFi (Wingray) and have been looking at installing a custom ROM. I am doing it for fun, knowledge, and to hopefully get a little better performance out of my XOOM.
I currently use my xoom for Web Browsing, XBMC, and Sling Player...
I have been searching the Web and this Forum for information on how i can do this, step by step but i am lost. I know that i have to do the following:
1.Unlock Boot loader (Lord AIO Tool, was unsuccessful which is why i started the thread to post useful links after i succeed.)
2.Modify the Recovery Partition.
3.BigPart
4.Install Custom ROM (Based on whatever Android Ver / Kernel)
I am running Mac OSX 10.8, have a windows VM, and access to a windows laptop if needed.
*EDIT*
Results: I used my Windows Laptop and started to have some success with the Lord AIO Tool. i dont see why the VM wouldn't work, but i had given up on the VM thinking it may have cause a problem.
Click to expand...
Click to collapse
I use the Lord AIO Tool on desktop Windows 8.1 and when I ran the Set_Up.bat as Admin, it say file is missing. Not sure what i did wrong.
cat2115 said:
I use the Lord AIO Tool on desktop Windows 8.1 and when I ran the Set_Up.bat as Admin, it say file is missing. Not sure what i did wrong.
Click to expand...
Click to collapse
i did not need to run as Admin, possibly cause the user was already admin. i had issues when i ran as admin... that's one thing i forgot to add above. (I ran it on Win7 32-Bit)
2. Download ADP Tool (or Install Android SDK and add appropriate locations to your System Path)
ADP Tool: (Awesome)
http://forum.xda-developers.com/show....php?t=2588979
Android SDK:
http://developer.android.com/sdk/index.html
also, try moving LAIOT to C:\ if not already there.
after you install ADP tool you may have to reinstall LAIOT, delete the files and just start over using the setup.bat
Stuck on step seven
I will be very grateful of any help stuck on step seven it says too many parameters
floydme said:
I will be very grateful of any help stuck on step seven it says too many parameters
Click to expand...
Click to collapse
what part of step 7? my step 7 is pretty broad.
tonycajjo said:
what part of step 7? my step 7 is pretty broad.
Click to expand...
Click to collapse
After running setup bat on the second return key hit I I get too many parameters message
Perfect (step by step)
Followed this step by step, utilizing this process as well as the individual threads regarding each part (Big Part Partitioning, LORD AIO Tool-with file folder placed on "C" drive, etc.) and worked like a charm.
This thread should become sticky and placed at the very top for Xoom Rooting guide.
Stingray Xoom
kamikazebeats said:
Followed this step by step, utilizing this process as well as the individual threads regarding each part (Big Part Partitioning, LORD AIO Tool-with file folder placed on "C" drive, etc.) and worked like a charm.
This thread should become sticky and placed at the very top for Xoom Rooting guide.
Stingray Xoom
Click to expand...
Click to collapse
good stuff, glad it helped.
floydme said:
After running setup bat on the second return key hit I I get too many parameters message
Click to expand...
Click to collapse
can you write explicitly what the error says, and when you hit "enter" the second time what are you exactly hitting enter to?
also include a bit of info on what OS you are using, where you have stuff installed, and so on.
EDIT (12/08/22): Parts of this guide may be out of date, it hasn't been updated since December 2019.
TL; DR Version in the second post, it's also a short overall summary. Might be best to have a look so you don't get overwhelmed by this first post.
Just thought I would share my experience with the 4K. Just as an FYI this is my first firestick and I've only had it for about a week but I've been playing with it quite a bit.
Personally I'm interested in removing all amazon related products/apps/services etc. With the exception of the store as I would like to get some of my apps through it.
Making it as lean and fast as possible.
Getting as close to AndroidTV as possible without losing any functionally and keeping stability.
I'm primarily interested in Plex and/or Kodi (with no addon apps, just vanilla kodi).
Having root. I like to have the ability to do anything, and I personally found rooting the stick easy so I found no reason not to do it. With that in mind everything I did I had root. I have no idea if any of these steps work without root.
Pre info
I chose to not flash the Prerooted Stock Image due to the comment Sus_i made here. I updated, then rooted.
EDIT (12/08/22): Updating before rooting is no longer recommended.
Step1
Plug it in, run through the setup and let it update. Go to settings -> My Fire TV -> Developer Options and enable ADB Debugging and Apps from Unknown Sources.
Step 2
Root it!
Guide here
This guide/post was helpful also. There is a good video of them opening up the firestick to access the necessary point to short/ground to allow the root script to work. Just be careful with what you use. I just used a small copper wire.
After getting root. Put it back in the case. and plug it in to your tv.
Step 3
Running commands with adb
Get and install adblink, link here
Information on how to use it is on the site. You will need to get the IP address of the firestick. Go to setting -> device -> network -> about
open adblink
click adb shell
type
Code:
reboot recovery
then enter
You'll now be in TWRP
Step 4
Install Magisk
Get the latest stable magisk zip from here
No need for the Magisk Manager apk, that will get installed with the above zip.
Put the zip in the same folder that the adblink.exe is in. (you can find that by clicking adb shell in adb link and then typing exit, then enter. It will show you where you should put the zip file)
Open adblink if you closed it (just leave it open)
click adb shell
which should show the bellow on screen
Code:
mantis:/$
type exit
then paste the following (replace the "Magisk-v20.1.zip" with the correct name of the magisk zip you downloaded)
Code:
adb push Magisk-v20.1.zip /sdcard/
then type
Code:
adb shell
echo "--update_package=/sdcard/Magisk-v20.1.zip" > /cache/recovery/command
echo "--wipe_cache" >> /cache/recovery/command
reboot recovery
It will reboot and install magisk, then reboot to the launcher.
You can now check if you like if magisk is installed correctly and if you have root (you should)
Step 5
Install [Magisk][Module] FireTV 4K Stick Add-Ons
This gets rid of the amazon launcher and does a few other things, including installing xposed framework.
Follow the instructions in that thread. But here's some additional info. Which is just a copy of how we installed magisk.
Download and put the zip in the same folder that the adblink.exe is in.
Open adblink if you closed it (just leave it open)
click adb shell
which should show the bellow on screen
Code:
mantis:/$
type exit
then paste the following (replace the "AFTV-MM-1.9.zip" with the correct name of the AFTV-MM .zip you downloaded)
Code:
adb push AFTV-MM-1.9.zipp /sdcard/
then type
Code:
adb shell
echo "--update_package=/sdcard/AFTV-MM-1.9.zip" > /cache/recovery/command
echo "--wipe_cache" >> /cache/recovery/command
reboot recovery
It will reboot and install AFTV-MM, then reboot to the launcher. It does some things automatically on first boot and may reboot on it's own just let it do it's thing. Some additional commands need to be run via ADB, go to the thread and follow the instructions there: [Magisk][Module] FireTV 4K Stick Add-Ons
Step 6
Remove amazon bloat. *More info below*
Now I've seen a few lists here and there and tried to guess which things to disable on my own until I found these scripts.
Now these scripts weren't made for the 4k (mantis) firestick as you can see from the compatibility list. But I assumed the packages installed would be close so I'm guessing this isn't a bad starting point. But just remember this clearly wasn't meant for this device.
Download the script from here All credit for the original script goes to esc0rtd3w.
and put it in your adblink folder.
Open adblink if you closed it (just leave it open)
click adb shell
which should show the bellow on screen
Code:
mantis:/$
type exit
Code:
adb push bloat-disable.sh /sdcard/
then type
Code:
adb shell
su
cp /sdcard/bloat-disable.sh /data/local/tmp/
chmod 755 /data/local/tmp/bloat-disable.sh
sh /data/local/tmp/bloat-disable.sh
The script will then disable all the bloat. If you would like to enable all the bloat then use this script, download it and follow the same instruction from above. If you just need to enable a single app/service then you can run:
Code:
adb shell
su
pm enable com.amazon.dcp
replacing "com.amazon.dcp" with the app you want to enable.
Step 7
If you want Kodi as the launcher
You can get a modified apk here The thread where this came from originally is here Discussion of an update here
Side load the apk with adblink. Should be self explanatory, click install apk. Once installed open LauncherHijack and select Kodi as the launcher.
Step 8
Setting Kodi (or any other launcher) as the launcher
Install Launcher Hijack (Clone Mod), get the apk here
Follow the instructions here to install it and get it working. By now you should be getting comfortable with abdlink, use it to install the apks and run the adb shell commands.
Other apps to install
Smart Youtube TV (no ads)
OpenVPN install if you want or need it. In my case I need to slightly deviate from the guide. I simply didn't need to create the login.conf file. I Just copied opvn config over and then in settings chose "Certificates" for type and insert the password in "private key password".
That's it for now. I'm curious what other modifications can be done on the 4K (mantis). I'm thinking about/planning on trying a few I've seen around. I think as long as I can get back to TWRP then worse case I should be able to flash the stock ROM to recover. Would be interested to hear what other people may have pulled off.
*Step 6 more info*
This script will remove all packages that esc0rtd3w deemed safe to remove as of Fire OS 5.2.7.2 on the FireStick2. It will leave the amazon launcher enabled and allow use of the amazon app store. The amazon app store can also be disabled but disabling the amazon launcher breaks access to the settings.
My slightly edited version of his script
esc0rtd3w firestick-loader github. All credit for the script goes to him.
List of services/packages that are new for Fire OS 6.2.6.8
If anyone can inform me of the packages/services that can be safely disabled, please let me know and I can include them in the script. For now they are left untouched/enabled.
Info I found and used for this post
[UNLOCK][ROOT][TWRP][UNBRICK] Fire TV Stick 4K (mantis)
[Magisk][Module] FireTV 4K Stick Add-Ons
[FireTVStick4k] Updated Info November 2019
[NEWBIE GUIDE] How to Unlock Bootloader/Root and install Addons FireStick 4k
FireTV4k Stick: Achieving Root With Magisk
[LAUNCHER] XBMC/Kodi for Fire TV (Root)
Updated Kodi 18.5 version by the developer elmerohuesoWhich is posted here
Install OpenVPN on fireTV (no root required)
Running scripts on the Firestick, in this case the disable-bloat.sh script
This assumes you have an understanding of how to use adb and if more detail of any of the following steps is necessary then follow the steps in the first post.
Step 1
Plug it in, run through the setup and let it update. Enable ADB and Unknown Sources.
Step 2
Root it!
Guide here
Step 3
Get adb installed
Step 4
Install Magisk
Step 5
Install [Magisk][Module] FireTV 4K Stick Add-Ons
Step 6
Remove amazon bloat.
Download the script from here
Run on firestick via ADB
Step 7
If you want Kodi as the launcher, See the first post.
Step 8
Setting Kodi (or any other launcher) as the launcher, See the first post.
Step 9
Install other apps
OpenVPN install Seeing first post for more info
Smart Youtube TV (no ads)
Step 10
Other Tweaks
Stop firestick from going to sleep/returning to the home screen.
Things that don't work or I'm interested in trying to get working.
-Can't "install" apps from amazon. The app store is there and can install from "the cloud" but can't search for new apps. Likely due to something being disabled., just not sure what. I assume installing from amazon web into the cloud or something like that could be a work around. Might be that the only way to search for apps is with the default launcher?
-Voice search doesn't work. Looks like some people have kind of gotten it to work but I have not.
-Chromecast support.
Both would likely have a better chance if google play services/store could be installed. I see there was some effort put forth in trying to do that on previous firetvstick models so I may try some of the info that is out there. Seeing as we now have root its a lot more possible.....I assume.
reserved 1
reserved 2
I keep meaning to test nanodroid with microg & the patched play store. I've not done it yet as I was afraid patching the system would screw everything up & I had so much difficulty getting bootloader patched to begin with. It may not be necessary to patch system, I recall using an xposed module for spoofing some time ago on an old phone so that could be a possibility.
It might not work, but there's probably less that can go wrong as there's less "deep" system integration than using official gapps. Just an idea if you fancy trying it.
Booting between FireOS and TWRP
Below are the first steps in rooting the firestick 4k:
Once it reboot’s into TWRP do you now have root privs?
Can you stop here and not install a “pre-rooted image”?
Can I now boot between FireOS and TWRP if so How?
Thank You,
1.Boot the ISO
2.Download and extract the exploit package.
3.Open a terminal in the kamakiri directory
Run
Code:
4. ./bootrom-step.sh
Short one of the points in the attached photo to ground (the cage of the shielding).
Ideally you want to use DAT0, since that is tiny it might be easier to short the point marked CLK instead.
It is very important that you use a piece of soft wire or aluminum foil or something similar for shorting. Don't use tweezers as that makes it incredibly easy to knock of the capacitor off the PCB and kill the board!
5. Connect the stick to your computer (while keeping it shorted)Both USB and HDMI ???
6. The script should tell you to release the short and hit enter
Once finished run
Code:
7. ./fastboot-step.sh
Your device will now reboot into TWRP
RPM99 said:
Below are the first steps in rooting the firestick 4k:
Once it reboot’s into TWRP do you now have root privs? (Yes, but you need to install magisk to manage su)
Can you stop here and not install a “pre-rooted image”? (Yes, you don't need to install the image)
Can I now boot between FireOS and TWRP if so How? (adb commands or the reboot menu if you have the magisk module installed. For adb, insure you have adb debugging turned on, then log into the firestick (that's all in the guide) and run "reboot recovery")
Thank You,
1.Boot the ISO
2.Download and extract the exploit package.
3.Open a terminal in the kamakiri directory
Run
Code:
4. ./bootrom-step.sh
Short one of the points in the attached photo to ground (the cage of the shielding).
Ideally you want to use DAT0, since that is tiny it might be easier to short the point marked CLK instead.
It is very important that you use a piece of soft wire or aluminum foil or something similar for shorting. Don't use tweezers as that makes it incredibly easy to knock of the capacitor off the PCB and kill the board!
5. Connect the stick to your computer (while keeping it shorted)Both USB and HDMI ??? (hdmi isn't needed, just usb)
6. The script should tell you to release the short and hit enter
Once finished run
Code:
7. ./fastboot-step.sh
Your device will now reboot into TWRP
Click to expand...
Click to collapse
I replied inline in brackets. On mobile so a pain to in another way.
Thanks for the clarification
bnevets27 said:
I replied inline in brackets. On mobile so a pain to in another way.
Click to expand...
Click to collapse
Hi,
Inline with great answers is just fine, thank you.
I will investigate magisk, I didn't realize that's what it is for.
And "reboot recovery" at the adb command line will put me back in TWRP mode - This was great info!!
I ordered a new firestick to try this on, it will be here next week so I have some time to read up.
Thanks again,
Steve
More questions if you can please
RPM99 said:
Hi,
Inline with great answers is just fine, thank you.
I will investigate magisk, I didn't realize that's what it is for.
And "reboot recovery" at the adb command line will put me back in TWRP mode - This was great info!!
I ordered a new firestick to try this on, it will be here next week so I have some time to read up.
Thanks again,
Steve
Click to expand...
Click to collapse
When you short to ground and then plug into usb to boot firestick is that considered bootloader mode?
At what point is the greatest risk of bricking the firestick?
Thanks,
Steve
RPM99 said:
When you short to ground and then plug into usb to boot firestick is that considered bootloader mode?
At what point is the greatest risk of bricking the firestick?
Thanks,
Steve
Click to expand...
Click to collapse
I guess that would probably be technically correct.
Only time there's a chance of bricking, usually for flash anything, is during the writing process. Or a corrupt file.
I've done a hand full and haven't had any issues. Just take normal precautions like do what you can to prevent a power outage during the flash and once it's plugged in and flashing don't touch anything till its finished.
Personally I plugged in the mirco USB into the firestick first, then lined up the USB into the computer but didn't push it in. Held a small solid copper wire against the rf shield (the metal that surrounds the chip) and touched the side of what I think is a capacitor (you can't get to clk without taking the surrounding metal piece off). It's the "other" point they mention you can use. While doing that with one hand I plug in the USB to the computer. Remember the script has to be run first, waiting to see the stick before you plug it in.
If you miss time it or don't make the connection, the script just won't tell you to remove the short and press enter, so you'll just have to try again.
bnevets27 said:
...
Both would likely have a better chance if google play services/store could be installed. I see there was some effort put forth in trying to do that on previous firetvstick models so I may try some of the info that is out there. Seeing as we now have root its a lot more possible.....I assume.
Click to expand...
Click to collapse
Did you try https://forum.xda-developers.com/fire-tv/development/magisk-gapps-fireos-6-t4019095 ?
Kramar111 said:
Did you try https://forum.xda-developers.com/fire-tv/development/magisk-gapps-fireos-6-t4019095 ?
Click to expand...
Click to collapse
I haven't no. I might have missed that one. I've been pretty happy the the end result of using his module in this thread. And after updating to the latest version, voice search is working for me.
I have some other projects at the moment so I'm not working on this but I'll come back to later on.
bnevets27 said:
I haven't no. I might have missed that one. I've been pretty happy the the end result of using his module in this thread. And after updating to the latest version, voice search is working for me.
I have some other projects at the moment so I'm not working on this but I'll come back to later on.
Click to expand...
Click to collapse
When you say voice search is working, does that mean you can click the little mic icon at the top left of the Android TV launcher and it will search? Does it work well? Thanks
gogorman said:
When you say voice search is working, does that mean you can click the little mic icon at the top left of the Android TV launcher and it will search? Does it work well? Thanks
Click to expand...
Click to collapse
Yeah you have to click the mic on screen then the mic on the remote. Seems to work pretty well but haven't used it much more then just to see if it worked.
bnevets27 said:
Step 2
Root it!
Guide here
Click to expand...
Click to collapse
This exploit does not give you root. This unlocks the bootloader and then installs TWRP recovery.
.... I just used a small copper wire.
Click to expand...
Click to collapse
I used a Reese's candy wrapper! I just rolled it between my fingers and wedged it under the metal "cover," touching the CLK and DATA points. Then plugged it in to the USB port.
Step 4
Install Magisk
Click to expand...
Click to collapse
This is what gives you ROOT access.
Took me a while, reading through all the threads, to figure out which exploit does what.
Step 5
Install [Magisk][Module] FireTV 4K Stick Add-Ons
Click to expand...
Click to collapse
This module is great. It also disables Amazon firmware updates. There are a bunch of other tips in that thread too.
Thanks for the tips and tricks!
When trying to run the disable script I get i get an error at the last command. /data/local/tmp/bloat-disable.sh[7]: syntax error: 'newline' unexpected.When running command " sh /data/local/tmp/bloat-disable.sh "
Can you create a bloat-disable script dedicated to fire stick 4k (mantis) ? that would be beneficial for everyone.
UPDATE: I discontinued work for this tablet model, due to the lack of NEON support for the Nvidia Tegra 2 CPU used in this model. Any existing work I uploaded will remain online, but I won't be uploading anything new. I'm also considering selling my tablet to anyone interested.
I have become successful with getting postmarketOS to run on this tablet for the past 2 months, running mainline Linux (5.8.0 as of this writing). This allows us to use this tablet model for a little longer, without getting stuck on older Linux kernel versions.
postmarketOS is an experimental, touch-optimized and pre-configured Alpine Linux. It can be installed on smartphones and other devices.
About postmarketOS, from their homepage:
We are sick of not receiving updates shortly after buying new phones. Sick of the walled gardens deeply integrated into Android and iOS. That's why we are developing a sustainable, privacy and security focused free software mobile OS that is modeled after traditional Linux distributions. With privilege separation in mind. Let's keep our devices useful and safe until they physically break!
Click to expand...
Click to collapse
Wiki page for this tablet: https://wiki.postmarketos.org/wiki/Acer_Iconia_Tab_A500_(acer-picasso)
Most features should work, except for the camera and 3D acceleration. Wi-Fi and Bluetooth work only if the non-free firmware is chosen to be installed.
How to install:
Follow the installation guide at https://wiki.postmarketos.org/wiki/Installation_guide, where theses specifics have to be specified when requested (this device is now in upstream pmaports):
Vendor: acer
Device code-name: picasso
Install non-free Wi-Fi + Bluetooth firmware: y
Only the mainline kernel is available for installation now, as downstream kernels no longer successfully compile. The user interface may be freely selected, as long as it is not one that requires 3D acceleration. To use KDE Plasma 5, add these lines to /etc/security/pam_env.conf:
Code:
QT_IM_MODULE=qtvirtualkeyboard
QT_QUICK_BACKEND=software
LIBGL_ALWAYS_SOFTWARE=1
Next, run the following commands in succession, after each one finishes, assuming the working directory contains the pmbootstrap.py script:
Code:
> ./pmbootstrap.py build device-acer-picasso
> ./pmbootstrap.py build firmware-acer-picasso
> ./pmbootstrap.py build linux-postmarketos-grate
From here on out, the generated chroot can be either installed to the eMMC, or a microSD card that must be inserted at or before boot time (the latter method allows for dual-booting Android already installed to the eMMC, although it can be directly accessed from the Linux system). The boot partition always has to be flashed to the eMMC in fastboot mode, as it is not possible to boot directly off of a microSD card.
If installing to the eMMC, run
Code:
> ./pmbootstrap.py install
> ./pmbootstrap.py flasher flash_kernel --partition secboot
> ./pmbootstrap.py flasher flash_rootfs
(optional) > ./pmbootstrap.py flasher boot
If installing to a microSD card, run
Code:
> ./pmbootstrap.py install --sdcard [path to the device for installation]
> ./pmbootstrap.py flasher flash_kernel --partition secboot
Depending on what user interface was chosen earlier in the installation process, there may not be enough packages installed to get a fully-loaded GUI. Besides the built-in Wi-Fi, it is also possible to use a USB ethernet adapter, or connect to another computer with a micro-USB cable and get RNDIS access that enables using SSH to the tablet.
Using another distro in place of postmarketOS
Advanced: Using another distro in place of postmarketOS
It is possible, if using the microSD card method, to use a different distro instead of postmarketOS, for those who want more software OOTB. I use the Ubuntu MATE rootfs from https://ubuntu-mate.org/ports/raspberry-pi/ as my daily driver, but other distros may take more effort to get working. Glibc limitations no longer apply, as the kernel version is no longer stuck at 3.1.0 (unlike with my earlier attempts). Carefully follow the instructions listed below, or the resulting system will become unbootable:
Use losetup or GNOME Disks (Utility) to mount the image in read-write mode.
Run GParted with the loop image and the target microSD card as the arguments.
Copy only the larger rootfs partition to the microSD card. Resize as necessary to get it to fit on the target microSD card.
Make sure on the target microSD card the boot partition is named 'pmOS_boot' and the rootfs 'pmOS_root'. The initramfs is hard-coded to search for partitions with these names by default for microSD cards. The loop image is not needed after this point, and can be safely detached.
On the copied rootfs, edit /etc/fstab to reflect the partition layout. To get access to Wi-Fi and Bluetooth, copy the kernel modules and firmware from the pmOS rootfs on the host system to the microSD rootfs.
Let me know if something wasn't understood from my instructions, or more clarification is needed. The instructions here can be somewhat overwhelming for those who have less Linux experience, but at least we're not forced to stay on old distro versions anymore.
Premade Linux images
I finally have managed to create a premade image to make the installation process easier for other people, especially for those who don't want to go through the hassle of compiling software. Every image I make can be found at https://drive.google.com/drive/folders/1pMqaS5GaM6N9TAKlNGQZWCG8UTiRn4pK?usp=sharing.
For all images:
Kernel version: 5.15.0-rc4
Includes all compiled kernel modules from postmarketOS builds, plus nonfree firmware enabled.
The postmarketOS splash screen will appear, although the underlying OS differs based the image used.
Images available:
Ubuntu MATE 20.04.1 (ubuntu-mate-20.04.1-desktop-armhf+acer-picasso.img.xz) (size: 1.3 GiB):
Based on 'ubuntu-mate-20.04.1-desktop-armhf+raspi.img.xz', available from https://ubuntu-mate.org/ports/raspberry-pi/
Underlying OS is Ubuntu 20.04.1, which is supported for 5 years until April 2025. However, Ubuntu MATE officially has support only until April 2023.
Requires at least an 8 GB or greater size microSD card (the image is 5.6 GiB decompressed).
The setup screen will open upon the first successful boot, where a username and password have to be set.
Most extra packages for the Raspberry Pi family of computers have been removed, including the kernels.
The battery icon in MATE cannot be enabled graphically, as the preferences window has been patched to permanently hide such an option (as the Raspberry Pis lack native battery support); instead run the command
Code:
gsettings set org.mate.power-manager icon-policy 'always'
to manually enable it.
The PPA at https://launchpad.net/~grate-driver/+archive/ubuntu/ppa is pre-configured to be accessed. Most packages from this repository, including the opentegra driver, come preinstalled. They currently are enough to get 2D acceleration working, but not for 3D acceleration.
Except for what has been mentioned above, any packages shipped may have to be updated once an internet connection is established.
Arch Linux ARM (ArchLinuxARM-armv7-latest+acer-picasso.img.xz) (size: 576.6 MiB):
Based on 'ArchLinuxARM-armv7-latest.tar.gz', available from https://archlinuxarm.org/about/downloads
Rolling release distro often with the latest versions of most packages. More recent software can be acquired at a small expense of instability.
Requires at least an 2 GB or greater size microSD card (the image is 1.9 GiB decompressed). Larger size is recommended for installing more packages.
To login into system:
Login as the default user alarm with the password alarm.
The default root password is root.
Initially command-line only; contains no desktop environment installed.
Use any image writing program with these images. If such a program does not support XZ compression, the image needs to be extracted instead, and that has to be used.
I hope the images will proves useful to some people. Let me know if any issue pops up during usage of this image!
hey Worldblender,
I have flashed the premade file you shared to an sdcard but I'm unsure as to how to boot into it?
tehno said:
hey Worldblender,
I have flashed the premade file you shared to an sdcard but I'm unsure as to how to boot into it?
Click to expand...
Click to collapse
The instructions were written assuming that the user has already flashed the custom bootloader as described here: https://forum.xda-developers.com/iconia-a500/a500-2019-2020-t4039271. Sorry for not making this clear anywhere, but that custom bootloader, along with flashing the boot image found in the first partition named "pmOS_boot" to either boot or secboot using fastboot, should get you set up to boot the SD card image.
Hi Worldblender,
Nice to see you work on this legacy device.
I definitely don't want to use android or can use it anymore on this tablet.
Nice to see some linux flavor being ported to it.
I had a look a the dedicated page on postmarketos.
Can you confirm the only GUI availbale as for now is the one called "Weston" ?
Or is MATE also working (from the screenshot) ?
Weston seem very basic, MATE more friendly.
How about performance ?
I'm considering reusing it to display a grafana dashboard in firefox for instance, maybe more if performance isn't too bad.
Worldblender said:
The instructions were written assuming that the user has already flashed the custom bootloader as described here: https://forum.xda-developers.com/iconia-a500/a500-2019-2020-t4039271. Sorry for not making this clear anywhere, but that custom bootloader, along with flashing the boot image found in the first partition named "pmOS_boot" to either boot or secboot using fastboot, should get you set up to boot the SD card image.
Click to expand...
Click to collapse
Thank you Worldblender for your work in writing up instructions and compiling the image too.
However, I'm still a bit lost as to what to do with your Ubuntu Mate image.
I've gotten the TWRP bootloader installed onto my Acer A500 tablet, but whether I use Rufus to expand your image onto an SD card, or just copy the compressed image onto the SD card, the [ Install ] does not see any images inside of the drive. Am I supposed to decompress your image in Windows and use the 0.img and 1.img in place of the nvflash's boot.img and recovery.img?
While I can see the two partitions in Ubuntu, I'm equally lost as to what to do with them, and how to get it onto the tablet.
coluwyvurne said:
Thank you Worldblender for your work in writing up instructions and compiling the image too.
However, I'm still a bit lost as to what to do with your Ubuntu Mate image.
I've gotten the TWRP bootloader installed onto my Acer A500 tablet, but whether I use Rufus to expand your image onto an SD card, or just copy the compressed image onto the SD card, the [ Install ] does not see any images inside of the drive. Am I supposed to decompress your image in Windows and use the 0.img and 1.img in place of the nvflash's boot.img and recovery.img?
While I can see the two partitions in Ubuntu, I'm equally lost as to what to do with them, and how to get it onto the tablet.
Click to expand...
Click to collapse
Wait for me to give out an update to the image, as there likely has been a new kernel version released that I would like to have updated first.
TWRP will not be used at all for this installation process, as the image is too big to flash with fastboot. Just flash the image to a microSD card, as the boot image that will be flashed will automatically pick it up shortly after booting. The only thing that does have to be flashed is the boot.img, which can be found in the first partition, and you will be only using fastboot for this process, not anything else.
I released a new version of the premade Ubuntu MATE image just now, named 'ubuntu-mate-20.04.1-desktop-armhf+acer-picasso.img.xz'. The following changes have been made since the last image:
Kernel version upgraded to 5.10.1-rc1
Based on Ubuntu MATE 20.04.1
Everything that changed since the beta1 image
Other than these changes, there are no other differences that can be noticed right away.
Direct link: https://drive.google.com/file/d/1mr-7e29KJYeagJju0Yo1qUpT2YRb61AR/view?usp=sharing
Many thanks for your work. I've entered today this forum just curious about something new and found this!
Second life for this old machine!
For those with problems installing, I've flashed precompiled image using balenaEtcher into the sdcard.
Then, extracted .xz image, extracted .img, then extracted 0.img and copied boot file from there. After that, renamed the file to boot.img and flashed it with fastboot.
As I've the old modified skrillex bootloader, the command is fastboot flash secboot boot.img.
It boots and works well for now!
Worldblender said:
[*] Add the PPA at https://launchpad.net/~grate-driver/+archive/ubuntu/ppa to get access to updated video drivers. They currently are enough to get 2D acceleration working, but not for 3D acceleration.
Click to expand...
Click to collapse
@Worldblender
Hi, i apt updated after adding grate-driver ppa, it seems it broken xorg because X don't start anymore
Can you detail how to proceed ?
pheex79 said:
@Worldblender
Hi, i apt updated after adding grate-driver ppa, it seems it broken xorg because X don't start anymore
Can you detail how to proceed ?
Click to expand...
Click to collapse
Can you still switch to a virtual terminal with Ctrl-Alt-[F1-F7]? You will need a USB keyboard to do this. Then try, after logging in with your username and password:
Code:
systemctl stop lightdm
startx
If startx does not bring something up, could you try running journalctl, and show me any log entries relating to lightdm?
If that still fails, you can try (if ppa-purge is not installed, install that first)
Code:
ppa-purge ppa:grate-driver/ppa
@Worldblender
one binary missing but i think this error is present before adding ppa
"/sbin/prime-switch: 22: /usr/bin/gpu-manager: not found"
Xorg log:
Require OpenGL version 2.1 or later
modeset(0): Failed to initialize glamor at ScreenInit() time
pheex79 said:
@Worldblender
one binary missing but i think this error is present before adding ppa
"/sbin/prime-switch: 22: /usr/bin/gpu-manager: not found"
Xorg log:
Require OpenGL version 2.1 or later
modeset(0): Failed to initialize glamor at ScreenInit() time
Click to expand...
Click to collapse
I never received such an error, but the specific package you must install is xserver-xorg-video-opentegra. No other Nvidia driver is going to work.
Worldblender said:
I never received such an error, but the specific package you must install is xserver-xorg-video-opentegra. No other Nvidia driver is going to work.
Click to expand...
Click to collapse
It works ! Thank you
xserver-xorg-video-opentegra was not installed
when adding ppa grate i only did an "apt upgrade" cmd i thought all grate items were installed (a few are installed when upgrading apt)
Nice work thank you so much.
Is there any chance for Manjaro arm? Or is it limited to debian based distros?
Note that after following the instructions for installing the Ubuntu MATE image from @Worldblender from a starting point of just the stock image, I have Ubuntu MATE installed on the external SD card and no OS installed on the eMMC because it was wiped during the bootloader replacement. Reading back through the posts suggests this is by design.
@Worldblender, so I'm very new at rooting devices, and have a little experience with Ubuntu but feel pretty lost. Any chance you could hook me up with a step by step install of the Nov2 image (unless you've put together another new version) from a stock(not rooted or anything) A500? I apologize if I overlooked something.
Edit: I got it working after doing this thing called reading, I definitely overlooked some things after reading closer. For someone else that might find themselves in my shoes here's what I did.
I followed this link: https://forum.xda-developers.com/iconia-a500/a500-2019-2020-t4039271 to get the bootloader installed
and then followed @whylly 's instructions:
whylly said:
For those with problems installing, I've flashed precompiled image using balenaEtcher into the sdcard.
Then, extracted .xz image, extracted .img, then extracted 0.img and copied boot file from there. After that, renamed the file to boot.img and flashed it with fastboot.
As I've the old modified skrillex bootloader, the command is fastboot flash secboot boot.img.
Click to expand...
Click to collapse
Hi there ! I have an iconia a500, rooted with lightspeed 4.8. Can I install this and then make it switch to Khali linux ? My ultimate objective is to get Khali on this tablet. I've worked my way down from ver 2.5x linuxdeploy all the way down to 2.0 lol So I'm thinking maybe if I apply your OS it will update the Kernal from 4.0.3 to 5 yes ? (That's a big jump for linuxdeploy) then I can apt-get khalifull ? Am I off base would this work ? Unless you have an image already of course in which case pleaaaaaaaaaaaaaase I'll pay for the bloody thing if I have to I've been pulling my hair out for days. Tried frikkin everything.
Unless anybody has a better method of course in which case feel free to suggest. If I have to make the image from scratch so be it
EDIT: UGhhhhhh after days of troubleshooting, I got to linuxdeploy2.0-1.16 installed kali (the native one on the app not from the repository as that gives kernel too old once you get the install working). Managed to term in and tried to start lxde, failed because lxde doesn't exist (sigh) tried to apt-get... kernel too old. game over sigh
Unless someone has a workaround I don't think it's possible to get Khali on a500.
Sound work?