Fixing APK Compile Error

I have been trying to change, decompile, and recompile Trebuchet to change the items on the dock and home screen.  I keep getting errors, and I think I have finally found the solution.

The output of the command is quite long, so let me post the beginning:


skp@chestnut:~/app/hd2/dev/work$ apktool b Trebuchet-orig Trebuchet.apk
I: Copying classes.dex file...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/values-sw720dp-land
invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/drawable-sw600dp-nodpi
invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/drawable-sw600dp-land-hdpi

And, here’s the end of the output:


invalid resource directory name: /home/skp/app/hd2/dev/work/Trebuchet-orig/res/layout-sw720dp
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL1399953021396634018.tmp, -I, /home/skp/apktool/framework/1.apk, -S, /home/skp/app/hd2/dev/work/Trebuchet-orig/res, -M, /home/skp/app/hd2/dev/work/Trebuchet-orig/AndroidManifest.xml]
 at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
 at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
 at brut.androlib.Androlib.buildResources(Androlib.java:248)
 at brut.androlib.Androlib.build(Androlib.java:171)
 at brut.androlib.Androlib.build(Androlib.java:154)
 at brut.apktool.Main.cmdBuild(Main.java:182)
 at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL1399953021396634018.tmp, -I, /home/skp/apktool/framework/1.apk, -S, /home/skp/app/hd2/dev/work/Trebuchet-orig/res, -M, /home/skp/app/hd2/dev/work/Trebuchet-orig/AndroidManifest.xml]
 at brut.util.OS.exec(OS.java:83)
 at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
 ... 6 more

What I finally found, was that I installed an old or invalid version of aapt with apktool.  It was installed into /usr/local/bin…


skp@chestnut:~/app/hd2/dev/work$ which aapt
/usr/local/bin/aapt
skp@chestnut:~/app/hd2/dev/work$ ll `which aapt`
-rwxr-x--- 1 skp skp 3747857 May 15 2011 /usr/local/bin/aapt*

The easy fix was to just rename this one installed with apktool.  Then, it pulled the one from my Android SDK intallation. (I already had the platform-tools directory in the path.)


skp@chestnut:~/app/hd2/dev/work$ cd /usr/local/bin/
skp@chestnut:/usr/local/bin$ sudo mv aapt aapt-broken
[sudo] password for skp:
skp@chestnut:/usr/local/bin$ which aapt
/home/skp/app/android-sdk-linux/platform-tools/aapt

After that, it compiled fine!

skp@chestnut:~/app/hd2/dev/work$ apktool b Trebuchet-orig Trebuchet.apk
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...

Microsoft Outlook on Linux

I’ve been using Word and Excel on my Ubuntu for a while now.  For the most part, it works pretty good.  Just recently, someone asked me about how Outlook worked.

My personal preference is GMail.  I like the interface, and I like having my mail in the cloud.  When I refresh my computer, it’s one less thing to have to backup.  For a while, I did use Thunderbird.  It works natively on Linux.  Still, I’ll explore Outlook for a second.

For the instructions on installing Office, you can see my post: Ubuntu 12.04: Office and Play on Linux

Read More

HD2 Android Cooking

This is my first delve into cooking my own ROM for HD2.  I am not at a point where I can give step-by-step directions, but I wanted to post some of the things that I figured out so far.

Danial’s (dsixda) Android Kitchen

I have heard a lot about the Android Kitchen, so I thought I would try it.  It was an easy install.  I just had to download the zip file from Git Hub and extract it into a directory:

To launch it, I go to that directory in a terminal…

… and run the ./menu command.  That brings up the Kitchen menu.

Importing My First ROM

I started with the Paranoid Android – AOKP – Sourcery ROM.  I simply downloaded it, and placed it in the

Then, on the menu, I chose option 1 to create the working folder.

When it was done, it created this working directory:

Adding My First App

Just to make a small easy change, I decided to add an app to the ROM.  I have been using the Wifi Tether program, and I decided to bake that into the ROM.  It was as easy as placing it into the working folder under data/app.

This worked fine, but for some reason, the wireless tethering won’t work on my ROM.  The app works fine, but when it tethers, it gets an error.   That’s an issue for troubleshooting another day.

Changing the Default Background

I found some instructions that suggested using the apktool program to update the background.  But, rather than that, I just used the File Roller to extract and replace the files in the apk file.

I found the framework-res.apk file inside the system/framework folder in the working directory.  I opened the file with file-roller and I went to the /res/drawable-hdpi folder.  There I extracted the default_wallpaper.jpg.

I simply edited the image with Gimp and replaced it in the apk file.

This worked great at first.  Then, my old wallpaper mysteriously reappeared.  I assume that was from Google’s syncing my phone to previous setups.

Adding Chrome By Default

I unzipped my Titanium backup of Chrome to the System directory.

This made Chrome show up in the list, but it failed to run.  I ended up moving it to the /data/app folder of the ROM, and that fixed the problem.  Chrome was installed by default.

Note: I did the same thing with Swype.  I found it also had to go in the /data/app folder.

Changing the Launcher

The ROM that I started with has the Nova Launcher in it.  I did a little reading up on launchers, and I decided to try to the Go Launcher EX.

First, I removed the Nova Launcher.  I deleted the NovaLauncher.apk file:

I tried to download the Go Launcher from their website, but it mostly sent me to the market.  Instead, I installed it from the Market.  Then, I pulled it off the phone with adb.

