Matt Coneybeare

MC

Edit Google Analytics for iPhone to Use a Hidden Database

| Comments

I use Google Analytics in my iPhone apps to track how my customers are using them. It is very useful for determining the answers to questions such as:

- Do users prefer Browsing or Searching
- Do users setup simple, or complex alarms
- Do users even tap _____ at all?

In Ambiance 3.0, I have added File Sharing through iTunes in order to process the App’s Backup Files and capabilities. The way this works is that iTunes will list the entire contents of your Documents Directory in the iTunes File Sharing pane for your app, unless they are a hidden file. This means that every data file Ambiance uses has a “.” prefix as I do not want to share these files. The only problem is that I could not find a way to hide the googleAnalytics.sql file that was created by Google, thus, the customer saw this:

While this isn’t the worst thing in the world, it isn’t ideal either. I contacted a friend of mine for some help and he had the brilliant idea of using a Hex Editor, editing the libGoogleAnalytics.a file to change the name of this string. Now, the string is hidden and all is good with the world!

Here is the tip he gave me:
I have modified the
library with an hexadecimal editor, I have used 0xed
(http://www.suavetech.com/0xed/0xed.html), and changed the first
letter of the string, the g, by a dot. The library seem to work and
generates the file. I have changed the first letter because I don’t
know if you can add a new character to the string in a binary file
without side effects, and this way the length of the string and
library remains the same.
- Antonio Cabezuelo ( tapsandswipes.com )

So I installed 0xED, opened libGoogleAnalytics.a and searched for “googleAnalytics.sql” and changed it to “.oogleAnalytics.sql”, saved and ran the app and it works great.

Hope this helps somebody out because it really made my life easier working with the Google Analytics library. BTW, don’t bother contacting Google with any issues, their support is horrible. I emailed at least 10 times about this before asking a friend.

Comments

My name is Matt Coneybeare, I design and develop for iOS (iPhone, iPad and iPod Touch), Mac OS X and the Web out of New York. In 2008 I started a software company called Urban Apps that has made some pretty popular apps such as Ambiance and Hourly News. My current Stack Overflow reputation is about 27k.

I was a Rockstar a decade ago, but then went back to school and collected a Bachelor's Degree in Computer Science from U.C. Berkeley. Now I am settled down with my beautiful wife Di and our two doggies Hamachi and Foxy. While coding, I walk several miles/day on my Treadmill Desk. When not at my desk, I love exploring New York City as a Yelp Elite, or training for marathons.

Contact information

Name
Matt Coneybeare
Email
Website
Twitter
Instagram
GitHub
LinkedIn
Google+