Porting Volume Cursor Control & Other Features into Stock OSS - OnePlus 5 Themes, Apps, and Mods

So I am looking for a bit of help, as this is the first time I am attempting mods like this. Lack of Xposed has left me to resort to trying to learn and figure some of this stuff out on my own.
A couple assumptions & clarification I am making & looking for:
1. From reading on XDA, it should be fairly simple to port & cherry pick basic features from other OP5 ROMs and merge them into the Stock OP5 ROM
- referring in this case to a decompiled framework.jar.
2. I have found a specific Commit from the ResurrectionRemix ROM, which adds Volume Cursor Control to both InputMethodService.java & Settings.java. My assumption is that these two commits for this functionality can be copied directly into the respective Stock OOS files. Is this correct?
3. Lastly, I need to learn about recompiling framework.jar, but I am assuming once I make the appropriate changes, I just recompile and transfer to phone, set permissions and I'd be set.
Again, apologies if it is incredibly noobish to ask this, and I realize its probably easier to just flash ResurrectionRemix, but I am also looking to learn a bit too
Thanks for any help!
EDIT: btw, if this is better in Q&A, mods plz move

I have no idea how to help you but wanted to say good luck. Volume cursor control would be an excellent thing to add to OOS

That's not how it works. Those commits are applied to the source code, not to the already compiled files, which is what we oneplus releases.
Sent from my OnePlus 5

asuhoops8628 said:
So I am looking for a bit of help, as this is the first time I am attempting mods like this. Lack of Xposed has left me to resort to trying to learn and figure some of this stuff out on my own.
A couple assumptions & clarification I am making & looking for:
1. From reading on XDA, it should be fairly simple to port & cherry pick basic features from other OP5 ROMs and merge them into the Stock OP5 ROM
- referring in this case to a decompiled framework.jar.
2. I have found a specific Commit from the ResurrectionRemix ROM, which adds Volume Cursor Control to both InputMethodService.java & Settings.java. My assumption is that these two commits for this functionality can be copied directly into the respective Stock OOS files. Is this correct?
3. Lastly, I need to learn about recompiling framework.jar, but I am assuming once I make the appropriate changes, I just recompile and transfer to phone, set permissions and I'd be set.
Again, apologies if it is incredibly noobish to ask this, and I realize its probably easier to just flash ResurrectionRemix, but I am also looking to learn a bit too
Thanks for any help!
EDIT: btw, if this is better in Q&A, mods plz move
Click to expand...
Click to collapse
You can try to revert the commit to build RR without volume control, and then build REGULAR RR with their volume cursor control. Take both framework.jar files, decompile them using apktool and search for the Settings.smali and InputMethodeService.smali, they should be in similar folders as the RR source code.
Open smalis files and use a diff checker software or website, and if you can, add the new code into the OOS framework, but you may need to edit other stuff to get it working. I have very few knowledge in Android reverse engineering but this should be the right way to start, as you don't have access to full OOS source code

To simplify, you would need to download the source, see what commits are needed to include the feature you are looking to add.
Usually, there will be commits needed for settings and frameworks.
Cherrypick them, resolve conflicts if any, and build your first 'custom rom'

Yeah, I spent a **** ton of time on this the other day. Got some **** decompiled, even was able to "mostly" figure out where things should be inserted, placed etc.
Issues I ran into though was the decompilation process left tons of errors, weird things. Couldnt get anything to pack up back nicely. Unfortunately, don't have the programming background to actually write my own code.
Unfortunately, without the OOS source, I think this might be past me, since I do not have the knowledge or experience to resolve the issues decompilation raises

Related

Modifying Android's built-in apps

