APK Decompiling Modifying and Rebuilding – A case study: Sky Go

After waiting quite a while, Sky Italy finally released the Android version of its own mobile streaming app.
The app allows you, if you are a subscriber, to watch a subset of Sky Italy channels.
It is not necessary to say that it perfectly fits my Samsung Galaxy Note.

Application Screenshot fom Galaxy Note

Despite the screenshot, the video quality is excellent.
So far so good…
Unfortunately once I logged in and I tried to watch FOX (The Simpsons were On Air, how can I avoid trying to watch them?) the application told me something like this:

“You’re device is rooted you’re allowed to watch just this and that channel”

What a pity! It’s not right! I’m a paying subscriber and just because my phone is rooted I cannot use a service which is included in my subscription?
It ain’t fair…
I was a bit disappointed but since I’m a geeky programmer I looked at the problem as a challenge!
I thought that this would be a nice opportunity to have fun with Android and write a post about it.

The app check in someway if the phone is rooted and if so it blocks the access to almost all channels. This means that if we amend the application in a way it thinks that the device is not rooted we should have access to all the channel the app has to offer.

I knew what I had to do:

  1. Understand how the application works
  2. Modify the application

Technically speaking this means:

  1. Decompile the APK
  2. Analyse the source code
  3. Amend the code in order to override the root check
  4. Rebuild the Application
  5. Enjoy the Simpson

Hope you didn’t get bored so far with all that preface…
Get ready: It’s time to get the hands dirty!
Continue reading “APK Decompiling Modifying and Rebuilding – A case study: Sky Go” »

ORA-00439: feature not enabled: Deferred Segment Creation

Due to a new feature present in Oracle 11gR2 (click here for more info about deferred client segment) if you will import a dump made with Oracle 11gR2 Enterprise Edition to a target system running Oracle 11gR2 Standard Edition you will get the following error:

ORA-00439: feature not enabled: Deferred Segment Creation

In order to avoid this issue, we can force both export and import to ignore this feature using the option version.
This is an example of usage:

Export (11gR2 EE)
expdp user/password directory=dumpdirectory dumpfile=dumpfile.dmp logfile=logfilename.log version=10.2

Import (11gR2 SE)
impdp user/password directory=dumpdirectory dumpfile=dumpfile.dmp logfile=logfilename.log version=10.2

 

Issue changing the Default Machine Folder in VirtualBox

If you’re using VirualBox (Version 4.2.0) and after a fresh installation you try to change the Default Machine Folder, what you get it’s the following error:

 Callee RC: CO_E_NOTINITIALIZED (0x800401F0)

It’s probably due to a VirtualBox’s bug, however the workaround it’s quite trivial.
What you have to do is create a new VM (easy one, even without disk) and after it has been created you will be able to change that parameter without any problem.

F-Bounded polymorphism

Today I was discussing with a colleague about F-bounded polymorphism.
He was trying to explain to me what this kind of polymorphism is all about but after few attempts he gave up…
Reading this you will understand why.
However we didn’t give up finding a easy and understandable explanation and eventually he succeeded.
Now, I could explain this concept with my own words but I find this article so crystal clear that I want to encourage everyone to read it:
http://work.tinou.com/2009/07/wtf-is-fbounded-polymorphism.html

Type Access restriction: The type/class/method is not accessible due to restriction on required library \lib\rt.jar

I’ve just faced this issue working on a Java project in Eclipse.

This error seems related to the restriction applied by the Java licence that says:
“Java Technology Restrictions.You may not modify the Java Platform Interface (“JPI”, identified as classes contained within the “java” package or any subpackages of the “java” package), by creating additional classes within the JPI or otherwise causing the addition to or modification of the classes in the JPI.
In the event that you create an additional class and associated API(s) which (i) extends the functionality of the Java platform, and (ii) is exposed to third party software developers for the purpose of developing additional software which invokes such additional API, you must promptly publish broadly an accurate specification for such API for free use by all developers.
You may not create, or authorize your licensees to create additional classes, interfaces, or subpackages that are in any way identified as “java”, “javax”, “sun” or similar convention as specified by Sun in any naming convention designation. [Source]“

Moreover in the java manual page we can find this sentence:
“Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.[Source]“

We can quite easily get rid of this error.

  1. Open the Preferences window in Eclipse (Window -> Preferences)
  2. Browse the left menu down to Java -> Compiler -> Errors/Warning
  3. Open the Deprecated and restricted API section
  4. Set the Forbidden reference (access rules) to Warning or Ignore

Note that following previous steps you will suppress this kind of errors for all the projects in the workspace.
If you want to do it just for selected projects, just follow these steps:

  1. Right click on the project you want to be affected by the change
  2. Select Properties
  3. Browse the left menu down to Java -> Compiler -> Errors/Warning
  4. Flag Enable projects specific settings
  5. Open the Deprecated and restricted API section
  6. Set the Forbidden reference (access rules) to Warning or Ignore

Error generating final archive: Debug certificate expired

If you’re trying to debug your application but the emulator’s not starting because you’re getting this error:

Error generating final archive: Debug certificate expired on xx/xx/xxxxx

what you have to do is renew you certificate. How to do it?
This is extasimple!
Just go to the following directory: %HOMEPATH%\.android (if you’re on Windows, ~/.android/debug.keystore if you are on Linux or Mac OS X) and delete debug.keystore file.
Now refresh your project (F5) and run it. If the problem persist, perform a project clean (Project -> Clean).

OracleLog.setLogVolume(I)V

Configuring WebSphere 6.1 using Oracle as Database 10g or 11g could lead to an error like this:

J2CUtilityCla E J2CA0036E: An exception occurred while invoking method setDataSourceProperties on com.ibm.ws.rsadapter.spi.WSManagedConnectionFactoryImpl used by resource jdbc/DefaultDatasource : java.lang.NoSuchMethodError: oracle/jdbc/driver/OracleLog.setLogVolume(I)V
at com.ibm.ws.rsadapter.dbutils.impl.OracleUtilityImpl.setLogVolume(OracleUtilityImpl.java:85)

The possible causes are:

  1. An old fix pack that contains a bug for which WebSphere’s using 9i methods against 10g or 11g Oracle Databases.
  2. Data source custom property not correctly configured.

If you’re using a recent fix pack, verify that in the data source custom properties screen the property oracle9iLogTraceLevel is blanked out as shown in the following screenshot:

oracle9iLogTraceLevel Property

Conversion to Dalvik format failed with error 1

I’ve just faced this error: Conversion to Dalvik format failed with error 1
So I’ve tried to figure out what it was.
In my case it was a problem related to the classpath due to the fact that I upgraded Android Library from 2.2 to 4.0 leaving there the compatibility library v4.

In case of this kind of error thus I suggest to check your classpath.
To do so in Eclipse you’ve to right click the project’s giving you the error, select Properties => Java Build Path and check that there are any libraries that could generate conflicts.