[Q] Beginning Android Development - Modifying Rom - General Questions and Answers

I'm a Java devloper by trade, and I want to get into Android development, I want to start off with a simple modification to my stock rom to bypass HDMI restrictions, I have a lot of research to do I'm aware, but I wanted to see if what I was thinking of doing was absurd, or actually doable
There is a file called "state" located in "/devices/virtual/switch/hdmi", that gets set to 1 if you connect an HDMI cable to the device, and 0 when disconnected. I'm guessing certain apps use this to detect if you have an HDMI cable connected to your phone, and will throw an error saying HDMI output is not supported by this app.
My goal is to modify the source code that manages this file, and stop the file from ever getting a 1 written to it.
I came across the following source file:
/java/com/android/server/HDMIObserver.java
I might be able to modify a method in that class file, or some file in the server package. Then from what I read I have to some how package it up and sign the file and test.
I'm not asking for help with any of that stuff, but is what I am trying to do something that can actually be done? Can you just modify a single class file on a source rom and re-compile?
Hopefully its just a simple one line answer, and I hope in the near future to be able to contribute to these forums once I've learned the ropes.
Thanks in advance.

Related

Create virtual hardware for Android Emulator

Hi there, this is my first post on xda so forgive me if this is put in the wrong forum.
I am new to android and wish to play around with the emulator.
What I want to do is to create my own piece of virtual hardware that can collect OpenGL commands and produce OpenGL graphics.
I have been told that in order to do this I will need to write a linux kernal driver to enable communication with the hardware. Additionally, I will need to write an Android user space library to call the kernal driver.
To start with I plan on making a very simple piece of hardware that only does, say 1 or 2, commands.
Has anyone here done something like this? If so, do you have any tips or possible links to extra information?
Any feedback would be appreciated.
Regards
Has anyone done this?
Bump Bump
Im surprised this is left unanswered.
Yes, you can do this. There are several ways to do so, but I will explain 2 good options for you.
One: Use AndroidSDK. It's configured for android and simple to set up.
Two: Use virtualbox. If you have the android ISO, you can install it as a bootable image in this software. This gives more functionality than AndroidSDK, but it is not as simplistic. There are settings you will need to adjust to get it running. For a working Android ISO with limited functionality, you can download this: http://www.android-x86.org/download

[Q] How to communicate with custom made hw board?

Hi Xda developers,
I might get involved in project during internship, where they want me to find way how to connect android device to custom made proprietary radio transmitter-receiver board without bluetooth or wifi, so it has to be direct wired connection.
This radio transmitter-receiver board has its own microchips and firmware so all low level work and functions will be done in this board alone.
Does anyone has idea how this could be done? is it possible to write some drivers (probably C) to communicate with this board over micro usb port present in all android devices? And than how could be data received over radio used in basic java-android application installed on device? (could this be done with use of a binary/text file as a link between these two programs?)
Thanks in advance
If nobody knows or has time to answer my questions, please give me some tips where to start searching for answers (websites, books, magazines .... )
Is it essential to learn Linux architecture properly before modifying anything in android?

Rooting all devices programmatically