Hi guys!
I'm wondering what I'd have to do if I wanted to modify the built in apps inside Android..
I've got a HTC Hero running FroydVillain 1.5.0. Let's say... I want to modify the messaging app that's included, MMS.apk. I wouldn't know how to go about this, and I have a few questions...
Firstly, what sources exactly are used for building the built in apps for a given ROM? The source code link in the FroydVillain post, for example, is just for the kernel. The rest of the OS isn't there.
Secondly, I hear that in order to modify a built in app, you need to build the entire OS. If I just download all the code from Google official repo, and compile that, will it just... work on my phone, provided I use a kernel that is specific to my phone?
Lastly, are there any tips anyone has for someone who just wants to modify a couple of the built in apps? Is it possible to build them as standalone apps? Or import them into Eclipse?
I've had a search around the forum and the internets in general, and people have asked similear questions, but I've yet to find a good answer. This thread comes to mind: http://forum.xda-developers.com/showthread.php?t=635197
If anyone could help me, or point me in the direction of any help, that'd be awesome! Thanks!!
FunkTrooper said:
Hi guys!
I'm wondering what I'd have to do if I wanted to modify the built in apps inside Android..
I've got a HTC Hero running FroydVillain 1.5.0. Let's say... I want to modify the messaging app that's included, MMS.apk. I wouldn't know how to go about this, and I have a few questions...
Firstly, what sources exactly are used for building the built in apps for a given ROM? The source code link in the FroydVillain post, for example, is just for the kernel. The rest of the OS isn't there.
Secondly, I hear that in order to modify a built in app, you need to build the entire OS. If I just download all the code from Google official repo, and compile that, will it just... work on my phone, provided I use a kernel that is specific to my phone?
Lastly, are there any tips anyone has for someone who just wants to modify a couple of the built in apps? Is it possible to build them as standalone apps? Or import them into Eclipse?
I've had a search around the forum and the internets in general, and people have asked similear questions, but I've yet to find a good answer. This thread comes to mind: http://forum.xda-developers.com/showthread.php?t=635197
If anyone could help me, or point me in the direction of any help, that'd be awesome! Thanks!!
Click to expand...
Click to collapse
1) The whole sources for everything are there
http://github.com/ninpo
2) You can import the sources to eclipse, but I think you will need to build the entire tree, as opposed to just what you change
3) Apktool lets you do smali and resource edits on an APK. Without knowing what you aim to do, it's hard to guide you specifically.
Most apps are based on the sources provided by google. I assume you are talking about Froyo Hero ROMs (i.e. FroydVillain), which apps are generally built from the source of CyanogenMod. Specifically for FroydVillain, if you look around ninpo github you will see some packages with some changes to their code, although it does seem that many of the changes in recent releases are not there. I have actually PMed ninpo about this and hopefully this is only a technicality.... I assume that the other packages and apps (most of them) he just compiled off the CM sources without changes.
In any case, if you compile an app either from the CM source or from google's original sources, it should work just to copy the apk file - just make sure you use an appropriate ROM (i.e. Froyo ROM if you built it from Froyo sources). The reason to want the CM sources, is that if they have incorporated further fixes (over the google sources) you may want them.
Finally, some more practical advice: I would start with the google sources: http://source.android.com/source/index.html since I have found these instructions and explanations easier to begin with - it should be quite straight forward to build these sources on a linux machine (or VM).
Then you can also try to tackle the cyanogen source: http://wiki.cyanogenmod.com/index.php?title=Building_from_source currently missing instructions on how to build for hero. But if you only want to copy apks out of it, you can just build a generic build (like in the google souce).
If you have specific problems, ask and I'll try to help you.
Good luck.
pulser_g2 said:
1) The whole sources for everything are there
http://github.com/ninpo
Click to expand...
Click to collapse
For example where are all the changes to the dalvik code? I do not follow closely enough the changes in Froyd to point out other things which might be missing (if at all), but there are relatively few committed changes to the CM code. Specifically the dalvik code, ninpo mentioned hundreds of changes which caught my interest and are definitively not there.
The kernel sources do seem to be up to date always - been following that one closely .
Thanks for the advice I love this forum!
What I'm trying to do, in case you're wondering, ultimately, is to modify the built-in messaging application to give the user the option of sending a message by the normal method, or by using their provider's free webtext service, something that all the carriers seem to offer here in Ireland.
So, for example, you'd press the Send button, and you'd be able to select one of those methods. (of course, you'd have to have a data connection for the webtext). There's also be an interface for entering your login credentials for your carrier's website.
I'm doing this party because it would be very useful. I also feel that it would give me a good introduction to how you'd go about modifying Android. I mean, from a programming point of view, it shouldn't be *too* hard to do. I already have a simple standalone app that I made which can send a text message via an Irish carrier's webtext service. But it's all good experience to try to modify other people big codebases.
I have a good bit of experience with web application development, but my experience with other programming is a little more limited. I usually use PHP, where there's none of this compiling nonsense. You just write scripts and off they go!
So I'm gonna go off and see if I can set up an environment where I can build.. the OS, I guess.
If I was to take the vanilla official Google sources, would they work on my phone? Or would I have to use an official Google developer phone... or the emulator? Or maybe if I stopped writing here and investigated those links you've provided, I'd know that by know.
Brb, investigating
Yeh investigating and just trying to do it is usually the best way
To clarify what I was trying to say above: All the java code is obvious very portable - one of the big advantages of java. In the case of android it is compiled to an .apk file and this file should be, at the very least, portable to all android "devices" running this android version. So the apk you build (for example from the vanilla 2.2 sources) should work on the emulator (good for initial debugging) and any 2.2 ROMs.
erasmux said:
For example where are all the changes to the dalvik code? I do not follow closely enough the changes in Froyd to point out other things which might be missing (if at all), but there are relatively few committed changes to the CM code. Specifically the dalvik code, ninpo mentioned hundreds of changes which caught my interest and are definitively not there.
The kernel sources do seem to be up to date always - been following that one closely .
Click to expand...
Click to collapse
I'm currently on "vacation" from any and all Android development for a week. I'll be back after the weekend, at which time my modifications will be cleaned up and committed to git. The kernel is always current with my latest kernel release due to GPL obligations. The extra time away has also highlighted some changes I need to make both to the kernel and to my Android modifications when I get back.
Hacre said:
I'm currently on "vacation" from any and all Android development for a week. I'll be back after the weekend, at which time my modifications will be cleaned up and committed to git. The kernel is always current with my latest kernel release due to GPL obligations. The extra time away has also highlighted some changes I need to make both to the kernel and to my Android modifications when I get back.
Click to expand...
Click to collapse
Thanks Ninpo

[How To] [GSM] Getting started with porting

Ok, so after having a million questions I thought I'd write up a quick little 'how to' with regards to porting.
And now the warning
Read and learn first, doing this could cause serious issues with your tab or even brick it. The tab is really tough, and hard to brick if you do everthing right but it could still happen. I'm not responsible if it does.
Where to start
Get good at reading, google searching and searching XDA. Lots of porting discussion regarding other phones can apply to the tab.
Learn to use Heimdell
Have a linux distro available, either by virtual box, or natively.
Technomancer where it all began
I've said it before and I'll say it again, without techs work miui wouldn't have been possible.
Reference technomancers thread here: http://forum.xda-developers.com/showthread.php?t=931857 on how to download the cm7 + sgt source, you're also going to want to follow the kernel making part, cause most likely you'll need to make adjustments to the init.rc which is inside the initramfs and requires building the kernel again.
porting x build
Get X build onto your computer and extract the update.zip for it.
Copy the boot.img into your linux environment and extract it using splitbootimg.pl script (note: Google it, plus this doesn't work with samsung builds). Compare the init.rc to your init.rc (from the sgt cm7 kernel source root folder). Specifically the most important part here is the PATH, LD_LIBRARY_PATH statement and BOOTCLASSPATH lines.
Build your kernel with the updated init.rc and flash with heimdell, it should still boot your cm7/miui build (if you were running it before) albeit with errors.
The system
Now following the awesome list of proprietary files (either from your source folder or technomancers github link) check the galaxytab-common-vendor-blobs.mk for the GT-P1000. It lists every file you need that's propreitary to the tab and where to put it.
Also you'll probably need the debuggerd from /system/bin on the cm7 build.
Compare the /system/build.prop of the cm7 build to your port, make sure the ril info is the same as well as the ro; model, brand, device, board, and platform lines.
Create an update.zip (or whatever you want to call it.zip) and try it.
It's not booting
Logcat is great, but I really suggest using the ddms from the android sdk tools. It's color coded, and gives a much nicer view of what's happening.
Using winmerge in windows or a linux file compare program start checking what other bin files may be missing that you require. Special notice to the xbin folder.
It works! I want to post it!
Ok, first up, make sure you have permission if this is someone elses custom build you've ported. Most people/groups are really good about it assuming you ask first and give them credit in your post.
Also credit everyone who helped, answered a question or sent you in the right direction. (it's just polite)
Second your going to want to make sure your update.zip flashes the kernel, read the update_script from the cm7 build to understand how it works.
So that's it for a start. roll up your sleves, gather your courage and get to it!
Please if you have other tips, add them to the thread, what's better 1 or 2 'developers/porters' or 100?
Thanks. This is very useful for me.
Thanks,
Following this method, with slight alterations to adjust, I was able to port an i9000 phone build to the tab in about 10 minutes, it's really not terribly that difficult once you have the right steps.
The first couple times are usually frustrating but after that you get the hang of it
Hi mssmison Thank you for your guide,it will be very useful in the future! I have only one request,how can I contact you? I have a proposal for you about a dev team (regarding an old think tank)
Thanks for the guide...
Is there any ROM left to port by the way?
Sent from my GT-P1000 using XDA Premium App

[Q] Questions for the devs

Hello devs I was wondering if you guys are able to help me out with an inquiry question. I been researching online for guides on how to create your own roms and cook roms but the information is so overwhelming that I don’t know what to do or where to start. Here I was wondering how you guys learned, and what guides did you use. So far I have only experienced basic programming in python along with c++ but just basic stuff. What kind of programs do I need and how should I start what advice can you guys give me? Anything helps. I know you guys are busy with tweaking the jellybean source trying to port cm10 and aosp , but if you guys have time I would really appreciate it if you guys would help me out. May be it will be good for the long run maybe if I get the hang of it I would be creating roms and tweaks for the community, but the main thing I want to learn.
Thanks for taking your time on reading this message devs.
There are 3 forms of roms.
Source built(best/hardest) - cm,aosp,etc
Ports(medium difficulty) - sense, touchwiz, miui, etc
Modified stock(easiest) - any modified stock rom.
Each type requires different levels of knowledge. For stock roms you could make one using your phone(my first stock rom was made using nothing but root explorer), but i would recommend a decent zip program to unzip the rom at least. If youre serious about deving then you need linux. Ubuntu is the most supported. Windows will work but you need to have a good zip program, notepad++, maybe a kitchen or other tools for deodexing, decompiling frameworks/apks/etc and of course sdk installed.
Most stock roms are just slightly modified, a few scripts, removal of bloat, etc. More advanced mods would be themeing and framework editing to add or remove features. A popular mod is the power options mod that gives reboot to recovery when you hit the power button.
If you want to know where to start i would say start with theming. Its harder than basic roms but worth it because you learn more from the experience. You can either theme an existing devs rom or make your own. Personally i think its best to theme the stock rom and only include your changes in your cwm zip. So if you modify the frameworks and other aspects of the rom you dont need to release an 800mb zip just for a pink notification bar.
Example mods would be lock screens, themes, changes in text, adding features from other roms, etc.
If you have questions just ask.
Sent from my LG-LS970 using xda app-developers app
jokersax11 said:
There are 3 forms of roms.
Source built(best/hardest) - cm,aosp,etc
Ports(medium difficulty) - sense, touchwiz, miui, etc
Modified stock(easiest) - any modified stock rom.
Each type requires different levels of knowledge. For stock roms you could make one using your phone(my first stock rom was made using nothing but root explorer), but i would recommend a decent zip program to unzip the rom at least. If youre serious about deving then you need linux. Ubuntu is the most supported. Windows will work but you need to have a good zip program, notepad++, maybe a kitchen or other tools for deodexing, decompiling frameworks/apks/etc and of course sdk installed.
Most stock roms are just slightly modified, a few scripts, removal of bloat, etc. More advanced mods would be themeing and framework editing to add or remove features. A popular mod is the power options mod that gives reboot to recovery when you hit the power button.
If you want to know where to start i would say start with theming. Its harder than basic roms but worth it because you learn more from the experience. You can either theme an existing devs rom or make your own. Personally i think its best to theme the stock rom and only include your changes in your cwm zip. So if you modify the frameworks and other aspects of the rom you dont need to release an 800mb zip just for a pink notification bar.
Example mods would be lock screens, themes, changes in text, adding features from other roms, etc.
If you have questions just ask.
Sent from my LG-LS970 using xda app-developers app
Click to expand...
Click to collapse
i want to thank you for replying back im going to start out tomorrow and see how far i get and im glad you and maybe other people are willing to help. i appreciate you taking your time for explaining some differences and i will need help but atleast i know i wont be ignored thanks again :victory:
If you have any questions or issues just ask any of us.
Sent from my LG-LS970 using xda premium
Most devs will help, it just comes down to time. If im bored at work ill be online. Most of the stuff i used to do involved a very useful set of servers that allowed me to modify source, build, and place on my site all from my phone. I dont have that setup anymore so im limited to my build computer.
Look through the android forums for some useful tools and guides to get started. Every dev started where you started so keep your chin up
Sent from my LG-LS970 using xda app-developers app
jokersax11 said:
There are 3 forms of roms.
Source built(best/hardest) - cm,aosp,etc
Ports(medium difficulty) - sense, touchwiz, miui, etc
Modified stock(easiest) - any modified stock rom.
Each type requires different levels of knowledge. For stock roms you could make one using your phone(my first stock rom was made using nothing but root explorer), but i would recommend a decent zip program to unzip the rom at least. If youre serious about deving then you need linux. Ubuntu is the most supported. Windows will work but you need to have a good zip program, notepad++, maybe a kitchen or other tools for deodexing, decompiling frameworks/apks/etc and of course sdk installed.
Most stock roms are just slightly modified, a few scripts, removal of bloat, etc. More advanced mods would be themeing and framework editing to add or remove features. A popular mod is the power options mod that gives reboot to recovery when you hit the power button.
If you want to know where to start i would say start with theming. Its harder than basic roms but worth it because you learn more from the experience. You can either theme an existing devs rom or make your own. Personally i think its best to theme the stock rom and only include your changes in your cwm zip. So if you modify the frameworks and other aspects of the rom you dont need to release an 800mb zip just for a pink notification bar.
Example mods would be lock screens, themes, changes in text, adding features from other roms, etc.
If you have questions just ask.
Sent from my LG-LS970 using xda app-developers app
Click to expand...
Click to collapse
very cool joker... made that very easy to understand for all levels of knowledge

Stupid and Simple Question

Hi guys, quick question:
I recall on SOME ROM on a previous phone, I was able to set individual text message tones for each contact. Is this a feature on AOKP or CM10 on the GNex? If not, what messaging app allows this that is LIGHTWEIGHT and VERY simple, preferably as close to the stock on as possible.
*Quick edit* I did Google this but found no answers pertaining to the AOKP or CM10 part. Also, the only apps that seemed to be recommended were overly complicated (or maybe bloated is a better word). I don't want extra buttons or fancy smilies, just to get these sounds rocking.
TIAS.
a maguro wrote this.
I believe this is a built in feature to stock. I have been running custom ROMs for so long now perhaps I am wrong. But every build I have used has this feature that I remember. I am old so my remembering skills aren't super, and there is also the fact that many ROMs use similar bases for some of the AOSP apps. Even if this is a custom ROM thing, you seem to be running one, so I guess it really doesn't matter if it is stock or something added via ROM devs.
Open phone, go to far right tab, edit a contact, press the menu button.
beekay201 said:
TIAS.
a maguro wrote this.
Click to expand...
Click to collapse
I have no idea what this means.
cupfulloflol said:
I believe this is a built in feature to stock. I have been running custom ROMs for so long now perhaps I am wrong. But every build I have used has this feature that I remember. I am old so my remembering skills aren't super, and there is also the fact that many ROMs use similar bases for some of the AOSP apps. Even if this is a custom ROM thing, you seem to be running one, so I guess it really doesn't matter if it is stock or something added via ROM devs.
Open phone, go to far right tab, edit a contact, press the menu button.
Click to expand...
Click to collapse
When I do that, all I get is the option to set Vibration or set Ringtone (for calls) but not for text messages.
FWIW, I am now using AOKP and I see no way to do this.
KogaNinja said:
When I do that, all I get is the option to set Vibration or set Ringtone (for calls) but not for text messages.
FWIW, I am now using AOKP and I see no way to do this.
Click to expand...
Click to collapse
Ah, you are right, sorry. I was lazy, and didn't bother to look through my cherry picks, and I do indeed pick this.
https://github.com/ChameleonOS/andr...mmit/bf44b42d90f9aacca033701c3c9ee319d1703d0c (among a few others this depends on).
It looks like RootBox and Carbon include it. Probably a few others as well.
Wow, okay... is there a quick/easy way to get that into my own AOKP? I'm not too familiar with GitHub so forgive me if there's a giant *DOWNLOAD THE .APK FILE HERE* button I'm unaware of,
KogaNinja said:
Wow, okay... is there a quick/easy way to get that into my own AOKP? I'm not too familiar with GitHub so forgive me if there's a giant *DOWNLOAD THE .APK FILE HERE* button I'm unaware of,
Click to expand...
Click to collapse
That's not how source code and github work.
Sent from my Galaxy Nexus
Pirateghost said:
That's not how source code and github work.
Sent from my Galaxy Nexus
Click to expand...
Click to collapse
And that's why I asked. I am aware of what source code is, and I found a .zip containing it. I was merely asking how one includes it into their own phone (i.e use CWM to install the zip). Admittedly (like I said above), I don't have a clue what GitHub is or how it works. I wanted to know (since I don't know about the structure of Android, at all), can you add this code into your own OS as an app or addition, without rewriting the ROM installed?
KogaNinja said:
And that's why I asked. I am aware of what source code is, and I found a .zip containing it. I was merely asking how one includes it into their own phone (i.e use CWM to install the zip). Admittedly (like I said above), I don't have a clue what GitHub is or how it works. I wanted to know (since I don't know about the structure of Android, at all), can you add this code into your own OS as an app or addition, without rewriting the ROM installed?
Click to expand...
Click to collapse
You don't flash source code. You compile it either into an apk or into your ROM. If you don't understand the Android system then this is not something you will easily accomplish. I do encourage you to learn though. It will open your eyes to a whole new world.
Sent from my Galaxy Nexus
You could try pulling contacts, contactsproviders, and mms from a ROM that includes it, then put it in your current ROM. It may not work though, as it may have more dependencies than those 3. Also, this potentially may break things with your ROM. Making a backup would likely be wise.
Alternative options would be:
- compile a ROM yourself including the fun stuff
- convince AOKP devs to include it
- decompile the necessary stuff, make the changes and recompile
KogaNinja said:
I have no idea what this means.
Click to expand...
Click to collapse
Try It And See. TIAS.

[Q] Building unofficial AOSPA ROM - Need Help

Good morning,
as per thread title I'm trying to build my first custom ROM.
As it is my first time ever trying this, instead of starting from scratch I decided to port an existing ROM to our device.
I decided to go for Paranoid Android (AOSPA) ROM, for two reasons: I previously used and liked very much the KitKat version, and there is currently no port of this ROM.
I read a lot of guides on how to do this, and while I learnt a lot, I'm still not quite sure on how to properly do this. So I thought I might ask for some help.
What I learnt so far is this:
1) Fork Paranoid Android's manifest and add compatible device and kernel repositories (I chose @MWisBest's device repo)
2) Fork Paranoid Android's vendor_pa project and add device support
3) Fork device tree and adapt some makefiles
What I still don't quite get is:
1) Apart for device-specific fixes, is this enough to TRY a build?
2) Regarding device, are there some specific fixes to make a working ROM? (e.g. I knew something about block-based OTAs so I disabled them following ParanoidAndroid's change #68 on Gerrit)
You can see my work on GitHub, search for my username Bruno3589 (I'm not allowed to insert URLs right now, I need to make >10 posts).
I'll try a build ASAP, but it might take a while since I'm limited in terms of internet connection and time.
Any help or suggestion is really appreciated!
Thanks in advance and have a good day
P.S. I know MWisBest's device unifies all variants (tuna) instead of making separate ones (maguro,toro,toroplus), I thought it would be useful to have a single build.

Categories

Resources