How to setup ART and restore in recovery for KitKat 4.4/CM11 ROM - Miscellaneous Android Development

I've just tested ART feature from friend's recommendation. After activating ART in my CM11 ROM, NFC and Themes Provider keep crashing and phone is not usable. So I think it's good idea to share how to revert ART setting without wiping phone or restore from backup.
Instructions to revert ART
1. Boot into recovery.
2. Run adb shell to access terminal.
3. Type 'rm /data/property/persist.sys.dalvik.vm.lib' This will remove setting default VM runtime to ART.
4. Clear Dalvik cache and reboot. Your phone should run normally now.
Instructions to set ART again
1. Boot into recovery.
2. Run adb shell to access terminal.
3. Type 'echo "libart.so" > /data/property/persist.sys.dalvik.vm.lib' This set default VM to art library file.
4. Clear Dalvik cache and reboot. Your phone should run with ART VM now.
Hope this helps.

tested on huawei honor (u8860)
[email protected]:~$ adb shell
~ # echo "libart.so" > /data/property/persist.sys.dalvik.vm.lib
/sbin/sh: can't create /data/property/persist.sys.dalvik.vm.lib: nonexistent directory
any suggestion? thank you.

hi.
the solution to get art fully working was the following one:
replacing dalvik.vm.dexopt-data-only=0 with dalvik.vm.dexopt-data-only=1 and all went fine...(build.prop)
at least it worked for me. hope it would help.

You need to mount the data partition before running the commands mentioned in the first post there...

This saved my ass! Switched to ART and after reboot, settings would only FC. Could not change anything or switch back through Dev Options. Thank you!!!!
Sent from my HTC6525LVW using Tapatalk

Thanks for the instruction. You save me as I don't have PC now and my custom ROM not support ART.

excuse me, i've been try to switch to art with adb shell, and my phone is boot up but can't get into home screen, it just stuck on starting apps? why ya?

Related

Alternative method: Removing bloatware

