[Q] Forking AOSP to save changes (Root/App Ops)? - Android Q&A, Help & Troubleshooting

Hi all,
First off, I'm an experienced developer, but new to building Android. I'm looking to create my own personal ROM for my Nexus 4, stock AOSP but including root and App Ops. However, I have a couple of questions and clarity issues:
1) What is the proper way to fork AOSP so as I make my changes, they can be saved long term?
I've followed threads like this for setting up and looked into this to try to figure out the most efficient way, but it's not sinking in, so I guess I need a bit of hand holding.
2) Is it possible to enable App Ops in Lollipop pre-compilation?
I see tons of threads on enabling App Ops in JellyBean after compilation by modifying the Settings.apk, but I can't seem to find a way to enable it in the actual source code. Can anyone point me in the right direction? If anyone has guides for adding root and/or the battery percentage hack, that would be helpful as well, but admittedly I haven't done my due diligence searching those on my own yet.
Thanks in advance,
B.

i hope you get what your after.. missing AppOpps / privacy guard is what is preventing me from moving to Lollipop.

Sage said:
i hope you get what your after.. missing AppOpps / privacy guard is what is preventing me from moving to Lollipop.
Click to expand...
Click to collapse
I'm sure there are lots of other ROMs that have this out by now already, but if you want something that's 99.9% factory, mine is compiling now. Assuming my testing works, it will be bone stock LRX21T with a few minor modifications:
Enabled App Ops
Root friendly
Full rotation (including 180 degrees)
I'll let you know how it goes.
Thanks,
Ben

thanks Ben. I actually found an AppOps app in Google Play which works on Lollipop!

Sage said:
thanks Ben. I actually found an AppOps app in Google Play which works on Lollipop!
Click to expand...
Click to collapse
Could you reply here with a link to the App you located for anyone else who may be looking for this?
I just finished up my ROM actually. It's a base AOSP compilation for the Nexus 4 that is:
Root friendly
Has Busybox (for root backups)
AppOps
180 degree screen rotation
Modifications/Fixes to enable GApp support
That last one took a while, as location doesn't work out of the box with Google Location Services. It turned out to be a tiny tweak in the compile signing. Anyway, I just need to add the su binary into the ROM and it's done if you want it.

https://play.google.com/store/apps/details?id=com.findsdk.apppermission
This appopps is working on LP

Thanks sage. I'll likely continue to use my own ROM since future updates won't break my changes or lose root, but that will help many people out who find this thread.

Related

[Q] Prevent all trackball motions