Hi there,
I am an android application developer and I'd like to write an application, which is rooting the phone.
There was a time(Android 2.2 and older), when rooting was not really a big thing.
Changing the rwx permissions of two files by running two "chmod" terminal commands was enough on nearly every device to root them.
But then it went more difficult.
There may not be such a simple solution like above, but I keep hoping that it is still possible programmatically. Here is an idea:
We could use Assembler and native C to generate a Puffer overflow by calling a Unix system call like here(http://peterdn.com/post/e28098Hello-World!e28099-in-ARM-assembly.aspx).Then we could get some code, which would be able to change the file permissions coz it's running in Kernel mode, into the Kernel this way.
What do you think of my idea? Write it down! I don't expect code or does anybody here know a Linux kernel exploit
But ideas where we have to look for those would be great.

[APP][WIP][CONCEPT] Live Boot.img Modification

In the process of writing the Nexus Dual-Boot Builder app, it became necessary to modify the ramdisk of a kernel. The problem with that statement is that this was being designed as an app, not something for the computer.
Using a combination of the original AnyKernel package, some modifications found from various sources, and a homemade busybox it is possible to unpack, modify, and repack a kernel on the device.
This was done as a basic hardcoded modification for uBoot. Find the part that needed changing, change it, pack it back up. I got thinking about the possibilities for other uses and here is what I came up with...
An application that can unpack a ROM's kernel or just an image and provides a list of items that can be edited, a file manager capability to swap, add, remove parts, and a text editor to modify script files. Finish it off with the ability to pack the image back up and even reassemble a ROM.
Now to the part that involves the general public. Would this be something worth developing? What could it be used for? I have the idea and a general layout for the code structure, just no motivation to develop something that will end up unused. That is why I was hoping to obtain some feedback on if this would be worth publishing.
Nexus Dual-Boot Builder and SKU Kernel Remote are both open-source under licenses that allow using the code provided the origin is publicly listed on the final product. This allows it to be used in any other app as long as the about section or something similar has the required verbiage. I would have no issues publishing this source under the same license if it had another use altogether.
Eventually this thread will be where binaries, code, tests, etc are posted but I want to weigh the merit of taking on ANOTHER project first

[Q] Windows Phone 7 drivers help?

Hey, I wanted to know how to extract the driver files for an HTC Titan (WP7). When I use OSBuilder to dump all the packages, I get the drivers in this really weird format that I don't know how to open. There will be a folder named xxxxx.dll and inside the folder there will be files 0000, 0001, 0002, and 0003. None of these files have file extensions. Given the name of the folder, it stands to reason that somehow, the files inside can be compiled into the driver the folder is named after.
Can someone please help me figure out how to open the driver files? I need to write custom drivers for a project I am working on and I need to be able to use these and preferably decompile them.
A .dll is really the same as an executable. You could try renaming the dll to exe and it should run, but basically that file is a library of assets used by Windows, so your drivers are probably embedded somewhere within the dll itself. You can always try opening the files contained within inside notepad, or hex editor if you need a more precise instrument.
Thanks For Your Reply
syung said:
A .dll is really the same as an executable. You could try renaming the dll to exe and it should run, but basically that file is a library of assets used by Windows, so your drivers are probably embedded somewhere within the dll itself. You can always try opening the files contained within inside notepad, or hex editor if you need a more precise instrument.
Click to expand...
Click to collapse
Not quite what I had in mind but I did end up learning a little bit about the structure of the drivers, so thank you very much.
It was mostly unintelligible, but I was able to find some important file names and function calls, although I have no idea where these are located or how I can use them myself. At least it gives me something else to Google, and believe me, I appreciate that.
Ideally, I would like to be able to find/recreate the source code for the drivers so that I can edit them and I would like to know how to compile them/add them to a ROM so that they will actually run on a real phone.
Can anywhere tell me a place that I can find a guide or book or website, anything really? I've been at it for about three weeks now and I'm starting to think that either the information simply isn't there or that I've passed over it not realizing what it was.
Windows phones have never been extremely popular, so it is not surprising that material for it is limited. Your best bet would be to go into a brick and mortar bookstore and look for some windows phone development books, as I'm sure there is bound to be at least one book regarding development. Although it might not have exactly what you are looking for, it can give you a good starting point.
Paper Books on Custom ROMs???
syung said:
Windows phones have never been extremely popular, so it is not surprising that material for it is limited. Your best bet would be to go into a brick and mortar bookstore and look for some windows phone development books, as I'm sure there is bound to be at least one book regarding development. Although it might not have exactly what you are looking for, it can give you a good starting point.
Click to expand...
Click to collapse
Are there really any books published on working with rooted phones? I've seen a lot of development books, but never one in which the phone had been hacked for administrative rights. They are always written for the developer who will be using the stock ROM with no modifications, or so I thought...
They will probably not have the exact information you are looking for, but it can give you insight into how the OS was developed in the first place, thus giving possible clues as to where the files you require reside.
Thanks for all your help!
syung said:
They will probably not have the exact information you are looking for, but it can give you insight into how the OS was developed in the first place, thus giving possible clues as to where the files you require reside.
Click to expand...
Click to collapse
Perhaps. Thanks a lot for the idea. I'm going to go look into the fundamentals of the OS then.

Categories

Resources