adb pull /data/app/com.gau.go.launcherex-1.apk
adb pull /data/app/com.gau.go.launcherex.gowidget.weatherwidget-1.apk

I simply removed the NovaLauncher.apk from the /system/app folder.  Then, I added these two apk files in its place.  That gave me the Go launcher.

I tried that out for a bit, but then I decided to go back to Trebuchet.  So, I swapped the two Go apk files with Trebuchet.apk from another CM10 ROM.

Building the ROM

After all this, I built the ROM from the kitchen.  I just used option #99.

Then, I picked option#1, the interactive mode.  Then, I took the defaults.  It creates the zip file in the output zip folder.

I had a problem with the ROM flashing.  I think that it has to do with the “if” statements in the update script.  The kitchen didn’t translate it correctly.  So, I replaced the update script with the original script from the original ROM.

Later, I went back into it and found that I could remove the if, else, and end-if lines from the update-script in the working folder.  This takes out the feature that autodetects CLK vs. MagLdr.  But, it flashes on my phone fine.  I can figure that out later.

Resources

Enabling Chrome on My Custom ROM

On my latest ROM download, I found that Chrome wouldn’t work for some reason.  It said that it wasn’t compatible with my phone, but that really confused me.  I’ve had it running on my phone with no problem in the past.

I still haven’t gotten it to work.  If you know what I am doing wrong, please point it out.  Or, you might find a tip that will help you out.  In any regard, I can’t promise any answers.

Read More

First Install on a New Dell Inspiron 17R

Ok, I have finally retired my old laptop to light duty in my wife’s service, and I have a nice brand new Dell Inspiron 17R.  (Inspiron 7720)  This post was originally intended to document how I initially set it up.  Unfortunately, it wasn’t as straightforward as I wanted.  It took me a bit of experimenting to figure it out, and this post might be a little crazy.

Read More

Android: I have Jelly Bean!

Thanks to ThdDude and his Unofficial CM10 HD2 ROM, I now have Jelly Bean (Android 4.1) on my phone.  I thought I would show off a few pictures and at least capture the link to his XDA Thread so that I can remember where to go back for updates.

Jelly Bean ROMS for HD2

Right now, using the HD2 ROMs page, I see three different ROMs out there.  I have only tried the one at this point, but here is the list of ROMs I know of:

My Home Screen

For starters, here is the way I have my home screen customized.  I removed the stock clock, and I added the Fancy Widgets clock.  I also removed the messaging and Email to replace them with Gesture Search and GMail.

Notifications

One of the new features in Jelly Bean is the notifications.  I like how they are dynamic and adjust to the situation.  For example, the following screenshots show a bunch of notifications all together.  Notice how they are packed in together and take up the minimal amount of space.

When, I clear out some of the notifications, notice how the email notification expands to show more information now that it has room.

Application Switcher

I don’t think this is new to Jelly Bean, but it has the ICS Application Switcher.  When you hold the Home key down, you get this:

Google Now

I just stumbled on the Google Now interface.  I had read a little about, but I just now accidentally pulled it up.  To open it, you click on the search bar on the home screen:

It brings up an interface that looks like this.  The various cards give you information:

When you talk, it has updated the interface.  I have read that now this voice recognition happens on your phone and we don’t have to go to the web to get it to recognize.

Version Information

Here is the basic information from the Settings > About screen.

Here are the build details:

If you tap on the Android Version, you’ll see this easter egg:

The Lock Screen

The lock screen has a slightly different feel to it.  Just a different look…

Chrome

One disappointment I had was that Chrome would not install.  It said that it was not compatible with this version!

I wonder if this is because hardware acceleration is not included yet?

HD2 Toolkit

After getting a new laptop, I was looking for the HD2 Toolkit.  I use it to flash my HD2 phone.  The new Jelly Bean ROM that I am trying out needed a bigger partition.

Apparently, it was just updated in July.  Here’s the new link:

XDA: Updated with new Recovery!

I still can’t use it on Linux though, which is kind of frustrating.  It installs fine under Wine or a on a VirtualBox virtual machine, but it can’t see the phone through the USB cable.  I wish I could fix that, but it works great through my Windows partition.

Background Slideshow for Unity — Need Help

I wanted to create a special changing wallpaper for my old laptop now that I am passing it on to my wife.  I found some instructions, but I couldn’t make it work.  If you have any ideas, please comment below.  I can create the XML and the wallpaper, but I can’t get it to display where I can select it.

First, I found instructions on installing a program called crebs (Create Background Slideshow).  It creates the XML file that tells which images to include in the wallpaper.

I tried installing with:

sudo add-apt-repository ppa:crebs/ppa
sudo apt-get update
sudo apt-get install crebs

Unfortunately, the repository isn’t up to date.  I had to change the version in software sources back to “natty” to get it to install:

Once installed, it didn’t show up in the menu.  I had to launch it from the command line.  To make it easier, I added a launcher with the Main Menu application.

I was able to create the slideshow with no problem.  I added my 3 images.  It doesn’t package them at all, so put them in the place where you want them to live before you place them into the slideshow.  You may want to put them into the /usr/share/backgrounds.

When I hit save, it generated the slideshow xml file in the $HOME/.crebs/<name>.xml directory.  I moved that file to the /usr/share/backgrounds/sunflower directory.

My big problem is that I don’t see the slideshow in the Appearances App to select as my background.  That’s where I get stuck.

Resources