Renaming an Android shortcut in TouchWiz (the hard way)

February 23, 2014

Warning: the information presented below might break your phone. It’s quite easy to make a typo and delete all your shortcuts… which will leave you pretty much up the creek. I probably should have backed up launcher.db before I did all this, but I didn’t. Shame on me. So don’t do this unless you know what you’re doing. If you break things it’s not my fault.

I recently switched from using Astro File Manager to ES File Explorer. In almost all respects, ES File Explorer is a better file manager – but it has one significant shortcoming. In Astro, you can create a shortcut and specify its name at create time; in ES File Explorer your shortcut is named whatever the file was originally named.

This left me with ugly file names (including extension) on the home screen. I needed a way to rename. Lots of articles on the web pointed to apps that would do it, but it seemed unnecessary to have to download a whole other app just to rename something. In the end I figured out how to do it.

To start with, you’ll need the following (all of which I had installed on my phone already):

Incidentally, my phone is a Samsung Infuse running Froyo… other phones may be different, and I don’t think you’ll find TouchWiz on non-Samsung phones.

First, I had to locate where the TouchWiz database was on my phone. This thread on xda-developers pointed me to /dbdata/databases/com.sec.android.app.twlauncher/launcher.db.

So… start up Terminal Emulator and do:

$ su
# cd /dbdata/databases/com.*twlaunch*
# pwd
pwd
/dbdata/databases/com.sec.android.app.twlauncher
# ls
shared_prefs
launcher.db

Groovy, there’s the launcher.db in the right place. Next I inspected it with sqlite3:

# sqlite3 launcher.db
SQLite version 3.7.6.3-Titanium
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema
CREATE TABLE android_metadata (locale TEXT);
CREATE TABLE apps (_id INTEGER PRIMARY KEY,componentname TEXT,top_number INTEGER NOT NULL DEFAULT 65535,page_number INTEGER NOT NULL DEFAULT 65535,cell_number INTEGER NOT NULL DEFAULT 65535);
CREATE TABLE favorites (_id INTEGER PRIMARY KEY,title TEXT,intent TEXT,container INTEGER,screen INTEGER,cellX INTEGER,cellY,INTEGER,spanX INTEGER,spanY INTEGER,itemType INTEGER,appWidgetId INTEGER NOT NULL DEFAULT -1,isShortcut INTEGER,iconType INTEGER,iconPackage TEXT,iconResource TEXT,icon BLOB,uri TEXT,displayMode INTEGER);
CREATE TABLE gestures (_id INTEGER PRIMARY KEY,title TEXT,intent TEXT,itemType INTEGER,iconType INTEGER,iconPackage TEXT,iconResource TEXT,icon BLOB);
sqlite>

My educated guess based on the tables and what was in them was that the table “favorites” would be useful. Not only did it have a title and an intent, but cellX, cellY, spanX and spanY looked like things that might be used for shortcuts.

From there it was simple to look at what was in the table:

sqlite> select * from favorites;
...
149|VE_Manual_Web_FINAL_2013.pdf|file:///mnt/sdcard/saved-pdf/VE_Manual_Web_FINAL_2013.pdf#Intent;action=android.intent.action.VIEW;type=application/pdf;launchFlags=0x10000000;end|-100|1|1|2|1|1|1|-1||0|com.estrongs.android.pop|com.estrongs.android.pop:drawable/format_pdf|||

Luckily, it looks like shortcuts are added by _id, and the number for _id increases as new shortcuts are added. That means the latest shortcut added is probably going to be at or near the end.

So… update the record and see what happens:

sqlite> update favorites set title="VE Manual" where _id=149;
sqlite> .quit
#

Then go back to the launcher and look at my shortcut. Boo, it’s still the same as it was. So then kill TouchWiz by holding “Home”, clicking the “Ram Manager” tab, pressing the “Level 2” button and then the “Clear Memory” button… success! The shortcut is renamed. Tapping it causes the same behaviour as before… in all respects it’s the same shortcut, just the title has changed.

Incidentally, I ran into what looks like a problem with doing this. If I rename the shortcut then reboot, the shortcut loses its icon information. I think this has something to do with ES File Explorer being stored on SD. Strangely, it doesn’t happen when I don’t rename the file. Astro fills in the icon BLOB, but ES File Explorer doesn’t.

Advertisements

Repairing a Samsung LN32A450

December 12, 2012

I own a Samsung LN32A450 TV set, which has been fairly good so far… until last weekend, when it didn’t turn on. Instead, the power LED flashed steadily at about one flash every 500 ms.

It seems that my TV set suffered from the capacitor plague. A bunch of the Samwha capacitors swelled up and were no longer to spec. I could order a replacement board (the board is BN44-00214A available from findparts4you.com). A little searching showed that others had successfully revived their power boards just by replacing the capacitors.