Hi!
My Hero has had problems with the trackball not working for a couple of months but I haven't been bothered by it since I never use it. Lately however, the trackball (or it's sensors on the board) seems to have gotten a life of it's own. It's constantly scrolling upwards making it impossible to navigate in menus and send text messages.
I've read many many threads about people wanting to completely disable the trackball but noone seems to have any idea on how. I've also tried cleaning. If anyone knows about a solution to make the trackball not load when the basic IO functions loads I would be very happy indeed. The problem is not ROM specific since the scrolling occurs in the recovery menu as well.
If it's not possible to "deactivate" it I'm curious if you think it would be possible to write a tiny little background app that listens for the trackballs MotionEvent, catches it, does nothing and then returns true as if the handler in the background app took care of all the work and thus overrides the scrolling that would happend in the browser, menu or whichever context you are in?
The method I've been looking at is: public boolean onTrackballEvent (MotionEvent event)
What do you think?
span_01 said:
Hi!
My Hero has had problems with the trackball not working for a couple of months but I haven't been bothered by it since I never use it. Lately however, the trackball (or it's sensors on the board) seems to have gotten a life of it's own. It's constantly scrolling upwards making it impossible to navigate in menus and send text messages.
I've read many many threads about people wanting to completely disable the trackball but noone seems to have any idea on how. I've also tried cleaning. If anyone knows about a solution to make the trackball not load when the basic IO functions loads I would be very happy indeed. The problem is not ROM specific since the scrolling occurs in the recovery menu as well.
If it's not possible to "deactivate" it I'm curious if you think it would be possible to write a tiny little background app that listens for the trackballs MotionEvent, catches it, does nothing and then returns true as if the handler in the background app took care of all the work and thus overrides the scrolling that would happend in the browser, menu or whichever context you are in?
The method I've been looking at is: public boolean onTrackballEvent (MotionEvent event)
What do you think?
Click to expand...
Click to collapse
Maybe its just too much kernel compiling talking, but I would just kill it the kernel level - sounds easiest to me
Let me know if you want me to look into this, and nag me if I forgot....
Killing this at kernel level would be fantastic if its possible. You would be more than welcome to have a look at this.
I have no knowledge of where to start looking since I know very little about any kernel. I am very interested in learning more though so if you do not have time at the moment I would be very glad if you could provide some pointer on where to start looking.
This would be amazing if possible, my guess would be the kernel too.
I was using all the time at first, but now it's more of a hassle than anything else.
span_01 said:
Killing this at kernel level would be fantastic if its possible. You would be more than welcome to have a look at this.
I have no knowledge of where to start looking since I know very little about any kernel. I am very interested in learning more though so if you do not have time at the moment I would be very glad if you could provide some pointer on where to start looking.
Click to expand...
Click to collapse
Ok, I'll try to get around to it in the next couple of days, bump this or even PM me if I forget.
In the meantime if you want to get your hands dirty in kernel code, heres the section about "my" sources from my flykernel post:
erasmux said:
Kernel Sources
My sources with all my updates and changes are found on github:
http://github.com/erasmux/hero-2.6.29-flykernel
Use hero_defconfig for the regular version and hero-bfs_defconfig for the BFS version.
See the wiki for more information about building the kernel. Another great resource about kernel building is the cyanogen wiki - do note that currently the CM kernel will not work on the hero.
Please feel free to contact me regarding my sources and kernel development.
Click to expand...
Click to collapse
erasmux said:
Ok, I'll try to get around to it in the next couple of days, bump this or even PM me if I forget.
In the meantime if you want to get your hands dirty in kernel code, heres the section about "my" sources from my flykernel post:
Click to expand...
Click to collapse
Thank-you kernel king! Will have to put on some gloves and dig around the source this weekend!
Sent from my HTC Hero using XDA App
Any luck yet?
Nope, not yet. I have not had much time to look into this. Being a complete novice it will probably take me some time
Sent from my HTC Hero using XDA App
I've now found a solution to this that I'm testing out. I've recompiled FlyKernel with a small customisation and it seems stable enough. PM me if you want to see the change or need a flashable zip.

Thinking of rewriting the root script

I need input on if I should keep everything as is or change it to this kind of menu
Code:
Press 1 to root
Press 2 to add gApps
Press 3 to replace system components
I personally like how it is now but want public opinions.
I personally felt that it was fine as is, very simple and straightforward however, if you could make the Root script Unroot too, that would be interesting. Though i have no wants to unroot so i do not know how the process differs from rooting it (i.e. is doable through batch files) so it is even capable of being done that way. My 2 cents for what they are worth.
Also, do not take this as it can't be improved upon as everything can, however even if you didn't it would be fine as is.
xToxicInferno said:
I personally felt that it was fine as is, very simple and straightforward however, if you could make the Root script Unroot too, that would be interesting. Though i have no wants to unroot so i do not know how the process differs from rooting it (i.e. is doable through batch files) so it is even capable of being done that way. My 2 cents for what they are worth.
Also, do not take this as it can't be improved upon as everything can, however even if you didn't it would be fine as is.
Click to expand...
Click to collapse
I already released a unroot one click app. :|
I think it's fine as is. It's easy enough to understand, once you get everything working properly.
I love the root script it eliminated some force close issues on my device. I was wondering since roms are not avaiable if their could be custom scripts. Maybe a super custom script with three keyboard choices a choice of launchers replaced stock email, stock keyboard,gallery, wallpapers, homecatcher and other enhanced apps. I don't know if this is a direction you want to go just throwing it out there. It might help some new users. Also I dont know if its possible to have shortcuts like any cut has incorperated for debug keyboard and application menus that are hidden. Again just thinking outloud so if this sounds like a big pile of suck please just ignore and move on.
yaggermr said:
I love the root script it eliminated some force close issues on my device. I was wondering since roms are not avaiable if their could be custom scripts. Maybe a super custom script with three keyboard choices a choice of launchers replaced stock email, stock keyboard,gallery, wallpapers, homecatcher and other enhanced apps. I don't know if this is a direction you want to go just throwing it out there. It might help some new users. Also I dont know if its possible to have shortcuts like any cut has incorperated for debug keyboard and application menus that are hidden. Again just thinking outloud so if this sounds like a big pile of suck please just ignore and move on.
Click to expand...
Click to collapse
When I ran the script, the last part of nookandzergy that put on a custom keyboard didn't work. So I just reset and did the root with saying no to custom keyboard and it worked fine.
I like your idea. I ran the script in the original thread and it said it was successful. But the android market is hinky. It took dforever to register my device, and now it crashes as soon as it is launched. I did a factory reset, still have the same problem. Is there a way to tell for sure that the root was succesfu,. Thanks btw for your hard work on this. It is greatly admired.
Would it help resolve the driver issue that a lot (me) have had?
Dude thats strictly a windows problem. I swear, trying to get this thing detected properly on windows 7/xp was one of the most frustrating adroid rooting experiences I've ever had. After 3 hours f screwing around with the windows method, I switched to Ubuntu linux and had it rooted in 30 min.
I thought you script was fine as is, this is my first Android device and first experience Rooting and everything seems to be working fine. Thanks
Indirect said:
I need input on if I should keep everything as is or change it to this kind of menu
<snip>
I personally like how it is now but want public opinions.
Click to expand...
Click to collapse
Spoken like a true developer. You craft a thing of beauty and continue to be drawn to making it even cooler.
I don't know if you should rewrite the script or not but I like your attitude!
I decided to not rewrite it to have a numbered menu as that wouldn't go with my idiot pproof batch scripting habits so instead, I added new features yesterday and today.
Sent by breaking the sound barrier
I think it is working great

