Getting down to Android - Android Software/Hacking General [Developers Only]

Hi all!
I'm sort of new here, although i've been reading forums for quite some time now.
I have a Galaxy S (the main reason i'm here in the first place), and given i have a programming experience on different platforms i figured - what the hell. I am planning to try myself in Android apps development and possibly get down to custom ROMs and all that jive.
It is obvious where i should start with development (e.g. download SDK, read some tutorials, books etc.). As for messing with ROMs, i couldn't find an easy introduction to that. I mean, come on, everyone can root the device and install Voodoo lagfix (as i did already), but actually *creating* these ROMs is another story. If someone could possibly point me in the right direction (i just don't know where to start) it will be very appreciated.
P.S. I'm not your usual noob. I am neither afraid of command line, nor technicalities that are involved with this, and i completely understand that this will require HELL OF A LOT of reading, understanding, learning, and i completely understand that all this is way above my current knowledge, that's why i'm interested in the first place.

I think a good start would be to search tutorials for "deodexing" as this is one of the methods to prepare a ROM. From there it should lead you deeper into the rabbits burrow.

Thanks for the tip. Now i have questions that are probably belonging to the Chef section (started to read threads in there and realized that i should have started reading that section in the first place), but anyway.
If i compile the AOSP from source - will it work straight away on any device? Probably not, as the hardware needs drivers and stuff. So, next thing is drivers. As my device is Galaxy S, you can assume that all i ask is related to that device.
I saw that the open-source package (including the drivers) for Galaxy S has been released by Samsung. Does that mean that i can take Eclair AOSP source, copy the drivers, compile and use the result on my device? Well, probably Samsung made some modifications to the kernel, so it would be good idea to copy the kernel source too (i have never done kernel development before but i hope i have a somewhat general idea of how things work down there).
Anything else i need to be aware of?
Following the advice given earlier, i have googled for deodexing and ended up having a folder full of apk's. Does that mean that if i wish to install some Samsung stock apps (like camera) - i can take these apk's and install them as a regular app (or even include them in a resulting vanilla android ROM)?

Related

AOSP, Eclipse, Vendor tress, system dumps and me

OK, I hope this isn't breaking any forum rules ;-) System dumps aren't considered warez are they?
I'm just now moving from developing applications on android to working on the system itself, but I need a little bit of help. I've never been much into hacking (well... we could go back to college days but lets not ;-)
I've developed a few android applications for my business; which is very exciting - they should be launching within the next few months, but I want to work on my own Android roms and ports and I have a complete newbie question.
I've got my development environment set up - I've got the AOSP 2.1 (android-2.1_r2 to be specific) source, GIT, REPO and everything I need from HTC's Kernel lists, I know how to sign a package, etc, etc, but I've run into a problem I can't seem to fix with Google search (HONOES!)
What the hell do I do with a system dump from another device? Whats the typical process most developers use to get these dumps up and running? Am I missing something blatantly obvious? (Don't flame me, I've been stuck in javascript, PHP and C# for nearly 4 years, I'm rusty :-( )
You don't have to write me a book, but a link to a guide would be helpful.

Looking for the source

A couple of weeks ago I bought myself my first android device (a cheap LG GT540), and since then I've been playing a lot with it.
Noticed that android hackers community is quite big and there are lots of tools which can do kind of anything, but sadly I'm kind of disappointed because I'm having some issues in understanding HOW things work: in order to root my device, install custom ROMs, resize partitions and so on, I had to use a few tools that I have no idea of what they're doing.
To me it looks like that in this forums it's much easier to find a GUI that does everything you need, rather than understanding what needs to be done and how to do it. IMHO this is bad for a community of hackers.
In particular I'd like to understand how the following tools work (both for personal knowledge, and because some of these only work on windows, and I'd like to port it on Linux), and if available, I'd love to put my hands on their source code:
SwiftBootloaderBuilder: it's a tool used to resize flash partitions. I'm prone to think that it might just be a frontend for fastboot, but hum, the fastboot binary I own seems to be missing the capability of handling partitions...
KDZ: it's a tool to upgrade the firmware which I had to use in order to install on my device a custom ROM with fastboot enabled. How the heck does it work? This tool forced me to find and use a windows system to hack my GT540...
Android Developers is a great place to get started understanding how Android works. There you will find much of what you need to know to get a BASIC understanding of Android. If you follow the guides and advice you can create a basic apk that does little except teach you. CyanogenMod wiki is also a great place to learn. One thing about Android is that is is very much like Linux built for specific hardware. Many, and I do mean many, of the same principles apply to both systems. Digital signatures, ownership privileges, file permissions, compiling from source, git, gerrit, google code etc, are all things that a developer runs into everyday working with open source software of any kind. Go to every place I mentioned, sign up, and start asking more questions. Learn C++ and JAVA. Join freenode irc and find some friends who will answer questions while you learn. XDA is the least resource for the development community. XDA is the expression of ALL the other resources. I am new to this also, and have done what I suggest, except the programming languages, which I am working on. Use root explorer to look at your device file system. Ask the developers of the tools you mentioned to help you understand them. A LOT goes on behind the scenes, but it takes a little direction and determination. Cheers!