First, I had to open the TV set. This involved removing 16 screws (all the same size) from the back. I discoverd I had to be careful with the ones marked “S” – those four also hold the TV stand in place, so I wanted to remove them last. Also, there’s a screw on the back panel below the “EX-Link” connector, and another one on the back underneath the A/V 2 inputs.

Once I did that I could slide the back off (face down, since the support was unscrewed). The power board is the one in the middle. There are five connectors to disconnect from there: two at the upper left, one at the upper right, and two power connectors that go to the lower right. In my case they stayed in the right position once I removed them because there was tape holding them to the flat panel.

After that, I removed 6 small screws that held the power board in. I didn’t need to remove any of the standoffs – they’re just there to push the board away from the flat panel.

When I investigated the board, I could see the telltale swelling of capacitors that indicated problems. I saw problems with four capacitors:

CB852 in the middle right of the board: 2200 uF 10V
CW856 near the top left: 470 uF 25V
CW858 right below CW856: 680 uF 25V
CM868 right below CW858: 680 uF 35V

Some people reported success with using Radio Shack replacement capacitors. I was a little nervous about that – these caps are all rated to 105 degrees C and have high ripple current tolerance, and I didn’t want to swap in something I’d just have to replace later. I ended up getting replacements from Digi-Key. They have a minimum $25 order (otherwise they charge you $5 for handling). Luckily I had some other stuff to buy at the same time.

I replaced them with the following:

CB852: Panasonic EEU-FC1A222L (Digi-Key part P11189-ND)
CW856: Panasonic EEU-FM1E471 (Digi-Key part P12388-ND)
CW858: Panasonic EEU-FM1E681 (Digi-Key part P12390-ND)
CM868: Panasonic EEU-FM1V681 (Digi-Key part P12417-ND)

The replacement for CB852 was about 1 cm taller than the original part, and that made it the tallest part on the board. I was a little worried about that, but there seemed to be enough clearance that it didn’t cause a problem.

These capacitors are electrolytic and have a polarity, so I had to replace them the same way ’round that the originals were. Luckily, on my circuit board all the negative terminals were marked with a white semicircle underneath the capacitor.

After that, I plugged the cables back into the board (not forgetting the single-pin green ground cable). Then I put the 6 screws back.

Next I put the cover back on and put the 16 screws back in. I started with the base “S” screws, then the top three, then kind of haphazardly put the rest in the right places.

Then I powered up. Success! The TV came on and was as good as it was before this happened.

A few links I found useful:
forums.cnet.com/7723-13973_102-334836/samsung-ln32a450-died/
forums.cnet.com/7723-13973_102-401147/samsung-ln32a450-power-light-blinking-but-does-not-power-up/
forums.cnet.com/7723-13973_102-359389/samsung-lcd-tv-ln-t5265f-black-screen-diagnosis-help/
www.samsung.com/us/capacitorsettlement/


Rooting the Samsung Infuse with SuperOneClick

May 6, 2012

After spending ages trying to root my Samsung Infuse (i997) running Android 2.2 with SuperOneClick on my Windows XP box, I finally did the right thing: blew it away and installed Windows 7. With that, I was able to root the Infuse this afternoon.

I used:

After rooting, I rebooted the device. It worked with no problems. I shot the developer of SuperOneClick a donation ’cause why not.

Later I installed TitaniumBackup, which gave me a warning message about the access rights to su and offered to correct it. I said to go ahead and it did:

Access rights on the “su” binary were successfully correced from “0:2000 [6755]” to “0:0 [6755]”. Please reboot your device for the changes to apply.

I think that changed it from root.shell to root.root.

At any rate, now I know I can root the Infuse.

I wasn’t able to root an Infuse running 2.3.5 Gingerbread. Instead I had to use this XDA post, Odin, and reflash a new ROM.


Modeline for Samsung LN32A450C

October 25, 2009

When I switched my video card after the capacitors burnt out on the old one, I found I could no longer do 1366×768 video on a Samsung LN32A450C. Most frustrating was the fact that I’d see the video for about four seconds, before the TV decided it didn’t want to display it and showed “Mode not supported”.

Apparently, this is a common problem with Samsung TVs – and cvt was no help.

Luckily, I found this post – so here is the modeline for the Samsung LN32A450C

Modeline "1360x768" 85.500 1360 1440 1552 1792 768 771 777 795 +hsync +vsync

I just had to add that to my Monitor section of /etc/X11/xorg.conf and the autodetection on Ubuntu 9.04 did the rest. This is actually 1360×768, not the specified 1366×768 that Samsung is supposed to support – but I don’t miss the few pixels on either side.