Remove Uno From AT&T Fusion (Huawei U8652)

If there is anything that I despise in my beloved virtual world, it is bloatware. I bought a Huawei U8652 (AKA AT&T Fusion) and had a bit of a hard time removing the asinine Uno app, so I decided to post instructions here:

  1. Root your phone. I kept seeing posts that told people to use ‘unlockroot v2.3′, but I thought unlockroot was a piece of garbage. Instead, I followed these instructions.
  2. Install the Android Terminal Emulator
  3. In the Terminal Emulator, type the following commands:

    mount -o remount,rw -t yaffs2 /dev/block/mtdblock8 /cust
    cd /cust/att/us/app
    chmod 777 *
  4. If you want to delete all of the bloatware apps that AT&T loaded on you, type this command:

    rm *

    If you want to delete one specific app (like Uno), type this command:

    rm uno_att.apk

    You can replace ‘uno_att.apk’ with any of the app file names that you desire

And you’re clean!

Explanations

I initially thought that rooting my phone would allow me to remove these ridiculous apps, but the problem is a little deeper than that. These apps are located in a section of the internal memory that is mounted as a read-only section. If you look at the contents of /proc/mounts, you can see this entry:
/dev/block/mtdblock8 /cust yaffs2 ro,relatime 0 0
In order for a superuser to delete these apps, we have to remount that block with read/write privileges.

Metametawriting Rant

I hate writing about literature. It’s incomplete. It’s like trying to shove an entire ocean of ideas into a sock of an essay. You can’t cram enough ideas into it. Some ideas leak out, partially absorbed (but only partially). It’s a chore with no reward. The cool part is the plethora of ideas, not the regurgitation of them. If I could actually use writing to distill my ideas and present them in a clear, concise way—a way that others would be able to fully experience them—I would be able to take my treasure trove of ideas and create something that is more valuable. But, as it stands, I’m no artisan. I sweat and toil to melt down my gold only to end up with a “finished product” that looks as inspirational as a snowman.

Email for Pricks

For all the jerks that like to find miniscule corner cases in common sense, there is an email provider for you!

http://www.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com/

This site allows you to make an email address that is WAY longer than the norm. You can use this to find all of the websites that require an email address, but won’t allow yours due to length. You can then spend your afternoons sending condescending messages to web admins, deriding their overly-simplistic business logic that doesn’t cater to your special email needs.

Enjoy.


Random Email address stats:

  • Most people have email addresses that are around 23 characters or so, with most maxing out around 50.
  • The web standard says that email addresses can max out at 254 characters

JDBC NullPointerException

While restructuring some JDBC code, I ran into an odd problem. My code was like this:

		String sql = "SELECT"
				+ RULE_COLUMNS
				+ " FROM " + TABLE_NAME
				+ " WHERE record_id = ?";
		
		PreparedStatement stmt = conn.prepareStatement(sql);
		stmt.setString(1, recordId);
		
		NotificationRule domainResult = null;
		ResultSet rawResults = stmt.executeQuery();
		
		if(rawResults.next()) {
			domainResult = createRule(rawResults);
		}
		
		return domainResult;

When I called stmt.executeQuery(), I got a NullPointerException:

java.lang.NullPointerException
	at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:973)
	at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1052)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1329)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
	at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628)
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493)
	at dao.NotificationRuleDAO.findRuleByRecordId(NotificationRuleDAO.java:209)
	...

When I Googled around for answers, I didn’t really get anything similar to what I was doing. Going back to the code, I saw that I had a little typo. My SQL query had no space after the "SELECT" part, so the select keyword wasn’t even in my query! Adding a space fixed it.

SO! If you are getting this exception and you aren’t getting relevant answers from Google, check over your query string carefully and look for missing spaces.

StackOverflow Add-On

I LOVE StackOverflow. I like games, I like computers, and I like programming. StackOverflow is a sweet culmination of all of those. Somehow, the payoff of receiving more reputation points is enough to drive me to visit the site multiple times a day, offering my development consulting for free (a racket, right?).

For anyone else who has the same OCD tendencies, I must recommend the Stack Alert plugin. It runs in both Firefox and Chrome. Instead of wasting loads of time by visiting the site 2048 times a day, looking to see if my answers have been noticed by less obsessed users, I can just look up in the corner of my browser for updates. This has reduced the amount of time I waste being distracted by finding a new question to answer while I’m following-up on my old questions/answers.

CSS3 Rotations

One of the new features of CSS3 grabbed my attention was 3D transformations. Although I feel that animation should probably be more in the domain of JavaScript, some of the things that you can do with CSS3 transformations are pretty cool. Cool as it may be, 3D transformations with HTML isn’t always intuitive. Here I would like to explain a (seemingly) simple task: creating a turning page.

In order to understand CSS transformations, we first must take a look at traditional web page rendering. Let’s say we have 2 <div> elements, like so:

Both pages are displayed as if they are stuck to the screen with the text in a readable orientation.
Now, let’s decide that we want to add 3D transformations. If arbitrary rotations are possible, it would make sense that the traditional layout would be the default, with x-rotation = 0, y-rotation = 0, and z-rotation = 0. This is exactly how CSS3′s transformations were implemented. Now, if I rotate the first <div> by 180 degrees in the y direction, I would get this:

Notice that it looks just like it has been flipped horizontally. The text is backwards. The <div> hasn’t shifted left or right since the default axis of rotation is in the center of the HTML element. We can change that by using the transform-origin property. For example, if we style the first div with transform-origin: 100% 0%; then we end up with this layout:

The div is flipped, but this time it is flipped across its right side. So, this brings us to our task of creating a turning page.

In order to correctly animate and lay out your HTML, you have to remember that the default orientation is flat against the screen with readable text. This means that the front side of the page will be laid out exactly as you expect, but the back side of the page will have to be shifted left as many pixels as the page is wide. The front page will use its left edge as the axis of rotation while the back page will use its right edge as the axis of rotation. If this seems strange, examine a page of a book. Here’s a visual example:

Now, to complete the effect, the back side of the page must simply start out rotated -180 degrees. When you want to turn the page, all you have to do is:

  • Rotate the front page from 0 to 180 degrees along the left edge
  • Rotate the back page from -180 to 0 degrees along the right edge

Note that the back page starts out shifted one page’s width to the left so that the right edge of the back page is at the same location as the left edge of the front page.

Inconsistent stackmap frames at branch target – PowerMock

I love PowerMock. Unit testing is ten times more attractive when you use a mocking framework. However, the very power that PowerMock wields is also a detractor: bytecode manipulation spits out very strange errors that are hard to debug. Recently, I ran into this gem:

Inconsistent stackmap frames at branch target...

Ummm.

Cryptic error message aside, it took me a while to find out how to fix this, so I thought I would post it here. I was attempting the following:
-Create a mock object
-Force the constructor to return the mock
-Stub out a void method (which seems to bring in its own complexities)
-Implement a custom IArgumentMatcher to create a correct expectation
-Run all of this on the Java 7 JVM

Apparently, this was the perfect collection of operations that doesn’t work. Luckily, I was able to find this as a documented bug between Java 7 and Javaassist (dependency of PowerMock). The solution is to run your tests with this JVM flag: -XX:-UseSplitVerifier. I don’t really know what it does (the comments in the google code page were the most info I got), but if you are encountering this error when running PowerMock on the Java 7 JVM, this might be your fix.

Thanks to danno for the info.