[Completed] Easiest ways to examine and recompile android sepolicy - XDA Assist

I'm using Android 6.0.0 on a bunch of Nexus 6 and Nexus 5x phones, but I think this question likely applies to other recent devices and versions of android (including Lollipop). I'm relatively experienced when it comes to selinux in the server world, and am looking for ways to examine and customize my Android selinux policy. Mind you I have no trouble creating and booting custom boot.img files, where I can alter /init.rc and /sepolicy. Hence, my question is what is the best way to decompile /sepolicy (to see what it is doing), and what is the best way to rebuild it.
Some things I've tried that don't work: Existing tools (sedispol, sesearch) on linux distributions that support selinux do not work, because android uses some weird forked v30 policy file format. The standard tools only go up to version 29, and worse there seems to be a competing candidate for v30 that is incompatible. I've also compiled the AOSP selinux tools on regular linux (https://android.googlesource.com/platform/external/selinux), and those seem to work on standard v29 policy files (such as those from stock fedora), but dispol still cannot seem to examine an android sepolicy file. I get errors like "libsepol.avtab_read_item: more than one specifier".
The final thing I could do is take it on faith that if, say, for my nexus 5x I clone https://android.googlesource.com/device/lge/bullhead, that the contents of the sepolicy directory actually corresponds to what is on my phone. I guess I can live with that since I'll just be replacing the sepolicy file with my own customized version. However, I also can't figure out how to build sepolicy, given again this weird v30 output format required.
So I would appreciate either a pointer to a "howto," or some sort of reference on how to build sepolicy for android, especially those geared towards people who are already use selinux, just don't know how to get the android variants of the tools up and running.

Hello,
Welcome to XDA.
Normally I would just give a link to a better place to ask your question but in your case I will give you the link and a tip for finding what you are going to want to know about this since you are asking about this for the purposes of applying it to many devices.
Ok, to make your search simpler. If you are on your PC or on mobile device using a mobile browser(not an android app that lets you view these forums) look in the top right corner of the page and in the "search all forums" search box, in that box type "SELinux (your model number)" or just "SELinux" this will give you threads that pertain to your devices specifically and SELinux, in them you can find most of what you want.
For more help with questions you can post your questions in the forum linked below.
http://forum.xda-developers.com/android/help
The experts there may be able to help.
Remember to register an XDA account so you can post and reply in the forums. Good luck.

Droidriven said:
Hello,
Welcome to XDA.
Normally I would just give a link to a better place to ask your question but in your case I will give you the link and a tip for finding what you are going to want to know about this since you are asking about this for the purposes of applying it to many devices.
Ok, to make your search simpler. If you are on your PC or on mobile device using a mobile browser(not an android app that lets you view these forums) look in the top right corner of the page and in the "search all forums" search box, in that box type "SELinux (your model number)" or just "SELinux" this will give you threads that pertain to your devices specifically and SELinux, in them you can find most of what you want.
For more help with questions you can post your questions in the forum linked below.
http://forum.xda-developers.com/android/help
The experts there may be able to help.
Remember to register an XDA account so you can post and reply in the forums. Good luck.
Click to expand...
Click to collapse
Thanks for the response. I did search for selinux before posting, and couldn't find anything. This is really a general question about building AOSP, so not that appropriate for any specific device forum. I also browsed the forums, and I think more appropriate than the one you suggested is the software hacking forum (http://forum.xda-developers.com/android/software-hacking), but since I don't have 10 posts I can't post there.

15xda said:
Thanks for the response. I did search for selinux before posting, and couldn't find anything. This is really a general question about building AOSP, so not that appropriate for any specific device forum. I also browsed the forums, and I think more appropriate than the one you suggested is the software hacking forum (http://forum.xda-developers.com/android/software-hacking), but since I don't have 10 posts I can't post there.
Click to expand...
Click to collapse
The forum linked below has some off topic threads that you can post in until you get 10
http://forum.xda-developers.com/general/off-topic
Then you can do a search for XDA University and it will give you everything you want to know about android hacking compiling, porting and building.