How should I start? Android dev.

First, I know there are some other topics out there asking the same exact thing, but I think my situation is kinda different.
So, want to learn how to develop for Android. Building custom ROMs, Android apps, tweaks, etc. But my actual knowledge is only user lever. I only know what a android user should know (flash ROMs, root, etc). Zero dev knowledge. Nothing.
I want to know with what should I start to learn to do Android dev. Nothing like: 1 hour and you're the best dev out there. I know it takes time. But I want to focus on Android.
So, what do you have to say?
In very general terms it would be to pick one of your favorite roms for your phone, pull it apart and then put it back together until you understand what is going on.
In more "specific" (though this is frankly scratching the surface) terms, you would first spend hours finding out how to back up your phone including the AAA key, the meid and so forth as well as other software compatible with your phone to restore it. As frankly since you're likely using your phone to test, you'll have more than one occasion it will be soft bricked.
Thereafter you would learn more in regards to development tools, in specific over at developer.android.com. Read the dev guide and so on.
Third, decide how you want to implement a unix/linux test environment, unless you're already on linux.
And forth you'd look at your favorite rom developer's build from their development site (the name of the domain escapes me) pull it apart and try to analyze the details.
Last but not least you'd FOLLOW new developments with android and the phone as well as learn to adjust to any new firmware that comes out from the manufacturer.
I'm in the process of learning how to develop myself but I've already discovered a lot more with the phone's underlying structure. That said, a lot of the answers are found in bits and pieces on this forum. But when you start to learn and ask specific questions like "what partition is the system mounted on for a Samsung Galaxy Ace" you'll begin to understand the file structure and then underlying software involved.
This was very helpful. I'm glad to see there are helpful people here that aren't going to talk down to a "new user" and I was also wondering how I could view files on windows 7. For example the structure of apk files or any of the others that say no program found to open this file
For example I want to begin by changing the boot screen from the solar flare looking Android boot screen to scrolling tiles or something of the sort then back can some explain that and I'm sure I can gain quite an understanding on the process that way
Sent from my SGH-I777 using xda premium
If you want to do programming you should start with the Android SDK: http://developer.android.com/sdk/index.html
An apk file is actually a zip file.
If you want to get an idea of all the stuff that is in there, just rename it to .zip and open with your favorite utility.
The contents of this archive file are also in binary form and compressed.
To get down to the lowest level you need to use something like apktool: http://code.google.com/p/android-apktool/
Much obliged I'll do that. Any Intel on boot.img
Sent from my SGH-I777 using xda premium

Decompiler wrappers and general modification tools.