Anyone tried the new Android 4.0.1 ROM for S2?

I've read the info at SamMobile (related to SamFirmware).
Anyone tried the ROM? From the comments, there are still plenty of bugs...
Edit: Whoever rated this thread 1star is a true moron and a real idiot.
This is a developer site where people do use beta versions.
DannyD said:
Look we release those roms for devs.
Nothing more, we can’t help that people try everything.
Click to expand...
Click to collapse
There are several threads around here already concerning people using this ROM, so yes, people have used it. General consensus is that it's too unstable for daily use.
I'd be tempted to 1-star this thread as well due to lack of searching on your part.
yqed said:
I've read the info at SamMobile (related to SamFirmware).
Anyone tried the ROM? From the comments, there are still plenty of bugs...
Click to expand...
Click to collapse
Well I'll be nice and respond to you.
I've played around with the XXKP1 ROM and for the most part, it was surprisingly stable.
The default launcher IS quite temperamental, so I installed the Trebuchet launcher and 90% of the FC's disappeared. This launcher is a MUST on these leaked ROMs for the time being.
In order to get the best possible experience with these leaked ROMs you need to:
* Install the Bezke XXKP1/2 ROM (http://forum.xda-developers.com/showthread.php?t=1393569) - Flashable through CWM and is pre-rooted and also has the RIL fixes for 3G data
* Change the default keyboard to the standard Android one as soon as you can one to stop the keyboard FC's.
* Install the Trebuchet launcher (http://forum.xda-developers.com/attachment.php?attachmentid=821149&d=1324230099) - and place it in /system/app folder. It should open when you press the home button. Set it as the default launcher.
* Stop the media scanner from running - it's a BIG battery drainer - go to Settings/Applications/Running and stop it there, and also stop the cached process
* Turn off key press sounds and lock screen sounds - having these on causes a continuous partial partial wave lock called 'AudioOut_1' - battery drainer
* Install these Calendar apks (http://forum.xda-developers.com/showpost.php?p=19448865&postcount=2) in /system/app to get the calendar working. Once in /system/app, click on them both to install them. The Calendar will now work
* If you want to use the Contacts.apk and Phone.apk from the 'vanilla' ICS ROM (instead of the installed TW ones) download those APK's (http://www.multiupload.com/6T0019180O) and put them in /system/app. Don't install the MMS.apk though it will break things!
* Turn off the red border from appearing on some screens by going to the Dev Tools App > Development settings > strictmode visual indicator > put it in OFF MODE - then reboot for this to take effect
Battery life then falls to normal levels. Be aware though that when you connect your phone to your computer to transfer files etc, that a media scan will be run again when you disconnect. You'll have to force stop the media scan again otherwise it will keep running.
What rom? That's been kept quiet hasn't it? Certainly no info or discussions anywhere on these forums about it
Everyone will 1-star this because you didn't bother to search before starting a new thread on the same topic!
interfreak said:
Well I'll be nice and respond to you.
I've played around with the XXKP1 ROM and for the most part, it was surprisingly stable.
Click to expand...
Click to collapse
Thanks for the useful post, I'm sure others will appreciate the info.
Sleepycat3 said:
Everyone will 1-star this because you didn't bother to search before starting a new thread on the same topic!
Click to expand...
Click to collapse
Are you for real? I've been a forum member on many sites (not to mention developing vBulletin forum software) since forever, I know how to search. Not to mention that the SamMobile post was made today...
Edit: My bad, I apologize. Just found the thread now... it was not on the first page of results when I initially searched and I never look further than a page (like anyone else I guess). Still, rating a thread 1star is really a baby game. Why not just post the link instead? This is a discussion forum where people communicate, not a Nazi camp where the Moron Patrol votes 1's on everything they think is stupid.
Searching, always searching...
The search here can be finicky, but a google search on site:forums.xda-developers.com is generally good, and fairly up date as well.

How to get crash reports emailed/reported

Has anyone out there has experience with using frameworks to report crashes back to the developer via email of any other mechanism i.e. uploading it to a custom server. How would do you rate/like it?
I can certainly override threaduncaughtexception and roll out my custom, but I'm sure other people would have done that and tried it out and maybe there is a framework that does that.
--
YouAreHere - shows stuff around you
http://market.android.com/details?id=com.roundere
f8andbethere said:
Has anyone out there has experience with using frameworks to report crashes back to the developer via email of any other mechanism i.e. uploading it to a custom server. How would do you rate/like it?
I can certainly override threaduncaughtexception and roll out my custom, but I'm sure other people would have done that and tried it out and maybe there is a framework that does that.
--
YouAreHere - shows stuff around you
http://market.android.com/details?id=com.roundere
Click to expand...
Click to collapse
very good solution:
http://code.google.com/p/acra/
assuming you have you used it, how would you describe your experience with it? What are some of the pros and cons in your opinion?
--
YouAreHere - shows stuff around you
http://market.android.com/details?id=com.roundere
f8andbethere said:
assuming you have you used it, how would you describe your experience with it? What are some of the pros and cons in your opinion?
--
YouAreHere - shows stuff around you
http://market.android.com/details?id=com.roundere
Click to expand...
Click to collapse
..am using it..sorry dont know any cons yet..it´s very well made and lot of apps use that.
thanks, I was reading into it, lib is ~400K, will look into it more
--
YouAreHere - shows stuff around you
http://market.android.com/details?id=com.roundere

[Q] How to create system app in Android Studio that will compile with AOSP ROM?

NOTE TO MODS: If this thread is in the wrong forum, my apologies; please move it to the appropriate forum if necessary.
I've been building my own personal AOSP ROMs for a while now (currently based on LineageOS 14.1, and before that, earlier versions of CyanogenMod), and have incorporated some new settings and features over time, such as the Substratum theme engine and Dirty Unicorns' DUI navbar. Highly configurable ROMs like AICP, DU, RR, etc. are excellent, but are honestly overkill for my needs, which was my motivation to "roll my own" (as well as to gain some behind-the-scenes experience with Android ROMs).
One of the things that these ROMs have in common is a separate settings app (like AicpExtras and DU-Tweaks) that is called from the Settings menu. These apps are incorporated into the ROM (ala Email, Gallery, Browser, etc.) and built using the AOSP build structure. I'd like to create something similar, using Android Studio; I know how to create a standalone app with it, but to (A) create one that can be built using the AOSP build structure as a packaged app, and (B) include access to the ROM's various internal features (i.e. android.provider.Settings) that are only available to system apps, is eluding me. Right now, the new settings are scattered throughout Settings; my goal is to put them all under one roof, so to speak.
(Note that my particular case involves a standalone settings app, but this technique could obviously apply to any app that is intended to be included as a package and built within the AOSP build system.)
I've been searching for information on how to do this, but either it's not out there, or the info is eluding me due to not searching for the right thing. That's why I'm turning to you guys for help. If anyone could offer some guidance and point me in the right direction(s), I would be very grateful. Thanks!
Anyone? Anyone? Bueller? Has no one tried to do this? Or is it just a matter of having asked in the wrong place?
EDIT: The mods moved the thread to a more appropriate forum. Thanks! Hopefully, it'll get more notice here.
Did you get help?
I'm in a similar situation, any tips or pointers?
MJPollard said:
Anyone? Anyone? Bueller? Has no one tried to do this? Or is it just a matter of having asked in the wrong place?
EDIT: The mods moved the thread to a more appropriate forum. Thanks! Hopefully, it'll get more notice here.
Click to expand...
Click to collapse

Categories

Resources