Related

ROM building help

I'm on Ubuntu 13.10 and trying to build android. i'm trying to build but it keeps saying
fatal not a git repository
also when i try to change the repo location from home, it keeps telling me about rm* key
some help?
I think you'd be better off asking in a dedicated Android Software Development / Hacking forum. At the moment you're asking in a section dedicated to users of the One XL, so your audience is basically users, asking in the right place will at least give you an audience of people who might be able to help you.
Sent from my Evita
Timmaaa is absolutely correct. Unless you are building specifically for the One X Evita, I have a few good places for you to start.
1. XDA-University. You can find this section by searching under the General page of all forums.
2. Under the all forums section you will also find a section called Android Development/Hacking, as timmaaa mentioned above.
3, I would strongly recommend that you check out the cyanogenmod wiki. There you will find guides for building cyanogenmod on many devices.
4. Google will be your best friend with finding this information.
5. I would highly recommend you read the following post first:
http://forum.xda-developers.com/showthread.php?p=6243873
6. Chef Central under the all forums section will also get you going.
Sent from my One X using XDA Premium 4 mobile app

[Completed] [Q] trying to disable signature check in services.jar 4.4.4 kitkat

as the title stats i been trying to disable the sig check in services.jar stock android 4.4.4 i have followed several guides and have compiled this mod on 4.1.2 touchwiz rom.
now before you ask. i tried to take logcat it didnt work in this state the device couldn't be detected. ive notice that while using file-manger to repair the file /system is completely empty not sure if that is on my part or what but flashing a stock rom back over my current build makes it boot up again no data loss or anything. just point me in the right place or pm me any help is appreciated
im trying to do this for the nexus 7 "flo" 2013 stock 4.4.4 rom based. below is the quick thing of what is happening
decompile services.jar
navigate to pm/packagemangerservice.smali
look for method
.method static comparesignatures([landroid/content/pm/signature;[landroid/content/pm/signaturel
change the follow to what ever
compile and reput the classes.dex back into services.jar push to the device
reboot & wait for android is upgrading to finshe.
and after its done it starts force closing on every app
Sir,
The mission of XDA Assist is to provide basic help to those who have tried searching but can't find what they are looking for and need assistance. This is not a "helpdesk" providing technical assistance but more to point you in the correct direction with your problem. Perhaps you can't find posts on how to root your phone, install custom recovery or maybe you have questions about how to navigate and use features on the site.
Our XDA Assist team will give you links to threads/forums that are relevant to your problem. You may be pointed towards guides and instructions that can be quite complex, so you will still need to read carefully and be cautious before attempting to make software changes to your device. It is essential you are in the correct forum for your device model; what works for one can ruin another.
Thanks for understanding
You can start asking in the device forum related from here: > Nexus 7 > Nexus 7 Q&A, Help & Troubleshooting or directly in this thread: Nexus 7 Help Thread
Good luck
Edited
Well sir can you point me in the right direction.
And for you information. I have already posted in my sub device forum. Nexus 2013 q&a Labeled the same title and yet no replies.
Sent from my Nexus 7 2013 using XDA Free mobile app
Sir,
I pointed you in your device forum and if you already asked there you must wait an answer from the experts. If you don't receive anything you can try asking in this forum :
> Android Development and Hacking > Android Software and Hacking General [Developers Only]
Have a nice day
Good luck

[Completed] File storage web service

Hi,
I'm working on a delivery system for CASUAL, an open-source language I came up with to modify android devices. So I need a place where people can store files. I have a web server at casual-dev.com, but I am unable to figure out a suitable service/system which can do the following:
1. a web login/password system
2. user can upload/modify/delete their files
3. an API for remote access.
4. uploaded files are hosted publicly.
I could use some help locating a suitable open-source service and i don't really know where to go to figure out the answer, or let alone word the question so it's more relatable. I'm asking for something very simple.
Sir,
Please wait an answer from our administrative team.
Thanks
AdamOutler said:
Hi,
I'm working on a delivery system for CASUAL, an open-source language I came up with to modify android devices. So I need a place where people can store files. I have a web server at casual-dev.com, but I am unable to figure out a suitable service/system which can do the following:
1. a web login/password system
2. user can upload/modify/delete their files
3. an API for remote access.
4. uploaded files are hosted publicly.
I could use some help locating a suitable open-source service and i don't really know where to go to figure out the answer, or let alone word the question so it's more relatable. I'm asking for something very simple.
Click to expand...
Click to collapse
Hi Adam,
This section is for helping guide new members on where to find their answer on XDA. I do not think your question is quite so simple as to point you to a thread or forum. Might I suggest you ask in Android Q&A?
Cheers
Kenny
KennyG123 said:
Hi Adam,
This section is for helping guide new members on where to find their answer on XDA. I do not think your question is quite so simple as to point you to a thread or forum. Might I suggest you ask in Android Q&A?
Cheers
Kenny
Click to expand...
Click to collapse
Android Q&A wouldn't be the proper place for a website infrastructure question. I don't know where the proper place would be. This is why I asked here.
AdamOutler said:
Android Q&A wouldn't be the proper place for a website infrastructure question. I don't know where the proper place would be. This is why I asked here.
Click to expand...
Click to collapse
We'll have to figure out the place, but nevertheless this isn't the place, thanks. Maybe ping Sv or Mike C.
Good to go, thread closed.

Samsung s7 g9300 stock rom to put ?

Hello i want help about what is the proper rom to choose abou my s7 g9300.
Thanks a lot
dimitris36gr said:
Hello i want help about what is the proper rom to choose abou my s7 g9300.
Thanks a lot
Click to expand...
Click to collapse
Do a google search for:
"Return to stock (your model number)"
Or a search for:
"Stock firmware for (your model number)"
Or you can go to Sammobile .com or samsung-updates .com and use your model number to search there, you can then choose the newest firmware available for your model number if you want to have the most up to date firmware. Or you can choose any of the available firmwares for your model number.
Sent from my SCH-I535 using Tapatalk
Droidriven said:
Do a google search for:
"Return to stock (your model number)"
Or a search for:
"Stock firmware for (your model number)"
Or you can go to Sammobile .com or samsung-updates .com and use your model number to search there, you can then choose the newest firmware available for your model number if you want to have the most up to date firmware. Or you can choose any of the available firmwares for your model number.
Sent from my SCH-I535 using Tapatalk
Click to expand...
Click to collapse
This rom is compatible with my phone? i dont want the chinese version that i have now (g9300=the chinese version is without google play)
http://forum.xda-developers.com/gal...-1-s7-stock-rom-v1-bloat-script-mods-t3423409
Thanks
dimitris36gr said:
This rom is compatible with my phone? i dont want the chinese version that i have now (g9300=the chinese version is without google play)
http://forum.xda-developers.com/gal...-1-s7-stock-rom-v1-bloat-script-mods-t3423409
Thanks
Click to expand...
Click to collapse
The thread says it is for G930F, you have G9300. ROMs are built for specific model numbers but sometimes devices in the sane series can share ROMs. You'll have to read through that thread or ask questions in that thread to see if that ROM works on your device. Don't use it unless you get confirmation or see it documented somewhere that it actually works on your model.
Sent from my SCH-I535 using Tapatalk
Droidriven said:
The thread says it is for G930F, you have G9300. ROMs are built for specific model numbers but sometimes devices in the sane series can share ROMs. You'll have to read through that thread or ask questions in that thread to see if that ROM works on your device. Don't use it unless you get confirmation or see it documented somewhere that it actually works on your model.
Sent from my SCH-I535 using Tapatalk
Click to expand...
Click to collapse
i try to ask but i cant post in the specific thread because i take the message bellow
"Oops! Sorry, dimitris36gr, you do not have permission to access this page. This could be due to one of several reasons:
New members (those with few posts) are not permitted to post to development-related forums. The developer forums are intended for experienced users and developers to discuss ways to improve technical aspects related to ROMs and software. New users can read posts and download files, just cannot post for a bit.
To ask Questions about developing your device, installing ROMs, software and themes you must go to the Q&A or General Forum.
Remember, your question has very likely been asked already, so please search before posting.
Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation."
can you suggest me logical solution?
thanks
dimitris36gr said:
i try to ask but i cant post in the specific thread because i take the message bellow
"Oops! Sorry, dimitris36gr, you do not have permission to access this page. This could be due to one of several reasons:
New members (those with few posts) are not permitted to post to development-related forums. The developer forums are intended for experienced users and developers to discuss ways to improve technical aspects related to ROMs and software. New users can read posts and download files, just cannot post for a bit.
To ask Questions about developing your device, installing ROMs, software and themes you must go to the Q&A or General Forum.
Remember, your question has very likely been asked already, so please search before posting.
Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation."
can you suggest me logical solution?
thanks
Click to expand...
Click to collapse
When you get a total of 10 posts you will then be able to post in development threads. That's a standard thing they have in place here to keep new members out of development threads and give them time to learn their way around here and get familiar with the rules before they post in serious development threads.
Find the Off-Topic forum here and make some posts or ask more questions in the help threads and Q&A forum. When you get to a total of 10 posts then go ask in the thread the ROM is in.
Sent from my SCH-I535 using Tapatalk

Sony XA2 AOSP building problems

Hi,
first post on this forum -> hope this is the right section, sorry if it isn't.
So I'm here because I have a problem regarding the building process of AOSP for the sony XA2
I'm following those steps : developer.sony.com/develop/open-devices/guides/aosp-build-instructions/build-aosp-nougat-8-1-oreo-4-4
(adding https for opening)
The problem appears on step 4, part 4 : I do not have the repo_update.sh
So first question very simple, does anyone has it ? what am I missing.
Although I'm not especially new to development, I found it on the repo (don't know why it does not come still -> I suppose it's not in the manifest, yet why is it suppose to be in the tutorial ?)
The next question are regarding my newbie state in android development / flashing / OS
Cause next I would need to flash the boot.img vendor etc . . . I did not find nowhere the explanation of where to find those and I'm kind of frustrated of finding absolutely nothing EXPLICIT on the matter.
So could someone point me to a newbie tutorial / explanation please ? or directly explain it to me if it's not too long.
For the record, I understood what those images are, I just don't know where to find them.
ok It's more a general confusion due to the fact that I'm new to Android than anything else still, I need answers
Thank you for your responses in advance.
1nsaneMan said:
Hi, first post on this forum -> hope this is the right section, sorry if it isn't. So I'm here because I have a problem regarding the building process of AOSP for the sony XA2...
Click to expand...
Click to collapse
I don't have this device and I've never personally built a ROM before but, you should be able to obtain some member guidance within one of the following threads.
https://forum.xda-developers.com/showthread.php?t=2059939
https://forum.xda-developers.com/showthread.php?t=3499666
https://forum.xda-developers.com/showthread.php?t=3296086
https://forum.xda-developers.com/showthread.php?t=3469420
https://forum.xda-developers.com/showthread.php?t=3250984
https://forum.xda-developers.com/showthread.php?t=2455005
There's more on the forum but, these should give you a good start.
Good Luck!
~~~~~~~~~~~~~~~
I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
Ok truth is, I think something is wrong with my system, I have a linux 17 maybe it's not the right one to do this, I tried with a 'normal' 16.04, I went further, have other problems, but I'm finding solutions on the forums.
Precisely in the links you gave me so thanks for answering the questions that I did not have time to ask ^^
Thank you for your help, have a nice day.

Categories

Resources