Requirements:
- ClockworkMod Recovery on your device
- Know how to reboot into recovery
- Have Android SDK (adb) installed - and familiar with the concept of what it does, and know how to access it via command line - if not look around, it's everywhere on how to do this.
Disclaimer:
- What you do is your fault
Optional:
- Ability to discern what, and what not to remove
Synopsis:
This is a good technique if you're receiving 'read only' errors while trying to remove apps - namely located in /system/app
[size=+3]Method:[/size]
- Reboot into recovery - it's been said in other threads it's best to DISCONNECT USB, power down, boot into recovery and THEN replug the USB connector.
- Using the clockwork menu - navigate down to 'partitions menu' using your volume down button - then hit the power button
- From the partitions menu, select 'mount /system' and hit the power button
- From your Android SDK tools directory - check 'adb devices' - this should indicate your phone is connected and in 'recovery' mode.
e.g.:
Code:
$ adb devices
List of devices attached
HT06BR007742 recovery
- Type 'adb shell' - this will put you into a command line for your phone
- From the command shell: 'cd /system/app'
- To get a list of what you can remove, type 'ls'
- To remove an .apk - type 'rm FileName.apk'
- When you're done, it's suggested you use the clockwork menu to reboot the phone ('back to the main clockwork menu, and 'reboot device')
Further example / note:
Once logged in via 'adb shell' and the system dir is mounted via clockwork:
Code:
/system/app # ls |grep "ATT"
ATT_Maps.apk
ATT_Navigator.apk
/system/app # rm ATT_Navigator.apk
Also, a side note, you can see all available commands for this shell by typing:
Code:
ls /sbin
The list is quite comprehensive.
I hope this helps someone
thanks thinice !
Added to the sticky roll-up.
I'm not 100% on this but I was able to uninstall whatever I wanted through Titanium Backup, including the ATT bloatware once I was rooted.
I am not sure about the Titanium Backup method. I restored to stock rom with root and used Titanium backup to remove some apps. They showed as removed, however when I reboot the phone the apps are back and not removed. I could not get Titanium backup to remove the apps with root alone.
removing AT&T Radio
I have searched the forum and have not yet found the answer to this question...I have removed all of the AT&T apps that I want to remove, except, which apk is AT&T radio?
You talking about fm radio on a sense rom?
Sent from my HTC Liberty using XDA App
Ah, no I'm using my HTC Aria with the stock image. I've rooted it though, and I'm just getting rid of the included AT&T apps I do not want. This one shows up as "AT&T Radio". Just trying to figure out which apk to remove in order to remove this app.
what apps are SAFE to remove without effecting HTC Sense or Aria? we need to make a list of files/apps safe to remove. i heard one user saying removing HTC stocks caused error issues when it tried to sync.
Hello also any luck with change the radio to activate for 1700 mhz UMTS ?
wdlamb said:
Ah, no I'm using my HTC Aria with the stock image. I've rooted it though, and I'm just getting rid of the included AT&T apps I do not want. This one shows up as "AT&T Radio". Just trying to figure out which apk to remove in order to remove this app.
Click to expand...
Click to collapse
AndroidMusic.apk
Thanks, that was exactly what I was looking for.
I've worked on this a few hrs now. I got Clockwork Recovery to work. Figured out HTC Sync was reverting the phone to stock recovery somehow. Removed that though...
Have rerun Unrevoked, and I can get into clockwork. I'm not interested in changing to different ROM now, just removing ATT crap.
When I try sideloading instructions/alternate method for removing ATT stuff, I get an error in cmd:
C:\android\tools>adb remount
remount failed: Operation not permitted
adb devices returns:
List of devices attached:
<myserial#> device
Any ideas? Have I not completed the root access procedure? I thought it was part of the Unrevoked process.
ahren37 said:
I've worked on this a few hrs now. I got Clockwork Recovery to work. Figured out HTC Sync was reverting the phone to stock recovery somehow. Removed that though...
Have rerun Unrevoked, and I can get into clockwork. I'm not interested in changing to different ROM now, just removing ATT crap.
When I try sideloading instructions/alternate method for removing ATT stuff, I get an error in cmd:
C:\android\tools>adb remount
remount failed: Operation not permitted
adb devices returns:
List of devices attached:
<myserial#> device
Any ideas? Have I not completed the root access procedure? I thought it was part of the Unrevoked process.
Click to expand...
Click to collapse
Yes, I think I was getting the same problem so I did a sequence of steps in some weird sequence to actually change it. It went something like this:
1. Make sure your PATH variable is set to Tools folder of Android SDK
2. Boot your phone into Clockwork and connect to PC
3. On your phone go to Partitions Menu and mount /system, then mount USB storage
3. Go to command prompt on your PC change your drive to phone/SD card drive (whatever that is, F:\ in my case)
4. adb remount
5. unmount /system
6. mount /data, mount USB storage
7. adb pull /data/data/com.android.providers.settings/databases/settings.db C:\settings.db
where C:\ is the main PC drive
8. change to C:\
9. echo update secure set value = 1 where name = 'install_non_market_apps';|sqlite3 settings.db
10. change to F:\
11. adb push C:\settings.db /data/data/com.android.providers.settings/databases/settings.db
12. Unmount everything, reboot and sideloading should work
sorting and backup
To see which files take the most space, use du with sort:
Code:
du * | sort -n
If concerned about deleting an important app, try moving it to the sd card instead. First mount the sdcard with the recovery menu, then:
Code:
mkdir -p /sdcard/backup/system/app
mv /system/app/something.apk /sdcard/backup/system/app
Thanks for the guide!
Great I'll try this tonight. Thanks
Sent from my HTC Aria using XDA App
I'm getting errors when attempting to remove the ATT_Navigator and ATT_Maps.
/system/app # rm ATT_Navigator.apk
rm ATT_Navigator.apk
rm: can't remove 'ATT_Navigator.apk': Directory not empty
Same error for both. Any suggestions?
I'm running Liberated 2.1 and ClockworkMod 2.5.0.1.
asiancuta said:
what apps are SAFE to remove without effecting HTC Sense or Aria? we need to make a list of files/apps safe to remove. i heard one user saying removing HTC stocks caused error issues when it tried to sync.
Click to expand...
Click to collapse
Yeah, I think it'll be nice to have a master list so future people won't have to mess with backups.
some I'm curious about is Mobi TV, Mobile banking, Mobile Video, Peep, and mostly if it'll be okay to remove the htc twitter widget.
the only program i ran into any issues with removing was the defalut mms app. i decided to see what would happen if i got rid of that app and replaced it with handcent or chompsms. those programs could still send messages, but i couldn't receive any.
the easiest way to compile a list like that is browse the forums for any preexisting knowledge, then just start testing things for yourself. make a nandroid backup of your rom as it sits, start removing programs, boot normally and see what happens! if theres no errors after you've removed the desired apk, make a new backup, reboot into recovery and keep going at it.

ADB shell su: permission denied while in Recovery mode

Hey guys,
I just can't figure this one on my own. My phone is bricked, so I'm trying to use ADB in Recovery mode to fix it. The problem is, that 'su' always returns 'permission denied', so I can't mount system rw and that's where I'm stuck.
Phone is fully rooted - that's how I was able to brick it in the first place.
'/system/xbin/su' is also present (checked via Aroma).
Is there any way to "fix" this?
in the recovery go to mount and storage then mount /system.It will be mounted as RW.
I have the e3 stock recovery, so there are only these options:
reboot system now
apply update from sdcard
wipe data/factory reset
wipe cache partition
use aroma file manager it have terminal.You can use it in recovery.
or try adb remount
Yes, I know about the aroma terminal and I also tried some commands in it, but without a positive result. But just to be sure, what command(s) did you have in mind?
And 'adb remount' returns:
remount failed: Operation not permitted
if you have e3 recovery that means you havent rooted your phone which means su wont work first root your phone
also it would be great if you could explain a little more as to what you want to accomplish
Oh.. That doesn't sound very good..
I need to modify some files in the system/framework folder.
Anyway, it should be rooted, because I already replaced a system file.
I just found out on the web that in the system settings on CM10 -> Developer settings -> you can set root access also for ADB.
Maybe it helps?

[How to][GUIDE] Bypass and Disable Password on lockscreen

Hello, as the title states I have found a way to bypass the password with the pin, pattern, and password option on the lockscreen without doing a factory data reset. I have not tried face unlock, I will try it soon. I would first like to thank Kosborn for his p2p-adb which bothe helped and gave me the idea. His p2p-adb can be located here.​
I will also be adding this feature to Kosborn's p2p-adb soon as well.
Now to get down to it.
What you will need:
Phone with eithier 'USB Debugging" enabled or a Custom Recovery
ADB
A file editor (I use Notepad++)
Basic adb skills
*If you already have "USB Debugging enabled please skip to Step 5*​
Step 1)
If the phone does not have USB Debugging enabled you need to flash a custom recovery to the phone. I will not post a step to step guide to on how to flash a custom recovery, just google it.
Step 2)
When you have the custom recovery flashed to the phone boot into recovery mode and mount /system. In CWM it can be found under "Mounts and Storage"
Step 3)
When /system is mounted pull build.prop and open it with the file editor I mentioned above.
Code:
adb pull /system/build.prop
You will have to add one line into the build.prop file for adb to be enabled when you reboot the phone
Add the line below to the build.prop file.
Code:
persist.service.adb.enable=1
Save build.prop file.
Now we have to push the file back to the phone so
Code:
adb push build.prop /system/build.prop
adb shell chmod 0644 /system/build.prop
Step 4)
Reboot phone
Run command below and you should see you device attached, If not make sure you have the correct drivers installed.
Code:
adb devices
Step 5)
Using adb type the following commands
Code:
adb shell mv /data/system/gesture.key /data/system/gesture.key.bak
adb shell mv /data/system/password.key /data/system/password.key.bak
Step 6)
Reboot phone
You should now be able to unlock your phone without having any password. And more importantly with having all of your data on the phone still.
If you found this helpful please hit the thanks button.
RESERVED
So this will work on any device correct?
---------- Post added at 10:55 PM ---------- Previous post was at 10:55 PM ----------
With either pin lock or pattern?
prairiedogn said:
So this will work on any device correct?
---------- Post added at 10:55 PM ---------- Previous post was at 10:55 PM ----------
With either pin lock or pattern?
Click to expand...
Click to collapse
In theory yes. I can't be for sure. It won't hurt it
When I had to use I typed "adb shell rm /data/system/gesture.key", not "adb shell mv /data/system/gesture.key" and that worked well.
eduds said:
When I had to use I typed "adb shell rm /data/system/gesture.key", not "adb shell mv /data/system/gesture.key" and that worked well.
Click to expand...
Click to collapse
That will work as well the reason why I used adb shell mv /data/system/gesture.key is to keep the file there when i was testing just incase but it could be removed as well.
not trying to be too much of a smart-butt, but heres the full version to do it, what u did is the basic commands, but leaves an empty pin/pattern for ANY input will be correct, heres each command (new line=new command):
adb shell
cd /data/data/com.android.providers.settings/databases
sqlite3 settings.db
update system set value=0 where name='lock_pattern_autolock';
update secure set value=0 where name='lock_pattern_autolock';
update system set value=0 where name='lockscreen.lockedoutpermanently';
update secure set value=0 where name='lockscreen.lockedoutpermanently';
.quit
busybox rm /data/system/gesture.key
busybox rm /data/system/cm-gesture.key
busybox rm /data/system/password.key
busybox rm /data/system/cm-password.key
busybox rm /data/system/locksettings.db
busybox rm /data/system/locksettings.db-wal
busybox rm /data/system/locksettings.db-shm
reboot
some kernels+file-systems(or user actions) convert databases to "wal", or "shm" so they will have different names, as for some newer CM-based rom builds, the pattern, gesture unlock (if implemented), and sometimes pin get put into a different file "cm-***.key" but pin+password goes into "cm-password.key";
u need to only do first two commands(adb shell, and the cd), then skip to after the .quit if u ARE NOT locked out, if u are u need to do ALL these commands, and if it says "file/directory not found" or simmalier errors when doing the "gesture.key","cm-gesture.key","cm-password.key", the "locksettings.db-wal" +"locksettings.db-wal"; just ignore those errors as u dont have the configurations stored in there like some other custom roms do =)
i found and compiled this list from my app i made, if u heard about it "SMS Tasks", and this is acually the exact code (in adb shell form, not in java command line with added characters, voids, etc...) to unlock the phone remotely =), idk why people tell me not to share this code, as its good for users to have so they dont lose their data incase of forgotten passwords on devices stored in their dressers/storages for ages and got out for whatever reason (maybee a new rom-tree was born for it and u want to see it in action, idk =S) but use this if u want, if not u can ignore this post, just wanted to share this with u incase u want to add some to the OP as the commands u do some roms might not fully unlock (it will erase pass/pin, but some roms keep the config that its still set, but any pass (even one characters+a single_space, or one-three dot patterns), so if anyone got those errors, or want more understanding on what files are used, this is my most resent list of things to delete by what i see used on rom developer's github's anyways =S
but hope this helps any of u in any ways =)
much simpler way
download aroma file manager from
http://forum.xda-developers.com/showthread.php?t=1646108
flash aroma file manager in cwm with system mounted
browse to data/system
delete gestures.key
delete password.key
restart
of course you will need aroma file manager on the root of your sd card so download it and put it there now for safe keeping
you can always put it there via a card reader or pop your sd card into another phone if your phone is already locked
Using Aroma File Manager would be the easiest way!
Thanks for the share Marcussmith2626!
There is a way to do this without USB Debugging enabled nor Custom Recovery installed, as long as stock Android system recovery <3e> "backup user data" option is working:
- create a backup
- modify the backup file
- root the phone
- restore backup
root is not required for backup, but for restore. i prefer restore from custom recovery. but i have done this without flashing, too.
please see this link
Android system recovery <3e> alternative restoring program
i know this is an old thread, but im trying to bypass the screen where it says that youve tried your pattern too many times on a zte z932l (also known as the rapido) for a friends sister. She really just wants the pictures that are stored on the internal memory is all because they are of her kids. Any ideas on how to get this done? I would up on this thread because i was hoping that usb debugging had been enabled, but it hasnt
no "backup user data" option in Android system recovery <3e> i guess? if you can't create a backup then my friend, this is the hardest case for unlocking... if playstore is working and wifi enabled, you can unlock using Android Device Manager first. if this not help, check if fastboot is working. you can boot custom recovery with "fastboot boot recovery.img" if no fastboot mode available, find any way to make a backup of usrdata partition (maybe in download mode?) once you have a backup, its easy to modify and restore (as long as FRP lock is disabled)
with usb debugging enabler you can modify a rom and flash it via odin (without losing data???), and with Android Multi Tools you can unlock the screen. if this is possible for samsung devices, then there should be a way for other phones, too. another way is to enable adb via sideload, if someone will create such app.
and of course, if fastboot mode is available, the easiest way is booting a custom recovery without flashing it. then just delete /data/system/locksettings.db* files from adb or with aroma file manager (try calung version 1.80)