I wanted to open up a little chat here about what decompilers themers and developers are using to crack this bad boy open. I have tried autoapktool, but that one is giving me errors left and right. I will continue to try new ones and post the ones I find work best, but I was curious as to see what other people have found / use / like / dislike.
Rather off track for a dev discussion.
Esp since the one you posted-auto apktool is a wrapper for apktool.
There are only two tools for decompiling-the original smali/baksmali and apktool. Wrappers arent important. I dont like any of them, and use a collection of my own scripts whenever I have to decompile.
As mentioned, there aren't many actual choices (but several wrappers.)
This is kind of borderline on if it's a dev discussion or not. My opinion is that the OP is somewhat off, but the result might be useful as a reference (and will also fuel my flame thrower if/when someone else posts a similar item without searching.)
I also can't think of a better section for this type of thing (at least until something called "XDA-U" shows up.)
The rules for this sub forum state that this section can be used for discussion of any kind of development. Themeing and modding pre existing roms may not be high level stuff, like porting cm or having issues with a custom kernel... but it is still development. That's why modded roms get posted in the development forum. If a mod feels that I am in the wrong, then please move this to somewhere that makes more sense.
Section Guidelines -- READ THIS FIRST
This area is currently experimental and was set up by the XDA Administrators for development discussion. The idea in this section is for developers (not only recognized developers, but all developers) to have a place for discussion threads to "talk shop."
Click to expand...
Click to collapse
In the mean time. Fine... then lets talk wrappers.
I have not had much luck with the latest auto apktool. But the 2.x variants seem to do quite well. Xultimate seems to work fairly well as well.
lickarock said:
The rules for this sub forum state....
Click to expand...
Click to collapse
Yes, I wrote that post. As I mentioned, this thread is kind of borderline. (While it's not noted on my title, I am a moderator of this section.) If you'd like to debate the finer points of the guidelines, I'd be happy to do so in PM's.
lickarock said:
In the mean time. Fine... then lets talk wrappers.
Click to expand...
Click to collapse
I'd prefer if we didn't. I don't see any issue with discussion of tools and how they relate to the NoteII (or even the exynos4 platform in general), but when you get into wrappers for those tools, things can get a bit far off focus, and solving the platform/device specific issues would have to be done at the base tool level, not the wrapper level. There are also, of course, threads in other sections for specific tools and even wrappers...
(Hopefully, the next paragraph will keep this on-topic AND show what I'm trying to get at.)
To that end, I HAVE been able to properly decompile most of the NoteII apk's I've tried with apktool. In that case, I wasn't able to to use an older version of apktool, and had to find one that was reengineered to work with ICS firmware. (So, for example, if a wrapper used an older version...) Updating the JDK can also solve some issues. Here's a link to the version of apktool I ended up using: http://forum.xda-developers.com/showpost.php?p=23886280&postcount=1
Take care
Gary
lickarock said:
The rules for this sub forum state that this section can be used for discussion of any kind of development. Themeing and modding pre existing roms may not be high level stuff, like porting cm or having issues with a custom kernel... but it is still development. That's why modded roms get posted in the development forum. If a mod feels that I am in the wrong, then please move this to somewhere that makes more sense.
In the mean time. Fine... then lets talk wrappers.
I have not had much luck with the latest auto apktool. But the 2.x variants seem to do quite well. Xultimate seems to work fairly well as well.
Click to expand...
Click to collapse
No offense, but please don't talk like Samsung does.
garyd9 said:
To that end, I HAVE been able to properly decompile most of the NoteII apk's I've tried with apktool. In that case, I wasn't able to to use an older version of apktool, and had to find one that was reengineered to work with ICS firmware. (So, for example, if a wrapper used an older version...) Updating the JDK can also solve some issues. Here's a link to the version of apktool I ended up using: http://forum.xda-developers.com/showpost.php?p=23886280&postcount=1
Take care
Gary
Click to expand...
Click to collapse
Thanks, I was having issues recompiling systemui.
As far as wrappers go, without a "digression" into wrapper UI or other such nonsense, I think it's valid. While most of us know our way around bash, conversation could lead into nice tools like T889 specific git sources or other useful tools.

[Q] Noob trying to become a dev.

This thread may be pointless but I don't care. I can't find a straight general answer.
I am kind of new to Android modding but have ok skills with coding and decent skills with Linux (I know how to survive in a shell).
What are good code examples or what are the best methods(exploits) used to privilege escalate a shell?
Do I need to find a hole in the Linux kernel or try to hijack an active process running as root?
What is needed to crack the bootloader? I know I'm asking a lot and most of my terms used may be wrong but I find it hard to take that next step. Would I find answers by reading an Android developers book?
Please, where do I start???
There are many options in the development criteria, the two main consist of OS Development (Roms) and Application Development.
Judging by what you're stating, I think you're trying to work towards OS Development? Correct me if I'm wrong.
I know I'm being a bit cheap by not typing out everything needed, as I will have to put some time into that... But the official CyanogenMod wiki shows you how to set up a building environment on Mac, Windows and Linux.
From there they explain in detail on what shell commands you must use to run exploits and such. They also explain what specific components and files do and how you can modify and update them from what I have previously seen. The site also shows you how to build a ROM for your device itself, using the CyanogenMod source of course, the method applies to all source to be honest.
Here's a link to the website - http://wiki.cyanogenmod.org/w/Main_Page
If this wasn't what you were asking for let me know so I can explain furthermore.
Krish.
Sent from my Nexus 5 using Tapatalk

Categories

Resources