[Dev Tool] Fix Broken Installed Apps / fix packages.xml - G1 Android Development

This tool is mainly for Dev's
It reinstalls all apks on /data/app /data/app-private
I noticed when playing around too much with apps - It would get the error saying sigs in package don't match packages.xml (android.something.blah)
I would just throw this in a build in case
I made it to save my life when I deleted my packages.xml accidentally
Code:
#! /system/bin/sh
#
# Application fix and reinstall by Wes Garner
#
echo "--- Reinstalling Applications";
for apk in /data/app/*.apk ; do
pm install -r $apk;
done;
for apk in /data/app-private/*.apk ; do
pm install -r $apk;
done;
echo "--- Fix Permissions";
/system/bin/sh /system/bin/fix_permissions;

I have many "XXX.apk does not exist" when running the fix_permissions script. I tried your fixapp.sh, but it only reinstall one app and stop with a prompt "SUCCESS".

Hey nice tool.
Found this thread after googling up packages.xml... I noticed that it was missing while testing stuff lol

zeppelinrox said:
Hey nice tool.
Found this thread after googling up packages.xml... I noticed that it was missing while testing stuff lol
Click to expand...
Click to collapse
It's weird how a lot of tools used nowadays originate from the G1 forums... you see the apktool thread bump up often for example even though things like that were made years ago.

Well reinventing the wheel is hard to do lol
All you can do is tweak it/mod it/add to it/customize it...
But its still the same at its core
I just may add this to SuperCharger (have it generate an "App Repair" script)
btw didn't cyanogenmod originate on the G1?

Sure did, most of the well known devs came from here, and most others use this thread as a referance to their own work
Sent from my Nexus One using xda app-developers app

ok.i edited packages.xml (removed a non existed package)
i move packages.xml to /data/system/ replacing previus one.
deleted dalvik
reboot.
stuck at bootloop
if i dont delete dalvik phone rebbots ok but packages.xml is restored to previus state...
what else can i do?

Related

(Solved) ADP1.5 (any) App2sd, After Wipe, Market No Longer Autoupdates Apps

First let me say that tho' I may not post here frequently, but I am an avid fan and supporter of this community. Much praise to all those who have so diligently worked on the custom roms, such as JF, Haykuro, TheDude, etc., and to their continuing cooperation and advancement.
However I come with an issue, that I have looked for a solution but have not been able to find one. And while I do dual boot with Jaunty, I am in no way a guru to have time to understand Android's systems. I do hope this would be fixed just for a more 'official' method of updating instead of aTrackDog.
After running nandroid for safety, wiping and flashing a new 1.5 ROM (Dude's .8, .92, .93, Haykruo's ADP1.5H [No JF yet, tomorrow]), then restoring apps and links through either manual method (I just adb the entire process for convenience) or through the apps2sd app (also for convenience). The official Market app does sync in some way with what is installed on the phone, until you go into the market, at which point it asks you if you want to install it to replace the version you have.
I am curious if there is a way to backup your Market application settings before wiping (I prefer to wipe, even if they are 'nowipe' builds, as I go from different developer's builds frequently too) so after redo the app2sd on your new install, you won't have to run aTrackDog to get your updates. Not going through and installing every single application is a plus too, why have more apps if we can just backup and transfer settings somehow?
As I previously mentioned, I don't know the Android system, or specifically the Market and Application systems, so I don't know if this could be done. Also, if I am the only one experiencing this, I would like to know how I am doing this improperly.
Update: Thanks goes to beagz for supplying the information and giving credit to haitiankid4lyf (http://forum.xda-developers.com/showpost.php?p=3655174&postcount=44)
It's not just you, that's how it works. But I don't see a problem running atrackdog.
I guess there is a file that you can transfer and it will make market remember your apps. Though I might be wrong. If it was that easy, someone would have figured it out by now.
Somebody discovered and posted this. I tried and it works.
mkdir /sdcard/market
cp /data/data/com.android.vending/databases/assets.db /sdcard/market/assets.db
To restore use
rm /data/data/com.android.vending/databases/assets.db
cp /sdcard/market/assets.db /data/data/com.android.vending/databases/assets.db
beagz said:
Somebody discovered and posted this. I tried and it works.
mkdir /sdcard/market
cp /data/data/com.android.vending/databases/assets.db /sdcard/market/assets.db
To restore use
rm /data/data/com.android.vending/databases/assets.db
cp /sdcard/market/assets.db /data/data/com.android.vending/databases/assets.db
Click to expand...
Click to collapse
Cool! It is an easy solution after all.
Thank you for sharing.
Cool, so just run the first two lines in the termainl and it will fix the issues?
Minker17 said:
Cool, so just run the first two lines in the termainl and it will fix the issues?
Click to expand...
Click to collapse
If you have not made backup prior to flashing a new ROM, this method will not help.
The first 2 are run before a wipe. After run market so that it is set then run the restore commands , reboot and you are set.
Just to clarify. This assumes you are starting from a stable running OS and are preparing to upgrade. All your apps must already be installed.
1) Run these commands to backup your market settings.
mkdir /sdcard/market
cp /data/data/com.android.vending/databases/assets.db /sdcard/market/assets.db
2) Install and wipe to update to the new build you want to use. (you don't need to do any of this if you are not wiping)
3) Complete the setup of your phone.
4) Start the market and agree to terms and conditions.
5) Run the second set of commands to restore your market settings.
rm /data/data/com.android.vending/databases/assets.db
cp /sdcard/market/assets.db /data/data/com.android.vending/databases/assets.db
6) Reboot and restart the market. All your apps should now be listed under downloads and should update as usual.
7) Kick back and smile since you do not have to redownload and install your apps again
beagz said:
The first 2 are run before a wipe. After run market so that it is set then run the restore commands , reboot and you are set.
Just to clarify. This assumes you are starting from a stable running OS and are preparing to upgrade. All your apps must already be installed.
1) Run these commands to backup your market settings.
mkdir /sdcard/market
cp /data/data/com.android.vending/databases/assets.db /sdcard/market/assets.db
2) Install and wipe to update to the new build you want to use. (you don't need to do any of this if you are not wiping)
3) Complete the setup of your phone.
4) Start the market and agree to terms and conditions.
5) Run the second set of commands to restore your market settings.
rm /data/data/com.android.vending/databases/assets.db
cp /sdcard/market/assets.db /data/data/com.android.vending/databases/assets.db
6) Reboot and restart the market. All your apps should now be listed under downloads and should update as usual.
7) Kick back and smile since you do not have to redownload and install your apps again
Click to expand...
Click to collapse
Also worth noting: this wont work if you go from rc33 to cupcake. I tried it and after restoring the database, market force closes on launch. Fortunately I made a backup of the new assets.db before I restored the old one.
@Azlum: Good to know. Never tried it before I was using the cupcake builds.
Wow this is so awesome, thamk you very much, this is exactly what I have been looking for. This makes apps2sd absolutely perfect for me now. I think I am going to add this to the wiki if at all possible. Thank you so much again.
I didn't wipe from JF RC33 to JF 1.5, had my apps to SD, and the market showed me having about half of my apps installed. Don't know why, but that's what it did.
well, my lazy ass didnt backup, so ill continue to use atrackdog. works for me
Just to let everyone know. I was very glad to help. However, it should be noted that as I stated I found this script posted by someone else. I feel that it is proper to credit
"haitiankid4lyf"
for posting this in the Gscript thread post # 44.
Thank you haitiankid4lyf! for posting this script so that we could use it to make recoveries easier!
beagz said:
Somebody discovered and posted this. I tried and it works.
mkdir /sdcard/market
cp /data/data/com.android.vending/databases/assets.db /sdcard/market/assets.db
To restore use
rm /data/data/com.android.vending/databases/assets.db
cp /sdcard/market/assets.db /data/data/com.android.vending/databases/assets.db
Click to expand...
Click to collapse
HOLY CRAP. That saved my life. This post should be stickied.
I believe that during the initial app2sd development, people experimented with moving the entire /data/data directory, which was unstable and is now not recommended (I never did it as I didn't want that many I/O operations wearing down the life of my card, tho' it is class 6) and I believe we wouldn't need to do this if we were to have /data/data ported.
I would also like to reference this thread http://forum.xda-developers.com/showthread.php?p=3729952 that details the backing up (and restoration) of specific application settings as this I believe would be useful for some (as it is for me). Integration of this into something like aTrackDog would be absolutely amazing, the reason why I say aTrackDog is since it already tracks applications and wouldn't just be copying the whole directory including system components (as the point of this is having things similar AFTER doing a wipe).
Anyway, just my two cents.
Wait...will this work if I backup with nandroid before I upgraded to 1.5?
What I did was setup a gscript to backup all the data to the sdcard.
cp -f -r /data/data/* /sdcard/backups/---mylocation--
You could reverse / restore by doing it in reverse and then chmoding as you said.

Google Voice Search/Maps Force Closes on Modaco 1.1

Don't mean to start too many threads, but this is meant to specifically discuss the above programs.
RE: Google maps
Completely uninstalling and then reinstalling from the market seems to address the force close that occurs when a search query is submitted.
Alternatively, you can move the google maps apk from the ext2 partition to the /system/app folder on the phone. This is the same fix as for the google voice search...
RE: Google voice search
I went about the rather cumbersome process of moving the apk from the ext2 partition (as automatically happens in the Modaco ROM) back to the /system/app folder on the phone. This has resolved all the voice search crashes that I have come across.
NB: I do not know the results if you were to fix google maps by uninstalling and reinstalling and fix google voice search by moving the apk. I.e. if you were to do a google voice search within google maps under this fixing method, Im not sure if the voice search will crash....I'm guessing not though.
Please bear in mind im a COMPLETE linux/andoird/adb/whatever noob. I can outline my method for moving the apks, but Im certain there are better ways to do it.
Sweet, that fixed my google voice issue (and a quick mv and reboot didn't seem so bad to me, but perhaps I just have a high pain tolerance lol)
that or i didn't know there was an mv command...like i said...complete noob
dom2114 said:
that or i didn't know there was an mv command...like i said...complete noob
Click to expand...
Click to collapse
No sweat, mv is a linux command that can be used to move (thus mv) or rename files.
Basic Syntax:
Code:
mv [source] [destination]
So what I did was
Code:
mv /data/app/com.google.android.voicesearch.apk /system/app
and then rebooted the phone. Worked like a champ!
thanks, worked perfectly
NOTE: be sure to issue this command before the move to not get the 'read-only file system' error
$ su
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Thanks a ton for this! I don't have A2SD running and my Google Voice Search was also not working, I didn't even notice until someone had pointed it out. Lucky for me, there was a solution almost as fast as the problem was discovered! We should probably point it out to Paul @ MoDaCo now!
tstack77 said:
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
Alternatively, the following command works on MoDaCo's ROM:
Code:
adb remount
It accomplishes the same thing and is waaaaay easier for my simple mind to remember.
thecodemonk said:
Code:
adb remount
It accomplishes the same thing and is waaaaay easier for my simple mind to remember.
Click to expand...
Click to collapse
haha, totally agree. Thanks for that bit o' knowledge
AWESOME, thank you. I've been saving all of these forum posts together, I'll make a super-post once I get everything running the way I want, very clearly detailed and it will feature all of these different commands that I have used to help me along the way!
ok, so help me out if you can.
I want to copy the apk's on the ext2 partition i.e. in /system/sd/app to my computer in case I decide to wipe the sdcard for some reason.
In adb im typing:
cp /system/sd/app /desktop
Ive tried cp with the -r, -f, -rf options, and everytime i get a cannot create error message or sometimes a cannot create symlink message
Any tips??
dom2114 said:
ok, so help me out if you can.
I want to copy the apk's on the ext2 partition i.e. in /system/sd/app to my computer in case I decide to wipe the sdcard for some reason.
In adb im typing:
cp /system/sd/app /desktop
Ive tried cp with the -r, -f, -rf options, and everytime i get a cannot create error message or sometimes a cannot create symlink message
Any tips??
Click to expand...
Click to collapse
Once you're inside the adb shell, you don't really have access back to your desktop. Your best bet would be to run (from the windows command prompt where you normally run adb):
Code:
adb pull /system/sd/app c:\mybackup
(Replace C:\mybackup with whatever the path is to your destination...if you're on *nix or Mac, it will probably be more like "./Desktop" or something)
jesus, i think i might put a fist through a wall...im such an idiot.
pulling instead of pushing for the last half hour...
cheers, codemonk
dom2114 said:
jesus, i think i might put a fist through a wall...im such an idiot.
pulling instead of pushing for the last half hour...
cheers, codemonk
Click to expand...
Click to collapse
No sweat, we all have those moments. All the commands are fresh in my head since I've been researching and digging into things since before we had root (at the time trying to get it)...that and I think I've become addicted to the xda forums. (HALP!)
just as quick update to all.
Ive got a feeling that google voice search was actually causing all the force close issues in google maps. I still have google maps on my sdcard and did not uninstall it (only updated it) - have google voice search on phone and all seems to be fine.
A quick question for codemonk (& anyone else out there). For apps in the /system/app folder, you've got the apk and corresponding odex file. Anyone have any idea where the corresponding odex files for apps installed on the sd are (if they exist at all)?
dom2114 said:
just as quick update to all.
Ive got a feeling that google voice search was actually causing all the force close issues in google maps. I still have google maps on my sdcard and did not uninstall it (only updated it) - have google voice search on phone and all seems to be fine.
A quick question for codemonk (& anyone else out there). For apps in the /system/app folder, you've got the apk and corresponding odex file. Anyone have any idea where the corresponding odex files for apps installed on the sd are (if they exist at all)?
Click to expand...
Click to collapse
Not sure on the odex...I noticed some of the apps I removed didn't appear to have them (or are in a location I'm not aware of).
I ended up just moving the google voice app to fix it. (There's another thread on the google maps/google voice thing that contains the fix)
Ha, guess my XDA navigation isn't quite up to par. Care to post the link out of interest?
dom2114 said:
Ha, guess my XDA navigation isn't quite up to par. Care to post the link out of interest?
Click to expand...
Click to collapse
Wow I'm out of it...I was looking around, then realized...this *is* that thread. >.<
hahaha...guess it was your turn for onea those mistakes....
ok i dont even have voice search after installing modaco rom. all i have is the basic google search. how do i get the apk or download it. i tried the move, but it says it doesnt exist. i am complete noob so details are really needed thanks
if you decided to format your sdcard (using the recovery console) using the ext2/fat32/swap option, then the modaco ROM automatically moves google voice search and google maps (and a few other apps like quickoffice) to the ext2 partition on the sdcard.
this partition is accessible in various ways, but most people do it manually using ADB. if you don't know how to use adb, there are a bunch of threads here that talk about it. But in a nutshell, it involves downloading the android SDK, extracting it to somewhere on your computer (no need to install anything), open a command prompt in windows (start -> run -> cmd), navigate to the folder containing the sdk and go to the tools folder inside there (e.g. cd\androidsdk\tools), then type 'adb shell'. If all worked, you should have access to the phone.
then its just a matter of navigating to the ext2 partition on the sdcard (this is where all apps you install will be installed too - this is apps2sd automatically at work). You navigate there by typing:
cd /data/app
you should see the google voice search apk in there + others
then just use the command that codemonk helped me out with:
mv /data/app/com.google.android.voicesearch.apk /system/app
this will move the apk from the data/app folder (this is your sdcard) to the phone.
Written this response very quickly. Ask any specific questions and Ill try to help more if needed.

[Script] Darkness in the dark hours

hi everyone
I present to you:
Darkness in the dark hours​
this is a pack of:
- a script I made
- Gscript lite
- Screen filter(optional, but recommended)
I strongly recommend to you to read the whole post and only then apply my script!
A lot of users tried to find a way to do this, so I polished my script I used for Eternity to make it universal(hopefully )
this script made to work with rooted 2.1+ firmwares and busybox properly installed.
1. Install Gscript lite
2. To make this script revertable on the newer brand of kernels, you will need to add one line to hw_config.sh (because I just don't trust init.d scripts)
run this from adb or any terminal emulator from phone as superuser
Code:
echo "\n\n\nrm /data/noled_tmp_reverse.prop" >> /system/etc/hw_config.sh
3. in Gscript choose Add a script and name it whatever you want(e.g. NOLed) and paste these lines in it
Code:
#! /system/bin/busybox sh
# "turn off keyboard and notification LEDs" for ANY android firmware
# this script needs su access
# made by Adolf1994
# thanks for the help diimaan
# maybe final version - revertable
# requires hw_config.sh modification to be properly revertable
DIR=$(cd /sys && find | grep brightness | cut -c 3- | cut -d : -f 1 | head -n 1)
LED=/sys/$DIR
LED1=$LED:rgb1:red/brightness
LED2=$LED:rgb1:green/brightness
LED3=$LED:rgb1:blue/brightness
LED4=$LED:sled/brightness
if [ -s /data/noled_tmp_reverse.prop ]; then
chmod 00644 $LED1
chmod 00644 $LED2
chmod 00644 $LED3
chmod 00644 $LED4
rm /data/noled_tmp_reverse.prop
else
echo 0 > $LED1
echo 0 > $LED2
echo 0 > $LED3
echo 0 > $LED4
chmod 00444 $LED1
chmod 00444 $LED2
chmod 00444 $LED3
chmod 00444 $LED4
echo 1 > /data/noled_tmp_reverse.prop
fi
exit
4. tap on "Needs SU" then save
5. run the script and enjoy surfing at night without the annoying hw leds
(most likely you WILL get stderrs on 2.2+, but it's normal)
Note: if you get EMPTY stderrs, that's no problem. BUT if something is shown next to the stderr, like permission denied, then please report
optional. install Screen filter from market: https://market.android.com/details?id=com.haxor&feature=search_result
This is only for 2.1 and/or 2.2. On 2.3 I experienced a problem that's I couldn't press install in package installer activity. I nearly reinstalled the whole thing. You've been warned!
Night is over? Just run the script again and wait till the LEDs light up.
If You Don't Like LEDs At All, This Pretty Line Will Disable Them At Startup
http://forum.xda-developers.com/showpost.php?p=17514012&postcount=27
Q: Why modifying hw_config.sh?
A: Because if you reboot your phone while the leds are off, there will remain a file that normally indicates how the script should act upon running it. That one particular file should not present after boot.
Q: I'm on Wolfbreak's ROM. Won't that mess tweaks up?
A: In no way. Impossible. Unless you didn't follow steps properly.
hope you like it
and don't forget to press thanks button
can I use script manager to run this at boot?
I think it'd be fine
the script didnt work for me i went to my dolphin browser copied text pasted it saved i run it it showed up stderr twice that's it?
shahkam said:
the script didnt work for me i went to my dolphin browser copied text pasted it saved i run it it showed up stderr twice that's it?
Click to expand...
Click to collapse
i cant paste the text corectly ffs i think thats the problem can you upload the script as ".sh" so i can load it whit gscript?
shahkam said:
the script didnt work for me i went to my dolphin browser copied text pasted it saved i run it it showed up stderr twice that's it?
Click to expand...
Click to collapse
from gscript I get a bunch of stderrs, too. however, from a terminal emulator it runs fine, so no problem.
It's the most noticeable if the phone is on the charger, because you will see that the led suddenly switches off.
you can revert the script back with a simple reboot.
Sorry for being a noob, but what does this do? :$
It disables the l.e.d.s. It should be made a little clearer in op.
Is there a script to turn them back on?
Sent from my X10a using XDA App
AyDee said:
It disables the l.e.d.s. It should be made a little clearer in op.
Is there a script to turn them back on?
Sent from my X10a using XDA App
Click to expand...
Click to collapse
sorry if I wasn't clear. I'll fix it soon
and change it to revertable, too
Adolf any clue why it didnt work.for me and i kept having stderr thingy
Sent from my X10i using XDA Premium App
shahkam said:
Adolf any clue why it didnt work.for me and i kept having stderr thingy
Sent from my X10i using XDA Premium App
Click to expand...
Click to collapse
since they are empty it's ok
Huh? I think i wasnt clear i used your script and when i ran it whit gscript i got twice stderr message twice one under the other like this
Stderr
Stderr any clue why?
Sent from my X10i using XDA Premium App
shahkam said:
Huh? I think i wasnt clear i used your script and when i ran it whit gscript i got twice stderr message twice one under the other like this
Stderr
Stderr any clue why?
Sent from my X10i using XDA Premium App
Click to expand...
Click to collapse
for this script only gscript gives empty stderrs. if I run it with a terminal emulator/adb there's no stderr.
it's a problem of gscript
@Adolf or @My_Immortal
any new experiments with sd card mounting?
There was some interesting posts by one shaun in link2sd thread! he's using x10! somehow he managed to find more free space in /system than in /data!
so no need of an extra partition, you can just run the script to mount the /system as rw on boot and then link the link2sd mount point to it! I sent a PM to him about how is it working! let's see...
Ohhh but i tried terminal too pasted the script and nothing happened?
Sent from my X10i using XDA Premium App
I use this script most nights now, thanks Adulf! perhaps a mod to the script could be to set an expiry time value? (or is this not possible!)
diimaan said:
@Adolf or @My_Immortal
any new experiments with sd card mounting?
There was some interesting posts by one shaun in link2sd thread! he's using x10! somehow he managed to find more free space in /system than in /data!
so no need of an extra partition, you can just run the script to mount the /system as rw on boot and then link the link2sd mount point to it! I sent a PM to him about how is it working! let's see...
Click to expand...
Click to collapse
There are currently 190 MB free in my system partition, 219 MB in data and 11 GB in my sdcard, so I really want to use Links2SD on an ext partition in my SD, rather than anywhere else!
But it's nice that there's progress!!
My_Immortal said:
There are currently 190 MB free in my system partition, 219 MB in data and 11 GB in my sdcard, so I really want to use Links2SD on an ext partition in my SD, rather than anywhere else!
But it's nice that there's progress!!
Click to expand...
Click to collapse
190 mb? that's far less you should clean up some junk in your system then!
btw this is the msg I got from shaun! you can check how it works!
http://forum.xda-developers.com/show...&postcount=834
Should explain how to do it, just need to add commands to a start up script that is editable on your phone, that runs before the GUI is started. Dunno how I would create a universal script as you will need to edit diff files on diff phones.
If there is anything you don't understand from my post I'll try and help.
Click to expand...
Click to collapse
Brilliant this is exactly what i wanted, thanks Adolf !!
[email protected] said:
I use this script most nights now, thanks Adulf! perhaps a mod to the script could be to set an expiry time value? (or is this not possible!)
Click to expand...
Click to collapse
Adulf... hehh, funny
yyeeeeaaaaaaahhhh...no
that'd be a bit complicated.
but this is why it's revertable

(How-to) prevent Android Market app from updating itself

UPDATE: try this simpler method first: http://forum.xda-developers.com/galaxy-y/general/trick-how-to-disable-google-play-store-t2951378
BEFORE REPLYING: please know that I have tried all of the standard suggested solutions to prevent Market from updating, including freezing Market Updater, using pm disable on it, and turning off auto-updates for apps, and these do not work on Market versions >= 3.0.
On my Samsung Galaxy S2, the latest market app (3.4.4) randomly freezes my entire phone, causing me to have to hold the power button down to reboot. Happens nearly every time I browse for apps in that version. I can "uninstall updates" to get back to the version in /system, but it updates itself to 3.4.4 every time I run it. My goal: prevent the automatic updates.
Plenty of threads here and elsewhere have tips for preventing the updates. The problem is that none if them work for market versions beyond 3.0. I've discovered a method for preventing the updates even on more recent market versions.
Do "uninstall updates" on the market app (in "manage applications").
Open the terminal app.
Run "su" to become root.
Run: touch /data/app/com.android.vending-1.apk
Run: chattr +i /data/app/com.android.vending-1.apk
This will put a bogus APK file in the way of where Android wants to put the new version. The chattr command makes the file "immutable", so that even root can't remove it. Just setting it read only with chmod isn't enough.
This will pin your market to the version included in your ROM. This trick might work if you want to pin a version that's already in /data/app, if you skip the "uninstall updates" and the "touch" command... Haven't tested this.
I tried it, but it said "chattr: command not found".
lexelby said:
On my Samsung Galaxy S2, the latest market app (3.4.4) randomly freezes my entire phone, causing me to have to hold the power button down to reboot. Happens nearly every time I browse for apps in that version. I can "uninstall updates" to get back to the version in /system, but it updates itself to 3.4.4 every time I run it. My goal: prevent the automatic updates.
Plenty of threads here and elsewhere have tips for preventing the updates. The problem is that none if them work for market versions beyond 3.0. I've discovered a method for preventing the updates even on more recent market versions.
Do "uninstall updates" on the market app (in "manage applications").
Open the terminal app.
Run "su" to become root.
Run: touch /data/app/com.android.vending-1.apk
Run: chattr +i /data/app/com.android.vending-1.apk
This will put a bogus APK file in the way of where Android wants to put the new version. The chattr command makes the file "immutable", so that even root can't remove it. Just setting it read only with chmod isn't enough.
This will pin your market to the version included in your ROM. This trick might work if you want to pin a version that's already in /data/app, if you skip the "uninstall updates" and the "touch" command... Haven't tested this.
Click to expand...
Click to collapse
I've had the same problem and this looks quite promising, but I have the same problem w/ chattr not found. What terminal app are you running?
Oops, should have mentioned... You'll need busybox installed. It'll include the chattr command.
lexelby said:
On my Samsung Galaxy S2, the latest market app (3.4.4) randomly freezes my entire phone, causing me to have to hold the power button down to reboot. Happens nearly every time I browse for apps in that version. I can "uninstall updates" to get back to the version in /system, but it updates itself to 3.4.4 every time I run it. My goal: prevent the automatic updates.
Plenty of threads here and elsewhere have tips for preventing the updates. The problem is that none if them work for market versions beyond 3.0. I've discovered a method for preventing the updates even on more recent market versions.
Do "uninstall updates" on the market app (in "manage applications").
Open the terminal app.
Run "su" to become root.
Run: touch /data/app/com.android.vending-1.apk
Run: chattr +i /data/app/com.android.vending-1.apk
This will put a bogus APK file in the way of where Android wants to put the new version. The chattr command makes the file "immutable", so that even root can't remove it. Just setting it read only with chmod isn't enough.
This will pin your market to the version included in your ROM. This trick might work if you want to pin a version that's already in /data/app, if you skip the "uninstall updates" and the "touch" command... Haven't tested this.
Click to expand...
Click to collapse
Ok, I'm back to version 3.1.3. I really hope this works! This market freeze problem has been driving me nuts. This has been the first time I've become overly frustrated with Android. If a version of the market isn't working correctly on our phones, we should be able to run whatever version of the market we want without it automatically updating and forcing you to use the latest version.
Oh!! You have the freezing too? I searched all over but I couldn't find anyone else describing the same freezes. What device/ROM are you on?
lexelby said:
Oh!! You have the freezing too? I searched all over but I couldn't find anyone else describing the same freezes. What device/ROM are you on?
Click to expand...
Click to collapse
I'm currently on CM7 using the AT&T Galaxy S2. I try MIUI from time to time to see if the issue has been resolved, but it hasn't. I had my first market lockup on CM7 today. It's been frustrating the living hell out of me. I tried your suggestion and the market still updated. Hasn't locked up yet, but I haven't spent a lot of time on my phone either.
Any other alternatives? Did the proposed solution work for you?
Sounds like you and I have the exact same phone, carrier, and ROM. The fix did work for me... Hasn't updated since. Maybe try removing Market Updater with Titanium Backup too. Perhaps it falls back to that to update if the builtin mechanism fails... Not sure. You could also try the process again, but be super sure you close Market, "uninstall updates", and then do the touch and chattr. If all else fails you could take a screen video (can we do that on Android?) and I'll watch to see if maybe there's a step I missed.
Also, after going through the steps, run these and paste in the results:
ls -l /data/app/com.android.vending-1.apk
lsattr /data/app/com.android.vending-1.apk
Ok, I'm going to try all of this later today when I get a chance. Will post back with an update asap.
Also, do you remember the results that came up after running every command? I'm going to try to post everything that comes up so you can take a look for yourself.
How long have you been running the market without it updating? I know quite a few people that could benefit from this if it works consistsntly. We are not some rare group. This is a pretty widespread issue here.
Sent from my SGH-I777 using Tapatalk
My market's been on version 3.1.3 since the day before I posted this thread, and it hasn't updated at all. I really think we can get this working for you too... We just need to figure out if I forgot to include a step. The two commands both actually give no feedback at all, so the ls and lsattr will tell us whether things worked properly.
So this problem is widespread? My Google-fu fails me, apparently. Is it just sgh-i777 users on cm7?
Here are my results. Note, the first time I did this, after one of the steps, I got something "not found." I don't remember what it was. But anyways:
$ export PATH=/data/local/bin:$PATH
$ su
# touch /data/app/com.android.vending-1.apk
# chattr +1/data/app/com.android.vending-1.apk
BusyBox v1.19.3 (2011-11-22 01:37:10 MST) multi-call binary.
Usage: chattr [-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]...
Change file attributes on an ext2 fs
Modifiers:
- Remove attributes
+ Add attributes
= Set attributes
Attributes:
A Don't track atime
a Append mode only
c Enable compress
D Write dir contents synchronously
d Don't backup with dump
i Cannot be modified (immutable)
j Write all data to journal first
s Zero disk storage when deleted
S Write file contents synchronously
t Disable tail-merging of partial blocks with other files
u Allow file to be undeleted
-R Recurse
-v Set the file's version/generation number
# ls -l/data/app/com.android.vending-1.apk
ls: invalid option -- /
BusyBox v1.19.3 (2011-11-22 01:37:10 MST) multi-call binary.
Usage: ls [-1AaCxdLHRFplinsehrSXvctu] [-w WIDTH] [FILE]...
List directory contents
-1 One column output
-a Include entries which start with .
-A Like -a, but exclude . and ..
-C List by columns
-x List by lines
-d List directory entries instead of contents
-L Follow symlinks
-H Follow symlinks on command line
-R Recurse
-p Append / to dir entries
-F Append indicator (one of */[email protected]|) to entries
-l Long listing format
-i List inode numbers
-n List numeric UIDs and GIDs instead of names
-s List allocated blocks
-e List full date and time
-h List sizes in human readable format (1K 243M 2G)
-r Sort in reverse order
-S Sort by size
-X Sort by extension
-v Sort by version
-c With -l: sort by ctime
-t With -l: sort by mtime
-u With -l: sort by atime
-w N Assume the terminal is N columns wide
--color[={always,never,auto}] Control coloring
# lsattr /data/app/com.android.vending-1.apk
--------A---- /data/app/com.android.vending-1.apk
#
I just looked at the options and it looks like I inserted an "L" instead of "I" to make the file immutible. Correct? Let me know if I did something wrong so I can go back and try again.
Aha! Now we're getting somewhere. The command should be... "chattr space plus lower-case I space /data/app/com.abdroid.vending-1.apk"... that's "vending dash one dot apk". The ls command is "ell ess space dash ell space /data/app/com.abdroid.vending-1.apk". Can you just copy/paste the commands from the OP?
lexelby said:
Aha! Now we're getting somewhere. The command should be... "chattr space plus lower-case I space /data/app/com.abdroid.vending-1.apk"... that's "vending dash one dot apk". The ls command is "ell ess space dash ell space /data/app/com.abdroid.vending-1.apk". Can you just copy/paste the commands from the OP?
Click to expand...
Click to collapse
Well I'll be damned! I'm going to give this a try.
Do avoid spelling android as "abdroid" like I did, though
lexelby said:
Do avoid spelling android as "abdroid" like I did, though
Click to expand...
Click to collapse
Lol.
Ok, I think I got it. Take a look.
$ export PATH=/data/local/bin:$PATH
$su
# a/app/com.android.vending-1.apk
# a/app/com.android.vending-1.apk
# ls -l data/app/com.android.vending-1.apk
-rw-rw-rw- 1 0 0 0 Jan 11 16:06 data/app/com.android.vending-1.apk
# lsattr data/app/com.android.vending-1.apk
-----i--A---- data/app/com.android.vending-1.apk
#
Don't know why some of it's cut off. I'm not a terminal emulator expert.
That looks right. Now run Market. It should be at 3.1.3, and if you close it, wait a minute, and reopen it, it should still be 3.1.3. If it's updated, then I guess we go back to the drawing board...
Ok ,I ran it and restarted it and it's still the same. Now keep in mind, I did this several times yesterday and about an hour later when I launched the market, it updated. Oh, while I have it in mind, let me freeze market updater, just to eliminate all possible causes. If this works, I owe you a beer! You just have no idea how frustrated I've been over the past month with this issue!
And for the record, type "android market freezes phone" in google search and see for yourself. We are NOT the only ones.
Oh trust me, I know just how frustrated you've been I was really starting to get pissed off at having to "uninstall updates" to safely use the market. I also think the freezes and resulting hard reboots caused the filesystem corruption that forced me to have to restore to factory and restore all of my apps from Titanium. That sucked.
i have another work around that might work. so far its sticking for me.
since the steps from OP is to prevent market from updating and staying at 3.1.3, i downloaded market 3.1.3.apk from here.
i went into root explorer and renamed 'vending.apk' to 'vending.apk.bak'. i didnt delete it incase if anything. just renamed as a backup.
i used tibu to freeze 'market updater'.
i copied market 3.1.3 apk into /system/app and set permission to rw-r-r.
reboot.
so far its working fine for me and its staying at 3.1.3. not sure for how long.

