Home > Android, hacks > Using internal (com.android.internal) and hidden (@hide) APIs [Part 4, customizing ADT]

Using internal (com.android.internal) and hidden (@hide) APIs [Part 4, customizing ADT]

(Parts 1, 2, 3, 4, 5)

In previous posts I described how to create custom original-android.jar and how to create new custom Android platform that uses this original-android.jar. This was just enough to use Hidden API. But one more barrier left for Internal API: ADT for Eclipse. It has a rule that forbids usage of classes from com.android.internal.

There are several ways to overcome this access rule.

1) Full ADT source code is available for download. And its possible to remove/modify correct line of original code, build it and install new custom version of ADT. Bad thing about it is that you need to setup 64-bit Linux machine, download source code, build it. It takes some time. And when new version of ADT arrives, you’ll need to start all over again.

2) The other way is to just modify ADT’s bytecode. Just replace “com/android/internal/**“ string with another string like “com/android/internax”.

Second step may be automated using scripts. And does not require access to source code and works on Windows too. That’s why I’ll describe second approach in this post.


Modifying ADT bytecode

Go to your eclipse folder, plugins folder. Find file with name that looks like com.android.ide.eclipse.adt_*.jar. Make a backup copy of this file (just in case something goes wrong). And make another copy of this file to a separate “experimental” folder , where all bytecode modification is going to be done.

Rename *.jar to *.zip. Unzip file to a separate folder. Here is what I have:

image

Now go to com/android/ide/eclipse/adt/internal/project subfolder. Find AndroidClasspathContainerInitializer.class file.

image

This file contains string “com/android/internal/**”. Next step is to replace this string with another string, say “com/android/internax/**”. It’s probably safe to change length of string, but its better to just replace one letter and leave the length the same.

I did this replacements with notepad++, as it does support non-printable characters and does not touch/modify them when editing printable ones.

image

When this change is done, just save file. And zip the folder so it has exactly the same name as original one. In my case that would be: com.android.ide.eclipse.adt_8.0.1.v201012062107-82219.zip. Rename it to *.jar.

NOTE: Make sure that you have zipped files correctly. Compare internal root folder structure of modified zip and original zip.

Now delete original ADT *.jar  file from eclipse’s plugin folder, and copy over modified version. Then start eclipse.

Here is what you should see in Libraries view if everything went fine:

image

Summary of steps:

  1. Stop eclipse.
  2. Get adt plugin’s jar file from eclipse plugin folder
  3. Rename .jar to .zip, then unzip to separate folder
  4. Find com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.class
  5. Replace string  “com/android/internal/**” with “com/android/internax/**”  in this file.
  6. Zip all files back (make sure you did this correctly).
  7. Rename .zip to .jar .
  8. Replace original adt’s jar file with modified version in eclipse’s plugin folder.
  9. Start eclipse.

Conclusions

This is the last step that should be taken in order to enable Internal API without using reflection.

( Next step )

Categories: Android, hacks
  1. Prachi
    March 1, 2011 at 09:04

    Hello All,
    I went through all the steps of using internal jars..
    But got stuck in the last step. I am following exactly the same steps
    but when i am touching this adt plugin and after modification restarting the eclipse
    i am getting adt plugin build error..
    kindly suggest the solution . i stuck in the last step

    • March 1, 2011 at 09:14

      What Android SDK you have: 2.2, 2.3 or 3.0?
      Which editor you have used?
      What is your OS?

    • June 6, 2011 at 09:00

      Upload your modified ADT plugin somewhere and post the link here.

      • Pavan Kumar
        September 5, 2015 at 13:08

        Dear inazaruk i have done this with API 20.i did not find build.profiles.where can we get this file.

  2. Prachi
    March 1, 2011 at 10:31

    SDK: 2.1-update
    OS: windows 7

    I did modification in ‘AndroidClasspathContainerInitializer.class ‘ using notepad++, i did exactly the same steps.

  3. Prachi
    March 8, 2011 at 10:14

    Unable to create the selected property page.
    com.android.ide.eclipse.adt.internal.properties.AndroidPropertyPage
    getting this error

    • March 8, 2011 at 13:50

      Revert plug-in changes (i.e. save modified jar file somewhere and copy original plugin jar back to folder). Check if this issue appears again.

  4. Prachi
    March 9, 2011 at 05:59

    Parsing Data for android-99 failed
    com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer : Unsupported major.minor version 8241.8224
    this error m getting..
    whenever i am doing modification in the adt plugin it seems major and minor number is getting changed.
    may be because of that.. i dont know.. but have already wasted lot of time only for this .
    need help

    • March 9, 2011 at 10:33

      I’ve got an impression, that you modified ADT plugin of v.8.0.1, then updated ADT to latest version (which is v.10). After that you copied over one modified jar from old version which cause this error.

      Revert you changes back. Update you ADT to the latest version (which is currently v.10). And then modify new version’s AndroidClasspathContainerInitializer.class file.

  5. Nithy
    May 30, 2011 at 09:12

    The tutorial rocks. But I got stuck with the last step. I’ve updated my ADT to v.10. In fact my file name stands as com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar.

    However, when I made the changes and tried to restart Eclipse, I will not start !
    Please help me if you have any other solution.

    Thanks !

    • May 30, 2011 at 10:40

      Just delete the patched ADT plugin from plugin folder. Then reinstall ADT again (or if you saved backup file, copy that original adt jar file back to plugins folder). This will recover your eclipse. Also, upload your patched com.android.ide.eclipse.adt_10.0.1.v2011*.jar file somewhere and post link here. I want to take a look at it.

      Note, that I have successfully patched the latest version of ADT. So the steps here should work for you as well.

      • Nithy
        May 30, 2011 at 21:41

        Hi,

        I did remove the patched ADT plugin and is working fine. However, when I added the patched file in plugins folder today, Eclipse started but I got a bunch of errors after starting. It encountered some problems in building the workspace. When I went to “configure buildpath”, I could not see the Android Library files. Instead I found some Jar files like “com.android.ide.eclipse.adt.ANDROID_FRAMEWORK”.

        I have attached the necessary patched ADT jar file and other screenshots at
        http://nithy.csc.ncsu.edu:8008/lookupMaterials/

        I also attached the original unpatched ADT jar file.

        Thanks for your help ! Hope it works soon for me.

      • May 30, 2011 at 21:53

        You’ve re-packed you patched adt plugin incorrectly.

        Your adt.jar file includes folder “com.android.ide.eclipse.adt_10.0.1.v201103111512-110841” as a top directory inside zip archive.

        1. Original plugin had zip file structured:

        adt.zip/
        adt.zip/com/
        adt.zip/icons/
        adt.zip/libs/
        ....

        2. While you have:


        patched.adt.zip/
        patched.adt.zip/com.android.adt_10.0.1/
        patched.adt.zip/com.android.adt_10.0.1/com/
        patched.adt.zip/com.android.adt_10.0.1/icons/
        patched.adt.zip/com.android.adt_10.0.1/libs/
        ....

      • June 23, 2011 at 07:01

        Hi inazaruk !!
        I’ve modified “com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar″ as follows:
        Rename com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar as com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.zip
        2. Extracted and modified (‘com/android/internal/**’ with ‘com/android/internax/**’) the file AndroidClasspathContainerInitializer.class which is located in the directory called com.android.ide.eclipse.adt_10.0.1.v201103111512-110841/com/android/ide/eclipse/adt/internals/
        3. Then zipped the directory com.android.ide.eclipse.adt_10.0.1.v201103111512-110841 and renamed as com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar
        4. replacing com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar in eclipse/plugins/

        But when i restart the eclipse, it’s not opening…
        1. Original plugin had zip file structured:

        adt.zip/
        adt.zip/com/
        adt.zip/icons/
        adt.zip/libs/
        ….

        2. While you have:

        patched.adt.zip/
        patched.adt.zip/com.android.adt_10.0.1/
        patched.adt.zip/com.android.adt_10.0.1/com/
        patched.adt.zip/com.android.adt_10.0.1/icons/
        patched.adt.zip/com.android.adt_10.0.1/libs/
        ….
        Please help me out of this!!

        Thanks!!
        I”m not able to understand

  6. Nithy
    May 30, 2011 at 22:40

    Thanks inazaruk !

    It works now. That was really a lame mistake. I read your Note to check the directory structure but I had just checked them before zipping them again. The way I zipped them got me into error.

    I appreciate your timely help and support !!
    Please continue your good work. My best wishes. :)

    Nithy

  7. Tsing
    June 6, 2011 at 05:27

    I modified the adt_v10.0xx.jar file. and got the error:
    Unable to create the selected preference page.
    com.android.ide.eclipse.adt.internal.preferences.AndroidPreferencePage

    When I revert changes, the error doesn’t appears.

  8. June 17, 2011 at 20:30

    I have a mac so I can’t use notepad++. what mac application can you suggest to change the internal/** to internax/**? This part isn’t working for me and I suspect this may be why.

    Thanks!

    • June 17, 2011 at 20:32

      Sorry, can’t help you there, never used Mac. You can probably use some hex editor instead, because its only single character to change.

      • June 17, 2011 at 20:37

        I’ve tried a bunch of different editors (TextWrangler, TextMate, Hex Friend, TextEditor, as well as vi and nano on the command line) and this part will not work.. Not sure what else to try :/

      • June 17, 2011 at 20:39

        Why did you decide that this is editor’s fault? Are you sure you’ve repacked ADT plugin correctly? Could you maybe upload somewhere so I can take a look at it.

    • June 17, 2011 at 21:00

      You’ve re-packed you patched adt plugin incorrectly.

      Your adt.jar file includes folder “com.android.ide.eclipse.adt_10.0.1.v201103111512-110841″ as a top directory inside zip archive.

      1. Original plugin had zip file structured:

      adt.zip/
      adt.zip/com/
      adt.zip/icons/
      adt.zip/libs/
      ….

      2. While you have:

      patched.adt.zip/
      patched.adt.zip/com.android.adt_10.0.1/
      patched.adt.zip/com.android.adt_10.0.1/com/
      patched.adt.zip/com.android.adt_10.0.1/icons/
      patched.adt.zip/com.android.adt_10.0.1/libs/
      ….

      • June 17, 2011 at 21:09

        I read that when you said that to Nithy and I know you said to Make sure we pack it correctly and for some reason it didn’t hit me what I was doing wrong until right now! I got it working thank you for your help.

      • siva
        June 23, 2011 at 07:50

        Thank you so much Inazaruk!!
        I’ve followed entire your article. I could able to add android.internal packages but the problem i got in one of the java file is
        “view can’t be resolved” i.e. error in extending View class..

        Thanks !!

      • June 23, 2011 at 08:41

        Please upload your android.jar file and post link here. I’ll take a look at it.

  9. prasad
    June 23, 2011 at 07:19

    prasad :
    Hi inazaruk !!
    I’ve modified “com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar″ as follows:
    Rename com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar as com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.zip
    2. Extracted and modified (‘com/android/internal/**’ with ‘com/android/internax/**’) the file AndroidClasspathContainerInitializer.class which is located in the directory called com.android.ide.eclipse.adt_10.0.1.v201103111512-110841/com/android/ide/eclipse/adt/internals/
    3. Then zipped the directory com.android.ide.eclipse.adt_10.0.1.v201103111512-110841 and renamed as com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar
    4. replacing com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar in eclipse/plugins/
    But when i restart the eclipse, it’s not opening…
    I”m not able to understand follwoing::
    1. Original plugin had zip file structured:
    adt.zip/
    adt.zip/com/
    adt.zip/icons/
    adt.zip/libs/
    ….
    2. While you have:
    patched.adt.zip/
    patched.adt.zip/com.android.adt_10.0.1/
    patched.adt.zip/com.android.adt_10.0.1/com/
    patched.adt.zip/com.android.adt_10.0.1/icons/
    patched.adt.zip/com.android.adt_10.0.1/libs/
    ….
    Please help me out of this!!
    Thanks!!

    • June 23, 2011 at 08:35

      The thing you can’t understand – is the internal tree of .zip file. Upload the .jar file somewhere, and post link here. I’ll take a look.

  10. siva
    June 23, 2011 at 11:26

    Hi,
    Everything was fine.. but finally i got a error “VMRuntime” can’t resolved.
    so, help me to get out of this!!

    • June 23, 2011 at 11:30

      This is not enough information to help you. Please post all related logs from LogCat (stacktrace, warnings that were printed before the stacktrace). Or just dump whole logcat log and upload file somewhere.

      • siva
        June 23, 2011 at 11:50

        Thanks for your reply Inazaruk!!
        I’ve followed all the steps of your article….But i got one error.

        Error Description
        Conversion to Dalvik format failed with error 1 —Unknown Android Packaging Problem
        The annotation @ViewDebug.ExportedProperty must define the attribute deepExport CellLayout.java /AHR/src/com/android/launcher line 918 Java Problem

        And

        In the following class i got error like VMRuntime can’t be resolved.
        —————————————————————————————–

        import android.app.Application;
        import dalvik.system.VMRuntime;

        public class LauncherApplication extends Application {
        @Override
        public void onCreate() {
        VMRuntime.getRuntime().setMinimumHeapSize(4 * 1024 * 1024);

        super.onCreate();
        }
        }
        ———————————————————————————-
        Except these two problems everything is fine..

      • June 23, 2011 at 12:01

        It looks like both problems are unrelated to the post:

        1) You most likely using @ViewDebug.ExportedProperty incorrectly
        2) The dalvik.system.VMRuntime has been removed from android in API Level 9; Here is API 8/9 difference report: http://developer.android.com/sdk/api_diff/9/changes/pkg_dalvik.system.html;

        Make sure that your code works on original platform, and does not work on patched platform before posting further questions here.

  11. pavan
    June 23, 2011 at 16:47

    Hi Inazaruk !
    I’ve read your entire article which helps us to add internal and hidden APIs. It’s very helpful. But i couldn’t fix errors in my project. I’m running my project under following:
    OS: Ubuntu
    Eclipse: Version: 3.5.0 (Gallelio)
    I followed all the steps which you’ve told in the article.
    I’ve uploaded android.jar , com.android.ide.eclipse.adt_10.0.1.v201103111512-110841.jar and ErrorLog.txt in the following links. please find it and help me:
    https://docs.google.com/leaf?id=0B6w3mtodN5kXOWZhMzRiYzUtZGMxMi00NTZjLTkwZmItODYwM2QyMmExN2Qx&hl=en_GB&authkey=CKqHzdAD
    https://docs.google.com/document/d/1zTZXx4hDeuXdT69EzEiOns-qAlncoOySyqGe-dRO90I/edit?hl=en_GB&authkey=CI3Kk9IE
    https://docs.google.com/leaf?id=0B6w3mtodN5kXMzk5NzZjZGYtNzcwOS00ODRlLTkwNmQtZDE4NjU5ZTQ3YmM1&hl=en_GB&authkey=CMeI0OAJ

    Thanks!!

    • June 25, 2011 at 23:04

      The error log says pretty much all you need to diagnose this problem: The next file is not found /home/arijamobdev7/devenv/android-sdk-linux_x86/platforms/android-10/data/res/values/attrs.xml.
      Delete android-10 folder, re-download API Level 10 platform using android SDK, then copy android-10 as android-10-internals and apply modifications described in my posts. Do not delete anything nor from android-10 neither from android-10-internals.

  12. GL
    July 26, 2011 at 01:17

    Hi Inazaruk,

    I am using Eclipse Version: 3.6.2.

    I picked up the android-10-internals.zip file that you have uploaded and replaced the android.jar under platform-10 with the android.jar from the zip file. When I load a project that uses Android 2.3.3 (version 10), I get the following error in the Eclipse console window.

    [2011-07-25 16:08:31 – Framework Resource Parser] Collect preferences failed, class org/apache/harmony/dalvik/ddmc/ChunkHandler not found in C:\Program Files\Android\android-sdk\platforms\android-10\android.jar

    However, the project seems to be compiling fine and the code is executing is Ok. I don’t like the above error message, any ideas why I am seeing this error.

    GL

    • GL
      July 27, 2011 at 02:25

      Hi Inazaruk,

      Another issue that I am seeing along with the earlier issue:

      While a lot of internal classes and hidden are visible/usable, for some reason Eclipse doesn’t see this constructor:

      new ViewGroup.LayoutParams(
      ViewGroup.LayoutParams.FILL_PARENT,
      ViewGroup.LayoutParams.WRAP_CONTENT);

      However, when I expand the Android.2.3.3.jar from the package explorer, I see this constructor fine.

      Thanks for the great article. I am hoping to get this work here for me…

      GL.

      • February 18, 2012 at 18:30

        Hey GL,
        I have exactly the same problem. Have you found any solution yet?
        Inazaruk, do you know how to solve this problem?

        JH

    • E:V:A
      June 15, 2012 at 13:46

      I get the same problem! It is very mystical. First I tried by using my own created android.jar, but then I got the following (but similar) 2 errors:

      [2012-06-14 17:55:41 – Framework Resource Parser] Collect permissions failed, class android.Manifest$permission
      not found in ..
      [2012-06-14 17:55:42 – Android Framework Parser] failed to collect preference classes

      ==> No compile!

      I then tried to use Inazaruk’s android-10-internals android.jar, but then I got that same error:

      [2012-06-14 20:26:26 – Framework Resource Parser] Collect preferences failed, class org/apache/harmony/dalvik/ddmc/ChunkHandler
      not found in …

      ==> Compiles!

      Very mysterious! Any help would be appreciated!

      • August 26, 2013 at 09:19

        Have you solved the problem? I had encountered the same issue. It’s resolved now. It’s caused by the folder structure in the android.jar is wrong. Maybe you check that.

  13. eagle
    September 2, 2011 at 03:46

    Hi,

    I followed you instruction to build the customized android.jar. But using this android.jar file, even the standard API demo from google, which not even uses the internal functions, acts abnormally, Do you have any ideas about this? Thank you in advance.

    • September 2, 2011 at 08:46

      Whatever android.jar you are using, its not included into your compiled application. When application launches, it uses android.jar equivalent on device. So I’d say this two events should not be connected. But it would be nice if you could describe “abnormality” in more details, maybe that may give some tips.

      • eagle
        September 2, 2011 at 09:16

        It’s about the app widget. An app widget with a configuration activity will never be added. The configuration activity could be launched normally, but after pressing the “save” button (which sets the result to RESULT_OK, and pass back the Intent to the widget provider and terminates the activity itself), it does nothing to the screen. The widget couldn’t be seen.

        I stressed “a configuration activity”, because an app widget without a configuration activity could be added.

  14. Andy
    November 1, 2011 at 22:48

    Have you tried this method with com.android.ide.eclipse.adt_12.0.0.v201106281929-138431.jar?

    I’m getting this error:
    parseSdkContent failed
    Wrong InnerClasses attribute length in class file com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer

    NOTE: for a sanity check, I
    1.) unpack zip file, repack it and everything works
    2.) unpack zip file, modify class file , repack it and receive error above. Any ideas?

    • Andy
      November 2, 2011 at 01:57

      Nevermind. It comes down to an editor issue.. Notepad++ has some magic. Under Linux, I tried vi, emacs, etc with no luck. Notepad++ did the trick.

      • Peter
        January 5, 2012 at 11:39

        I had the same issue on Linux: Using vim will make other unwanted changes to AndroidClasspathContainerInitializer. Solution: use the hexedit app

  15. Walter
    November 14, 2011 at 18:28

    Hi Inazaruk,

    I’ve been trying to get the internal/internax conversion to work in file:
    com.android.ide.eclipse.adt_14.0.0.v201110171935-205994.jar.
    I’m running: Eclipse 3.5.2, ADT Version 14 on an Ubuntu/Linux system.

    Like Andy, I abandoned vi and made the change using Notepad++ installed on a Windows 7 system (my machine dual boots). No luck… When I install it in my .eclipse/…/plugins directory, Eclipse crashes during startup.

    So then I tried (as Andy did) to just unzip and then zip the file without any changes. That also caused Eclipse to crash. I even tried to use the jar tool directly to unpack and repack. That also caused a crash.

    The interesting thing I see is that the size of the original file is: 4311225 and the re-zipped or re-jared file is always bigger! Humm… I wonder if the Android folks are using a different zip/unzip set of programs than I have…

    Any ideas?

    • walter
      November 16, 2011 at 20:43

      Hi again,

      I found a solution (of sorts). As indicated, when I re-zipped, the resulting file size was larger than the original 4311225 and eclipse crashed. So this time I removed file httpclient-4.1.1.jar from the libs directory. The re-zipped file size was then 4070012 and eclipse started OK. Since I don’t need http capability in my app this will work for me. Others might want to remove a different library.

      The above was done without making the internal/internax change. The first thing I tried was to make the change using the Linux vi editor. No luck. This editor adds either 0x0A or 0x000A (LF & make file even) at the end without asking, which eclipse disliked. So then I put file AndroidClasspathContainerInitializer.class on a memory stick and edited it from Windows 7 using Notepad++ (it is available from SourceForge for free). I made the internal/internax change and then brought the changed file back to my Ubuntu system and wrote it in place of the original in com/…/product. I then re-zipped the result (file size increased by one byte to 4070013) and installed it in my .eclipse/…/plugins directory. Eclipse then booted and showed: Forbidden:/com/android/internax/** as needed.

      In my app I can now import com.android.internal.telephony.ITelephony without error (my app has other problems, but at least I have gotten this far!).

      Thanks for all this! You clearly went to a lot of work, both to solve the problem and then to write it up!

  16. December 1, 2011 at 01:40

    Here is a tip… At the end of the guide, dont extract the JAR file, for some reason it wont work (at least with me) when recompiling it. Instead, view it within 7zip viewer, and make the change direct :)

  17. ankush
    January 8, 2012 at 15:25

    This is a fab explanation. I also got stuck into this error while changing the jar file
    com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer : Unsupported major.minor version 8241.8224

    I have two versions of adt plugins since i made a update com.android.ide.eclipse.adt_15.0.1.v201111031820-219398 and com.android.ide.eclipse.adt_16.0.1.v201112150204-238534
    I am making changes into com.android.ide.eclipse.adt_16.0.1.v201112150204-238534 (the latest jar) folder only.
    Can you help in debugging this problem

  18. djalal
    January 19, 2012 at 23:57

    HI
    Great tutorial.
    1.) I did all the steps correctly, but in the end I got this error the same as Prachi and Andy.
    android SDK contenent has encountered a problem.
    parseSdkContent failed
    com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer : Unsupported major.minor version 8241.8224
    2.) I repeated the steps and to reassure me that I have followed the steps correctly, I have just opened the file AndroidClasspathContainerInitializer.class I have not had any problems..
    3.) I repeated the steps ,this time I just save the file and the problem returns.
    I have this version of ADT ADT-16.0.1.zip.
    Please help me end Sorry for my English.

  19. jing
    April 5, 2012 at 23:31

    same problem as above

    parseSdkContent failed
    com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer : Unsupported major.minor version 8241.8224

  20. stumacd
    April 10, 2012 at 13:54

    Hi,

    Great post. Great detail and the pictures really helped.

    I am on linux and had some problems altering the ADT plugin, I started a StackOverflow post on how to change the jar. What it came down to was the instead of unzipping, altering the file and rezipping. The best option was to unzip, alter and then update the existing ADT jar with the line:

    jar uf com.android.ide.eclipse.adt.jar -C out/ com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.class

    where out/ was the directory that I extracted everything to.

    I also altered the class file using okteta, so that I only altered the ‘l’ byte of ‘internal’. (I got a Parse error in other editors, it seemed to save with a 0A byte at the end of the file.)

    Hope this helps someone :)

    • E:V:A
      June 15, 2012 at 14:18

      This really helps! Very interesting. And lucky you, that you didn’t tell the StackOverflow right away, that you were changing the Eclipse ADT plugin. Obviously from the first posts, they were fishing for understanding why you wanted to do “that”. Here is a link to you StackOverflow:

      http://stackoverflow.com/questions/9604622/jar-files-why-does-extracting-then-compression-a-jar-file-create-a-file-of-a-di

      The solution to other related size problems (mentioned) above. Is probably due to this. A great reference is the “jar manual”: http://www.manpagez.com/man/1/jar/

      Here is short extract:

      c Creates a new archive file named jarfile (if f is specified) or to
      standard output (if f and jarfile are omitted). Add to it the
      files and directories specified by inputfiles.

      u Updates an existing file jarfile (when f is specified) by adding
      to it files and directories specified by inputfiles.

      x Extracts files and directories from jarfile (if f is specified) or
      standard input (if f and jarfile are omitted). If inputfiles is
      specified, only those specified files and directories are
      extracted. Otherwise, all files and directories are extracted.

      t Lists the table of contents from jarfile (if f is specified) or
      standard input (if f and jarfile are omitted). If inputfiles is
      specified, only those specified files and directories are listed.
      Otherwise, all files and directories are listed.

      i Generate index information for the specified jarfile and its
      dependent jar files.

      Hope this helps… I will try this my self very soon.

  21. Nai
    April 12, 2012 at 08:35

    I did all the modifications and then restart the Eclipse.
    The error is parseSdkContent failed
    com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer : Unsupported major.minor version 8241.8224
    Could you please help me out ?? Thanks so much!

    • Walter
      April 12, 2012 at 14:22

      Hi,
      Brfore anyone gets started down this path, be advised that Android has blocked permission MODIFY_PHONE_STATE in all versions after 2.2. That means that the ITelephone class and its methods are no longer accessable for all versions after 2.2. So you are going to be out of luck if you attempt to monitor and control phone operations from a program. You can view the details by doing a google search on: Android MODIFY_PHONE_STATE. I learned this when I was far into writing an app to block calls on a blacklist. I finished the app anyway and posted it on SourceForge (in its Search window enter JCBloc). It works with Android 2.2. Hopefully Android will reverse their block. Last time I checked there were 560 requests for them to do this!

  22. E.V:A
    June 15, 2012 at 14:37

    Thank you so much Inazaruk, for this excellent walk-through. I have only recently been trying to use some of these, and could never have done it without your help. In fact I have posted a new (but modified) thread at XDA, following this work. Here is my thread:

    http://forum.xda-developers.com/showthread.php?t=1711653

    In addition I would suggest we try to sort out some of the above mentioned problems, regarding re-packing, re-zipping of the jar files. (This seem to be a new blocker for implementing your own android.jar.)

  23. pranand
    July 2, 2012 at 09:25

    Hii

    I have followed all the steps which are shown in this tutorial but when i open the eclipse it gives me following error.

    Unable to create the selected property page.
    com.android.ide.eclipse.adt.internal.properties.AndroidPropertyPage

    Please give me solution

  24. July 22, 2012 at 05:23

    Did anyone manage to patch adt18 sucessfully?

    • Prem
      August 6, 2012 at 12:13

      i downloaded the android-internals.zip and copied the android-10-internals to platforms folder. But when i click on new project i dint see this folder in android sdk list. Please help me resolve the issue.

    • Prem
      August 7, 2012 at 19:56

      Hi Inazaruk,

      Great tutorial !!! I used your android-15-internals zip folder in github and solved the android.jar issue. But when i modify the adt, i am getting errors. Can you please share your working version of adt jar. It will help many of us.

      @All, Anyone for whom the issue is resolved, please share the adt jar.

  25. mark
    August 17, 2012 at 05:06

    Great thanks to inazaruk! However, I have encounter problem on the last step for Eclipse ADT version 16.0. I have changed “com/android/internalx/**”. The length does matter in this case, and I realize this finally and changed back to “com/android/internax/**”, and everything works.

  26. October 1, 2012 at 07:29

    how to find this com.android.ide.eclipse.adt_*.jar in fedora 14? I have searched a lot in my fedora system. I am not able to find this. I have completed previous steps successfully, but in this step i have stopped. I am not using windows system. One of my friend is using and i have tried for this file, yes I have found this file. but he is using only 4.0 i want this file for 2.3.3. my project is also developed under the same version.

    please help me to fix this

    • Binoy Babu
      November 14, 2012 at 01:21

      Must be in ~/.eclipse

  27. rajendra
    October 1, 2012 at 07:35

    hi

    I have done all previous steps properly and now I have stopped in this step. I am not able to find com.android.ide.eclipse.adt_*.jar in eclipse directory inside plugins folder nothing like this file.
    I am using fedora 14. I have searched in system, I am not able to find this plugin. But plugin is installed and its working fine. only thing is I am not able to locate this in my system.

    Help me to find this

    Thank You
    Rajendra

  28. October 21, 2012 at 15:33

    Hi Great posting, I’ve linked to you on my company blog (http://casltech.com/blog/?p=20) and also created C# program to carry out the modifications to the plugin for you. The source code is on http://code.google.com/p/adthiddentweak/.

  29. Umesh Suryawanshi
    November 10, 2012 at 09:35

    It removes android from my eclipse. And that’s why my android coding is not resolved and showing error

  30. Jon Mason
    November 11, 2012 at 23:54

    Awesome work!

    One thing you might add is that to do this with newer SDKs (I only checked 16, not sure when this changed), you have to extract the framework classes from the odex files with smali/baksmali and convert them to .dex files. To do this,
    1) get smali and baksmali here: http://code.google.com/p/smali/
    2) pull all of the .odex files from a device or emulator (you do need *all* of them, even if you’re just after the classes in framework.odex)
    3) run “baksmali -a 16 -x framework.odex -o framework -d ~/android-sdks/” (replacing ~/android-sdks with the path to your sdk installation and 16 with the sdk version you’re targeting). This creates a bunch of .smali files, which are kind of like java assembly language.
    4) Compile the .smali files into a .dex file. cd into the framework directory that baksmali created, and run “smali -o framework.dex .”

  31. Fred F.
    March 8, 2013 at 02:04

    On windows XP, extracting the .zip to a folder, modifying AndroidClasspathContainerInitializer.class and re-zipping resulted in errors.

    The SIMPLE FIX was to open the .zip, select AndroidClasspathContainerInitializer.class, copy it and paste the file to a folder, modify the file (used binary editor of developers studio (both times)), then copy the file and paste it back into the .zip and close the zip.

    As everyone else has said, GREAT STUFF!!!

  32. March 12, 2013 at 22:26

    in WinRAR , I choose “Compression method: Good”

    Thank you :)

  1. June 15, 2011 at 08:36
  2. December 1, 2011 at 00:46
  3. September 5, 2015 at 22:48
  4. September 5, 2015 at 22:49

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s