[AOSP] Android Framework replace in stock roms - Android Q&A, Help & Troubleshooting

Hi, im currently developing a system for wifi-direct application testing.
To do so, i need to change some classes in the android framework, specially in android.net.wifi package.
I've downloaded the Android 6.0.0 source tree, made some changes and recompiled it to x86 to push the new framework into the emulator. (Running Nexus 6 image with Android 6.0.0)
After that i pushed the recompiled jars, boot.art and boot.oat, and the odex files.
When i restart the emulator the image don't work.
Is this possible to do? Change the framework or at least part of her implementation and manually push the files into the emulation?
If so, what can i be doing wrong?
Thanks for the help, Filipe Teixeira

Related

Running non j2me jar files

Was trying to run a jar file(non j2me/ real time os on its own) but java code with a main....
As android is a java machine, how can i run a received jar file build on windows??
All tips are welcome
Enthusiastic Gio User
Very glad with the work done
But sometimes a pusher for results( nothing bad intended)
It's not that simple.
Of course, android is Java based, but doesn't include all standard java libraries (i.e. graphical libs awt and swing).
If you are sure, that your .jar file is 100% compatible then create android project, include that .jar as a library and use it there.

[Q] AOSP and Android SDK

How does the AOSP and the Android SDK relate?
If I repo the AOSP do I by default now have the SDK?
Do I have to download it separately?
Or can I/Should I compile it from the AOSP?
I ask because after following the instructions up until: source.android.com/source/building.html. I successfully compiled full-eng and ran the emulator and everything works just fine. It also seems like adb is installed which from what I understand is a part of the SDK. I can't seem to find an answer to this.
So I am going to do my best at answering my own questions and posting for the benefit of anyone else who may be confused; if any of the statements I make are wrong feel free to correct me. This is just from my experience. There seems to be little information regarding how the two relate excepting the build/core/build-system.html, and sdk/docs/howto_build_SDK.txt included with AOSP and airtower.wordpress.com/2010/07/25/building-the-android-sdk/ and of course, trial and error.
NB: jindroid.com/2009/06/08/howto-build-sdk-from-android-source-code/ points to documentation that has since moved to the above location it seems. At least it wasn't there for me as of the most recent repo sync against master.
rpowell8 said:
How does the AOSP and the Android SDK relate?
Click to expand...
Click to collapse
The android SDK is a subset of the ADT (Android Developer Toolkit). The SDK as you download it today is basically just a few binarys for getting the actual content SDK.
I think the best way to describe the SDK is that it is divided into to parts tools, and libraries. The tools are for managing the sdk (tools/android) and misc tools to build apk's, align them, emulate an api etc, and then there are the tools in platform-tools which allow you to perform operations on your device (adb fastboot etc). The "libraries" are a set of API's , system images (file for running an android virtual device (emulator)), and documentation for each release of Android. These seem to reside under platform/
You can either download the above components from the command line, or from eclipse. Eclipse is actually included in the ADT as well with the plugin for android apps preloaded. If you don't have the plugin, you can get it vie Help/Install New Software. This launches what seems to be a front end for the android SDK Manager which allows you to graphically choose which platforms you want to support and emulate.
Now, how does the SDK (the tools and libraries) relate to the AOSP as you repo init/sync from the master repository? It seems you can't build apps from the code downloaded from the AOSP git repo (I'm not sure about this but doesn't seem like it). Instead, what you do, is you use the AOSP to build the SDK (NB: when you use the SDK Manager as mentioned above, you are getting prebuild SDKs, if you want to build the SDK yourself you use the AOSP code) as described in the above mentioned howto. Once the build for the Android SDK is complete it is located in out/host/linux-x86/sdk or similar directory. You can actually point the eclipse plugin to this directory as the location for the SDK...but I recommend using the .zip file that is in that directory and putting it somewhere other than the out directory. Reason being if you decide to do a lunch full-eng after you did the lunch sdk-eng, and then proceed to make, it will force a make cleaninstall and that will basically do a rm -rf on the out directory, deleting all of your SDK and any other platforms you downloaded through the sdk manager.
After you've built the sdk, you now have the necessary tools and API's to build for the platform you repo'd. A word of warning is that it seems if you repo the master branch, it is labeled as "AOSP" for the version indicating to Eclipse that the minimum platform required is the one you just built and so if you want to run it on your device you'll need the full platform loaded onto it or it will show you are running a version earlier than AOSP (also called 'Preview'). Example, as of this writing the version of AOSP is 4.2.1 and the API level is 17 (An API level is just a set of functions/datastructures available for a particular release of Android OS, so for Level 17 it corresponds to 4.2, You can use a higher API than your target (accept in the case of AOSP Preview) and still make sure you are compatible, but you can't use a lower API and expect to have functions/datastructures that were only implemented in later versions of Android). If you have downloaded the Android SDK for API level 17 it will be 4.2, not 4.2.1. You will not be able to run your app that you built using the API level 17 "Preview" based on 4.2.1...on your 4.2 emulator (or device for that matter). You will need to use the emulator based on the AOSP Preview build.
So in short the AOSP contains the sources to build the SDK, but you can also get prebuilt SDK's if you don't want to go through and build each API level.
rpowell8 said:
If I repo the AOSP do I by default now have the SDK?
Click to expand...
Click to collapse
No, you have the components to /build/ the SDK
rpowell8 said:
Do I have to download it separately?
Click to expand...
Click to collapse
No, you can either build it from the AOSP, or you can download it separately.
rpowell8 said:
Or can I/Should I compile it from the AOSP?
Click to expand...
Click to collapse
Probably should if you're building against the latest android development, but I don't see the need if you are building apps for already released API levels.

baksmali/smali for Android N?

Is there a working smali/baksmali for Android 7.0? I'm attempting to deodex my systemui in Android 7.0 but I keep getting an error when trying to compile the smali code into a classes.dex

AOSP modifying / compiling keyboard LatinIME

Hello all! I have downloaded and successfully build the AOSP for marshmallow (android-6.0.1_r79). Than I made some changes to the stockkeyboard (regarding to my other topic, but not relevant here). The file which I modified was this here:
packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java
I compiled the code and it was successfull too. But than I realize I face some problems.
I mounted the system.img and get into the path: /system/app/LatinIME/
I decompiled the app (jadx, apktool) to check if the modification there is available and here is the problem
This APK does not contain any Java sources?! Its just xml regarding to the layout. When I replace my old Stockkeyboard with this one, it is still perfectly working? So I got not clue whats going on.
Question regarding to this topic are:
How can I make a modification to the stock keyboard LatinIME
Building this new AOSP image with the new keyboard
And extracting the new keyboardj(APK) out of this image to install it on my device (Root permissions are of course available)
What I have tryed:
Modyfing the following Java file: packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/LatinIME.java
Compiling the complete project (make -j4 and just the keyboard: make -j LatinIME)
Replacing my own keyboard with the modified stock keyboard
My steps are as described not working. The keyboard appears and its working but the modification seems to be missing. Also by decompiling it, there are no Java sources within it.
I am relly glad for any help to this topic! Thank you!

Edit this part of the android framework

I'm trying to edit this part of the Android Framework: https://cs.android.com/android/plat.../telephony/dataconnection/DataConnection.java
I've tried disassembling framework.jar but couldn't find the code related to this java file. How could I go about modifying this part of the OS and re-injecting it and where should this source code be located on my device (I'm using an Android 11 phone) ?

Categories

Resources