[Completed] can't get Radio3.apk back onto phone

Hi folks,
I removed Radio3 from /system/app because I was having an issue with my headphone jack and therefore the app wasn't useful (this is the stock FM Radio app that uses my phone's internal tuner).
Now, mysteriously, my headphone jack seems to be working again and so I wanted to put the Radio app back. Well, I've run into problems.
I have the original flashable firmware that I was using, so I mounted system.ext4 on my computer at /mnt/ and went to app/Radio3. Here, I found Radio3.apk and nothing more.
So, I've tried this three ways, one way is that I adb shell and then su. Then
Code:
# mount -o remount,rw /system
# mkdir /system/app/Radio3
Then I chmod and chgrp Radio3 so that it looks just like all of the other dirs in /system/app
Then I copy Radio3.apk into that dir and chmod and chgrp it as well. Reboot the phone and that's fine, but the app isn't installed, I don't see the icon in the app drawer. If I go to the apk in FileManager, I can click on it and the installer opens up, I say, sure install it and it says "App not installed" (what a helpful error message!?).
Okay, so I try another way, while still root, I say "pm install Radio3.apk", in this case, I get [INVALID URI].
Okay, so I try another way, this time I say exit and now, on my machine, I simply try to use adb to install the apk, "adb install -r Radio3.apk", in this case:
Code:
[email protected]:/mnt/app/Radio3$ adb install -r Radio3.apk
5446 KB/s (2667450 bytes in 0.478s)
pkg: /data/local/tmp/Radio3.apk
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]
Does anyone have any advice on how to get my Radio app working again without reflashing /system? I don't want to reflash /system because I've removed a lot of bloatware and I don't want to have to redo that.
Thanks for any tips or tricks!
In case it helps, I've attached the Radio3.apk to this thread. EDIT: I couldn't figure out how to add a file to the thread, but I'll happily post it somewhere if someone wants to look at it. In any case, it's just the stock Radio3.apk from Sony for their Z3Compact firmware.
Problem solved.
I think I didn't have all of the perms and grps set correctly. I triple checked everything in /system/app/Radio3 and rebooted and I saw (app 1 of 1 optimizing upon reboot). Well, now I find the icon so I can say this issue is solved.
Unfortunately, trying to run the app force closed But that's a separate issue so I'm closing the thread.
Cheers,
--apexofservice
apexofservice said:
Problem solved.
I think I didn't have all of the perms and grps set correctly. I triple checked everything in /system/app/Radio3 and rebooted and I saw (app 1 of 1 optimizing upon reboot). Well, now I find the icon so I can say this issue is solved.
Unfortunately, trying to run the app force closed But that's a separate issue so I'm closing the thread.
Cheers,
--apexofservice
Click to expand...
Click to collapse
Glad you got it sorted
Regards
Sawdoctor

Categories

Resources