[Q] Disabling ART from ADB or otherwise

Fairly straightforward question. Is it possible to disable ART and re-enable Dalvik other than via the settings dialog, either via ADB, some sort of flashable zip or from a recovery?
I ask for two reasons. Firstly, when I flashed an experimental 4.4 build on my Galaxy Nexus, I made the mistake of enabling ART. When I restarted, because I'd stupidly flashed an incompatible gapps package, apps would force close so frequently that the constant notifications made it extremely difficult to get into the settings and turn it off again.
Secondly, I just saw a thread on Reddit where somebody was claiming that their Nexus 5 went into a bootloop after enabling ART, and they had to do a wipe to fix it.
So it seems to me it would be quite helpful to be able to disable or enable ART without having to be able to boot.
If you've found a way to fix this, I would love to know. I just turned ART on after installing a new rom, and I'm stuck in a boot loop without a recent backup.
+1
I've enabled ART on my Nexus 4 without issue. Stock ROM.
Enabling it on my 2013 Nexus 7 caused it not to boot past the boot animation anymore.
Just reflash the ROM from recovery. Wipe system and flash. Done. Dalvik will be enabled again. If your not rooted that's another matter but the OP seems to be.
theesotericone said:
Just reflash the ROM from recovery. Wipe system and flash. Done. Dalvik will be enabled again. If your not rooted that's another matter but the OP seems to be.
Click to expand...
Click to collapse
I figured flashing wiping would do it but wasn't willing to wipe if there's an easier solution.
In my case it was Xposed. I flashed the disable zip and that did it. Guess I didn't reboot fully after disabling it from in the ROM.
He said wipe system, not data. It is possible to wipe the system information and leave your data intact.
MisterEff said:
He said wipe system, not data. It is possible to wipe the system information and leave your data intact.
Click to expand...
Click to collapse
Ah yes. I mistook system as data..
I don't know if it allow to switch runtime, but it helps me to avoid bootloop after ota 4.4.2 on my Nexus 5.
To check current library
adb shell getprop persist.sys.dalvik.vm.lib
To set art one
adb shell setprop persist.sys.dalvik.vm.lib libart.so
(IRoN) said:
I don't know if it allow to switch runtime, but it helps me to avoid bootloop after ota 4.4.2 on my Nexus 5.
To check current library
adb shell getprop persist.sys.dalvik.vm.lib
To set art one
adb shell setprop persist.sys.dalvik.vm.lib libart.so
Click to expand...
Click to collapse
adb pull /data/property/persist.sys.dalvik.vm.lib
open the file and replace the "libart.so" with "libdvm.so" (no quotes)
adb push persist.sys.dalvik.vm.lib /data/property/
Reboot and smile
twistedumbrella said:
adb pull /data/property/persist.sys.dalvik.vm.lib
open the file and replace the "libart.so" with "libdvm.so" (no quotes)
adb push persist.sys.dalvik.vm.lib /data/property/
Reboot and smile
Click to expand...
Click to collapse
THANK YOU!!!! It worked for me
twistedumbrella said:
adb pull /data/property/persist.sys.dalvik.vm.lib
open the file and replace the "libart.so" with "libdvm.so" (no quotes)
adb push persist.sys.dalvik.vm.lib /data/property/
Reboot and smile
Click to expand...
Click to collapse
Thanx, it worked for me
twistedumbrella said:
adb pull /data/property/persist.sys.dalvik.vm.lib
open the file and replace the "libart.so" with "libdvm.so" (no quotes)
adb push persist.sys.dalvik.vm.lib /data/property/
Reboot and smile
Click to expand...
Click to collapse
It worked for me too, and I don't even use Nexus device, And done it from adb but in recovery mode with properly mounted partitions.
Thx again.
Boot into Recovery and Fix Permissions has fixed this for me (Galaxy Nexus)
EDIT: Apparently that switches it back to dalvik?!?
twistedumbrella said:
adb pull /data/property/persist.sys.dalvik.vm.lib
open the file and replace the "libart.so" with "libdvm.so" (no quotes)
adb push persist.sys.dalvik.vm.lib /data/property/
Reboot and smile
Click to expand...
Click to collapse
Thanks, this help save my day !
Saved my day too! HTCONE on Viper and I was able to use twrp and a USB otg drive. Thanks!
Sent from my HTCONE using Tapatalk
Quicker way to switch back to Dalvik
My phone was stuck in a bootloop because I did not have enough free space to switch to ART, making my device crash on boot. For a quick way to switch back to Dalvik, see below.
Boot into recovery ('adb reboot recovery' if possible), then mount /data and run this command:
Code:
adb shell "echo libdvm.so > /data/property/persist.sys.dalvik.vm.lib"
adb reboot
It will now be in Dalvik. Enjoy

[Q] SystemUI doesn't start

I know what the problem is, I installed CyanLock from Xposed, then after rebooting, SystemUI won't start anymore, It says that "Unfortunately, System UI has stopped" and, obviously keeping me from unlocking, how can I get it off? or at least how can I copy my files to a computer for wiping without unlocking?
EDIT: Android 5.1. Moto G XT1032 (XT1034 Hardware)
According to this thread you should boot into TWRP and then using Advanced > Terminal command execute this command:
Code:
touch /data/data/de.robv.android.xposed.installer/conf/disabled
This will disable xposed completely and so if you want it back you'll have to either remove this file (su; rm /data/data/de.robv.android.xposed.installer/conf/disabled) or reflash xposed.
[Solved] [Q] SystemUI doesn't start
Eregus said:
According to this thread you should boot into TWRP and then using Advanced > Terminal command execute this command:
Code:
touch /data/data/de.robv.android.xposed.installer/conf/disabled
This will disable xposed completely and so if you want it back you'll have to either remove this file (su; rm /data/data/de.robv.android.xposed.installer/conf/disabled) or reflash xposed.
Click to expand...
Click to collapse
Thanks! I'll try it out... EDIT: It worked! Thanks!!!

Categories

Resources