text:
How can I add multipath TCP ability to my nexus 5?
I want to be able to connect to my wifi and mobile data plan simultaneously, I've heard that this is possible through MutlipathTCP , and that the support of this protocol has been built in android OS. How can I add it to my Nexus 5 ?

First you will need a multipath TCP enabled Nexus 5, which means:

rooted
with Android 4.4
with the kernel developed to enable MPTCP (available here)

Then you will need to subscribe as an alpha tester for an app that lets you use WiFi and cellular network at the same time. Note, though, that it is deprecated. You can find all the useful links at the end of the page I linked.

when will this be built by defaut in constructors phones ?

Given the fact that MPTCP is currently an experimental standard under developement, I think we will have to wait a lot to see it come with stock ROMs, if it will at all

just want to point out for those coming here later that MPTCP is not "experimental" or "under development", and it wasn't when the comment above this one was written. it was published in 2013 as a final RFC and it is deployed in production to all iOS devices.


text:
Device wants desperately to install a package (com.google.system.s) on its own
I have in my hands a Mpie M8 device (Android 5), The previous owner said it wasn't working properly and I suspected it had a virus. I factory reset it and now the phone wants desperately to install com.google.system.s every 5 seconds even though I press cancel and even though I have WiFi off. I install it and it said that it is about locking. The phone started restarting all the time. I downloaded 360 Security and it said this is malware.
I tried to uninstall it and it said that this app is deep in my phone. I finally uninstall it (with a lots of sweat). And I have the same problem again, every 5 seconds. What is this file? What should I do?

Based from this page, it seems it's removed as malware. However, I couldn't find any info about this malware...

I couldn't find anything in internet either. I don't know what to do. I can't do anything. I can't use any app. This device has a non-removable launcher and all the time it says "loading launcher". When the launcher is loading the phone wants to install this and "launcher stopped working" and "play store stopped working" and "news365 stopped working" etc etc. This happends every some seconds..

I just found the VirusTotal report for this malware. Hopefully, it can give some more insight to nuke it.

Related: http://android.stackexchange.com/questions/139768/i-am-being-forced-to-download-random-apps

From experience, flashing in any conventionally accepted way instantaneously bricks this Mpie M8. It takes a lot of efforts to unbrick it, too. So work with what you have, root it first so that the malware can be managed. When the auto-installation-without-permission starts, pull down notification and click on app info to see which system process is being hijacked and disable it immediately. As an example, mine shows Launcher and Android Service are involved. Have used a different launcher instead just to be on the safe side. Android Service, hiding in /system/priv-app as android_service_800000_0923_outsea.apk, appears the true culprit. Once deleted, the phone runs flawlessly. Of course your phone may have different malware in it depending on which malicious websites that you have visited. Good luck.

Go to Settings → Security → Device Administrators and uncheck  COM.GOOGLE.SYSTEM.S. Now you can uninstall it.

OP wrote: "I finally uninstall it (with a lots of sweat)" (sic) and then noted "I have the same problem again, every 5 seconds. What is this file? What should I do?". Your answer has not addressed the question correctly. Please revise it.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Unlock screen lock on my Samsung Galaxy S5 - PIN code doesn't work
First I pressed the button on Google Settings that says remotely ring, lock & erase  then I pressed the power button. After this my screen with locked (pin code) cones up. It doesn't open with my code, rather it says pin code incorrect.
When this occurred, I checked Google Android Device Manager, there is my phone Galaxy S5 registered in my Google mail but my internet connection, GPS and other things are all switched off in my phone.
But when I press the button there is a code that I didn't understand at that time, and I don't know it now. So how can I disable the lock?

You're being unclear.

If you can't get access via the PIN code, you can sometimes use a much longer code called the PUK code. This is the one you use if the phone locks due to having tried the wrong PIN code too often.
The PUK code comes with the phone, along with the PIN code. Find the original box; it will be there. Possibly on the card that your SIM card was attached to.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Youtube crashes
I shut my galaxy s3 off while I had a video uploading to youtube. Now, whenever I try to go to the uploads tab, the app crashes. I tried logging out, clearing the cache and restarting my phone and nothing works. Does anyone know how to fix this?

Make sure to uninstall the latest update , this could be a bug , uninstall the latest update and reinstall again, this will fix your issue


text:
How to use external sd card as internal memory
I have a 16 GB class 10 SD card and want to swap it with my 2gb internal memory.
MOTO E 1st edition
rooted

That's not how internal storage works. Other than the /sdcard partition you see using your stock file manager, there are a lot of other partitions such as /system /data /recovery etc.
All those partitions are also stored on your phone's internal storage. When you start your phone /boot loads your /system and makes Android run. Then it mounts /data which includes all your user data. Even if you can manage to install this entire / partition on an sdcard, a Stock Android ROM will not recognize an external sdcard as its main storage. Maybe there can be custom ROMs that support such option but I have never heard of such a case. That, of course, doesn't mean it doesn't exist.


text:
Delete words from the built-in dictionary?
Using Android 6. Auto correct usually works very well, so I don't want to turn it off. However on some occasions it stubbornly 'corrects' some words which I don't want, which is extremely inconvenient.
These words are not in my personal dictionary. I've tried the following:

add the word I want to my personal dictionary
add the word I want to the 'all languages' dictionary
add the wrong word (to which it tends to autocorrect) to the custom dictionary and then remove that
repeatedly type in the word and when it autocorrects, click it and set it back to what it was, hoping that Android will learn my preference (I really tried this many many interations)

It's driving me nuts. How do I force Android NOT to autocorrect certain words? Or rather, how do delete some words from its own dictionary?
P.S. I know several similar questions like these were posted before, but they were all either outdated (apparently referring to much older Android versions) or the posted answers didn't work (I've tried them all). Quite some references to Android in 2011 are no longer relevant.
P.P.S. I'm using a Nexus 5, default built-in keyboard.

Keyboards tend to be brand-specific. Can you tell the brand and model of your device?

Right, I added the Nexus 5 spec (that's from LG) so I'm using just plain stock Android 6.

Could you possibly give an example of a word you're trying to type, and the word it autocorrects to?

@DanHenderson in Dutch for example, when I type daf, it autocorrects to DAF, which I never want (it could autocorrect to dag or dat which are legit words, but I never want DAF).

Similar problem here. I have Vanilla Android UI on my Moto G3, I'm using default keyboard (which is Google keyboard). When I type hi, it auto corrects to Hi. Super annoying.

Four years later, this is still a problem without, apparently, a solution.  In my case, as the I and U are right next to each other, my phone often illiterately types "u" when I type "I".  I wish I could remove "u" from the built-in dictionary.

I think it might work to misspell it and then not press spacebar. When the suggestion pops up (on my Gboard, there are always corrections at the top of the keyboard) you can see the word you do not want it to change to if you were to press spacebar. You then long-press that suggestion and then it gives you an option to remove that suggestion. I just did it, and it seems to work so far. I have tried to misspell the word I am having a problem with in all possible ways, and so far it has worked.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Lost my phone, how can I get my contacts from my SD card?
Well, I lost my phone. I know I can get some contacts from google, but it's not phone numbers, only e-mails. (I already tried locating my phone with google, and I was able to do it. It seems to be turned off now, though.) Is there any way that I can get those contacts from my SD card? I can get a new phone, but I can't get all those contacts back.

Did you back up the contacts to you SD card before losing the phone? Normally the contacts are stored on the phone's internal storage, or sometimes on the SIM card.
If you did save the contacts to the SD card before losing it, you should be able to retrieve you contacts by going to your contacts app, and finding the option 'Import/Export', where you can choose 'Import from SD card'.

NO..If you have not backup it to SD card or if you did not backup it using some 3rd party app to your email or drive. there is no way to retrieve that. But next time you can use some backup app there are all over the play store not only contact it can backup every thing in your phone.


text:
What happened to the 'Emoji for English Words' add-on dictionary?
On my Nexus 5 running Lollipop, google keyboard had an add-on dictionary that would suggest emoji in the suggestion box along the top when you swiped a word. I recently upgraded to a 6P with Marshmallow and this dictionary isn't in the list of add-on dictionaries. Was it removed or am I missing something? Is there another way to get this functionality in Google Keyboard? I would prefer to stick to Google's keyboard rather than using a third-party app.


text:
Black screen with system information
I have Prestigio Multipad WIZE 3047 3G. On Tuesday evening something went wrong and I got black screen with some system checks (see picture). Tablet warmed very fast and didn't respond to pressing power button. Pressing reset button caused rebooting that fixed problem.
What could it be and how prevent such problem?
Android 4.4.2 (manufactor's OS version w/o root, JB or something else)
Click image to enlarge

That screen reminds me of hardware tests option available under some stock Recoveries.

Something caused a system crash and the tablet rebooted to try and selftest, similar to what happens when windows "Blue Screens".
Without the logs which we don't have now we can't determine why it crashed or how to prevent it. It could be an unreliable memory region, power delivery fault or just simply a bad bit of code.
If it doesnt happen again then don't worry, not a huge deal.


text:
YU Yureka freezes and reboots since the last Lollipop upgrade 5.1.1
I have YU Yureka. I upgraded it to Lollipop 5.1.1 last week.
Since then, the screen goes blank most of the time whenever I open any application and then it comes back in few seconds and phone restarts automatically many times.
Please can you help me out about this issue?

If this happens after an update you should do a factory reset from the recovery menu and clean your partition cache. Some malfunctions like this is expected in most of the devices after a system upgrade or firmware upgrade. It is always good to clean partition cache after every firmware update.
If you don't know how to perform a factory reset from the recovery menu and to clean partition cache just google it. You should back up all the needed data before factory reset because it will erase everything in your device.


text:
Android Device Stolen, Android Device Manager not set up
My android device has been stolen (Xperia L) and I had not set up Android Device Manager. How do I remove the google access and play store; uninstall apps; protect SD card and personal data; sign out from shopping apps and block the SIM access.
If there is a way to control my phone remotely without having any prior access to the device or Android Device Manager enabled, please let me know.

Even phones where I never installed Android Device Manager are listed for me on google.com/android/devicemanager so I think as long as you are signed in to the Google services you'd be able to use the Device Manager.

But the mobiole phone is switched off, so it is just showing my phone and keeps saying "Contacting Your Phone" and after few minutes it shows "Location Unavailable". If it is another way then please help. Thanks

It's not impossible to control a phone that is turned off or not connected to the internet I'm afraid. What you could do is get the IMEI blocked, you can find your phones IMEI on google.com/settings/dashboard (unfold the arrow next to "Android"). Contact your service provider and give the IMEI to them. This won't prevent the thief from using your phone completely but they won't be able to use your phones cellular network.

If the remote phone is off, or if it does not have network access, you won't be able to control it remotely. If the SIM card is not removed, you could control it via SMS if you set up an app to do certain security functions (with apps like AVG Antivirus). However, remote control from SMS is limited and you need to set it up in advance.
If you did not set up such security measures, there is no way to remotely access your device without network access. Since Android Device Manager doesn't work, we can conclude that the phone has no network access, or it is off.
At this point, although you cannot control your device remotely, you might be able to find out it's last reported location from Google's Location Timeline. This would be able to help you locate it if you did not turn off location history on your device.
If you do locate your device, please do not attempt to confront any suspect by yourself.
From Lookout Mobile Security:

If your cell phone is lost or stolen and you don’t have a mobile security app, the first thing to do is contact your network provider, who will be able to block your phone in order to stop anyone else from using it.
This is particularly important if you have a pay monthly contract, as you will be liable for any calls made (or expensive apps downloaded) before you report your phone stolen.
  Most of the major US network providers allow you to suspend your service and request a new SIM online or by calling their customer service department.
If your cell phone has been stolen it's also important to notify the police, as insurance providers will usually need a crime reference number in order to process any claims.
If you use your smartphone to shop or bank, you may also need a police report to dispute any fraudulent charges made on your debit or credit card accounts using the stolen device.
Make a report at your local station, being sure to give them your device's International Mobile Equipment Identity (IMEI) number, which your network should be able to provide you with. This could help the police get your phone back to you if it were to be recovered.


text:
Nexus 7 tablet won't show files when connected to pc
Having read several threads, let me endeavour to outline the problem.
My computer: laptop running Win 7-64 bit
Tablet: Nexus 7 with latest update (which seems to have caused the problem)
Attempted solutions:
Uninstall the driver
* done this twice
* there are five driver files
  * WpdMtpDr.dll (c:\windows\system32\drivers\umdf)
  * winsub.sys (c:\windows\system32\drivers)
  * wudfrd.sys (c:\windows\system32\drivers)
  * WpdMtp.dll (c:\windows\system32)
  * WpdMtpUS.dll (c:\windows\system32)
* attempting to delete the file winsub.sys results in a message saying permission is required from TrustedInstaller. I don't know what that is, nor how to get permission. So, while I have been able to uninstall the driver, I have not been able to delete it.
NOTE: wpdusb.sys is designated as obsolete by Microsoft
Restart the devices
* first thing tried - to no avail
Use different cables
* done - no effect
Connect through different USB ports
* done - no effect
Change the Storage and USB settings on the tablet
* accessing the menu in the upper right corner only gives "Help and Feedback" as an option. There's nothing about MTP (whatever that is)
Yell, scream and swear
* done - gave me a headache
The device worked properly before the last system update for the Nexus tablet. The device now connects to the PC, and is recognised as being connected. It simply does not display any files.
I am an author and use my tablet extensively for writing. It is important for me to be able to connect the tablet to the computer and move files between the two. Please do not suggest work-around solutions such as Drive or Dropbox. I prefer to have devices that work properly.
Thank you for taking time to read this through and consider the problem. Please let me know if there is additional information that would be useful. Also, please be aware that I am not a developer and do not understand the jargon or shortcuts used by developers. Please be explicit when suggesting a resolution.

It was answered by @John W and edited by Andrew. You can consider "accepting" the answer to signify that the solution solved your problem. This can be done by ticking the mark, next to answer

Connect your Nexus 7 to the PC, then on the android screen swipe down the icons from the top left side of the screen. One of the boxes shown will say "USB for Charging". Tap that box and select "Transfer files (MTP)". Now your Nexus files will show up on the PC as they used to do before the upgrade.
BTW, you have to do this every time you connect to the PC.

Greetings Andrew,
Thank you. Yes, this fixed the issue.
It is surprising that it would have to be done every time the tablet is connected to the PC. I have owned the tablet for several months, have connected it to the computer repeatedly to transfer manuscript files, and have not had to do this before. Ah well, the one surety in life is that things change.
If the issue arises again, I now have the answer. Thank you.


text:
Create An Contact Shortcut for Hangouts
How can I create a Hangouts contact shortcut for video calling on the desktop for Samsung Galaxy Tab A ( Android 5.0.1) ? I searched it a lot of. But, I cannot find any solution ? Any ideas ?

I don't have that app currently but want to clarify something: do you want to create a shortcut for a particular contact or a shortcut which would show the list of contacts for video calling?

When I clicked to shortcut, it will do a video chat with "X" person who is in my Hangouts contacts.

It is not possible to do something like that.
You have 2 options:

Create a widget that the Hangouts app provides for that
Use a custom launcher, to make a custom shortcut to the specific function/activity

Since the app doesn't provide such a widget and the 2nd option can at best open your contact list from a shortcut (tested it), there is unfortunately no other option to get something like that.


text:
pm hide VS pm disable -- the identity crisis
What's the need of pm disable when pm hide already does its job?
I've compiled some information based on my search and research: click here to see the table (edited).
As you can see, pm hide can achieve what pm disable can, but without needing root access. Also, based on my tests, I've reached the conclusion that when pm hide is performed, unlike pm disable, no matter what, the app will not be loaded in the memory again.
I opine that hide descended from block. Block was first introduced in KitKat 4.4.0, remained till Android L Preview and was later superseded by hide in Android 5.0.0. It is not clear to me what lead to renaming of block to hide and why was it needed?
Regardless, if somebody without root access can achieve the functionality of disable, then why does disable exists at all?
Furthermore, why does hide exists? If hide was built supposedly to help users to  get rid of anything they want, without un-installation and without rooting the device, then in the GUI we should be having a relevant option, but we've got only the disable option.
Intertwine questions:

What are the merits and demerits of them, excluding those  noted in my question?

Why both of them exists and to what or whom do they serve?

Is it technically true that hide surpasses the functionality of disable and can truly disable any app, when executed on it?

New: Given findings of Andrew T. and my tests shown in the table, is component shown in hide's usage an error or have I failed to understand latter's usage?
For historical purposes: hide's usage as of now is shown as
  pm hide [--user USER_ID] PACKAGE_OR_COMPONENT

Note: The question does not, in any fashion, seeks unsubstantiated opinion but straight to-the-point answer(s). If you must write an opinion, make sure to back it up using credible and technical sources with sound reasoning to make distinction between what is technical and real and what is speculative.

Tests performed on Carbon ROM (Android 5.1.1) and COS12 (Android 5.0.2) for OnePlus One.

Probably the biggest difference is, you can disable per-app component (activity, service, broadcast receiver, content provider) without disabling the app itself, but you can only hide the whole application. The pm usage is slightly confusing for hide, but the underlying code only process the whole package, not the component. In other word, hide is temporary uninstall -k.

That is interesting info. Now that you've mentioned this info, I would test and report whether hide can disable a component or not. Its usage seems a copy of disable: https://android.googlesource.com/platform/frameworks/base/+/android-5.1.1_r29/cmds/pm/src/com/android/commands/pm/Pm.java#1814

That's why it's misleading; runSetEnabledSetting() checks for component name, but runSetHiddenSetting() only checks for package name. Not sure if it can hide component in the future though.

@AndrewT., thanks you for the information. My tests have shown results in accordance with your information. Please see the revised question including the edited table for further info. If possible at the moment, consider posting a formal answer.

I'd guess, since disable required root so would enable. Having app disabled would then give better guarantees that no malicious app would be able to enable it.

I came to the same conclusion as Andrew...

References: Introduces a new "blocked" state and Rename setApplicationBlocked to setApplicationHidden

I don't have enough points to comment yet.. This is not an answer... more like... information:
pm hide does this
pm disable does this and if it can find the component name then this.
I can see how some people may have thought that pm hide would do an uninstall.
ex.  If you run this command after a pm hide
diff <(adb shell pm list packages -u) <(adb shell pm list packages)

You'll see your hidden package.  -u is a list of previously uninstalled packages.
These pm commands below all invoke androids Intent class.
pm hide <package>
pm unhide <package>
pm enable <package>
pm disable <package>

This command below:
pm hide <package>

invokes:
android.intent.action.PACKAGE_REMOVED.

This below command:
pm unhide <package>

invokes:
android.intent.action.PACKAGE_ADDED.

pm disable and pm enable both invoke:
android.intent.action.PACKAGE_CHANGED.

Thanks @Irfan Latif for the corrections.  I can verify what he was saying.  Under Android Settings:  If you look at installed apps, even after pm hide, you can still see the app is installed.  Interestingly, with pm disable, the app disappears from installed apps.  These commands don't seem to create any obvious filesystem changes.
These directories:
/mnt/sdcard/Android/data/
/data/data

and other misc directories...
One possible hypothesis... Maybe its best practice to always call both commands to disable any package:
pm disable <package>;pm hide <package>

pm hide is available on Android 9 and hiding an app doesn't uninstall it. All (or at least some partial) data is intact after unhide.

I removed my Android 6 reference I removed it just seconds before you posted your comment, but thanks for that.  According to this dude its the same as uninstall -k.  https://github.com/blackbbc/Evil-Hide/blob/master/README_en.md  and https://stackoverflow.com/a/21173985/3066563

pm uninstall -k deletes /data/app/<pkg> directory entirely, pm hide does not.

But still your answer/information doesn't answer, at least, the first line of the question.

Correct.  So do you think it should be deleted then?


text:
Jumpy Touchscreen, Physical Keyboard available, Cursor for Android?
I have an android Motorola Droid 4 (with physical keyboard, Cyanogenmod 12.1), but the touchscreen is jumpy, for example there are some rows that the touch could not be detected at all.. yesterday it's only 1 row (10% of screen), today is 3 rows (30% of whole screen), so I could not point at those rows..
Is there a cursor for android that can be moved by keyboard arrow keys?
As you can see on the screenshot, there are 3 rows that cannot be selected at all..

LMT Launcher's pie-pointer may be able to help: http://i.stack.imgur.com/x6Hkb.png

You might also wish to check the developer options. I vaguely remember having seen something like that there – but I'm not sure whether that might be specific to CyanogenMod.


text:
Removal of the wonderlandads.com pop-up virus
Would anyone know how I can remove the wonderlandads.com pop-up virus from my Nexus 5 mobile - it appears in my Chrome browser.
While there are many sites dedicated to the manual removal of the virus from PCs, despite several searches I am at a loss to find a suitable alternative solution for Android.
I have installed the free versions of AVG, Avast and Kaspersky to no avail, and I am wary of those sites which suggest SpyHunter, etc as a solution, for a fee. Any help, advice or suggestions would be much appreciated.

The easiest thing you can do is a factory reset. Not exactly desirable, but usually gets the job done.

Have you considered using an adblocker?

Does it happen to some sites, or all sites (including some that are proven safe like Google, or this site)? Does it happen on WiFi/mobile data/both?

I'd suggest installing Kaspersky. That got it done with all cases I know.

Hi, I did try the free version of Kapersky but it didn't catch it. Do you know by any chance if the paid-for version works?

Hi, the site pops up on one particular website - telegraph.co.uk - constantly, but on no others that I can see to date. This always happens on wi-fi, as I am abroad at the moment and don't use data roaming

I have considered using an adblocker, but in relation to wonderlandads.com any searches always seen to throw up links to Spyhunter, which looks dubious in the extreme. Any other suggestions fur a safe and effective alternative would be much appreciated

Related SE post

@Max400 hmm... if that's the case, I think telegraph.co.uk is the one which is problematic (hosting the malware), and your device is probably okay. Based on my research, the malware can attack desktop OS through apps and browser extension, but Android's Chrome doesn't support extension, and you don't seem to have suspicious apps installed on Android (do you?). It's possible that your device's hosts file is modified, but I really doubt currently.

Meanwhile, can you try using different browser other than Chrome?

Thanks Andrew, your comments are quite helpful; I will also look at the possibility of removing and reinstalling Chrome (no suspicious apps).

Take a look at This

I managed to successfully identify the cause of wonderland pop ups, this pop up was annoying me for sometime, my PC, two mobiles, a tab was infected and inspite of multiple reset from the scratch didn't work
I realised to look at my router and found a tempered DNS, I validated this with my broadband provider and updated correct one.....this works with me and would work for you as well
Regards
Neeraj

Thank you Neeraj, that sounds promising. I will look into it and see if I have any luck

@Neeraj Where was the so called tempered DNS added? I get DNS right from my provider and no way to define it manually. would u please explain more?

Neeraj is right i'm also experiencing the same problem and found tempered dns in my router and changed it to dns provided by my isp and malware removed from all my devices but it get changed to malware dns after few hours again. So now i have to change it manually and keep checking. I haven't found a permanent solution for this and checked my systems and devices for dnschanger malware with no luck.
Also in this case only puffin browser will help you on android. In nexus 6 chrome is default browser.

Where can one find this tempered DNS? please provide more information

In my WiFi Internet Router's Lan setting there are sub DNS settings. In this there is two fields for primary and secondary DNS, they are getting frequently changed.

I found solution for my windows computers by using free 14 days trail of hitman pro but my android devices are still affected.

Try to remove Chrome from your Android device and use default browser. It was ok for me on Galaxy S6 Edge.


text:
YouTube app full screen cropped by navigation and notification bars persisting on screen
For whatever reason, Google thinks that it makes sense to bring out the navigation and notification bars along with the intrusive annotation that cannot be manually dismissed, then leave the bars there dimmed to black for the remainder of the video covering up a portion of the frame.
This usually occurs when there is some annotation that appears.

My question is, how can these bars be removed?

Do you want to remove annotations? so that the bar doesn't appear or what?

@Matt07211 he wants to hide the notification & navigation bar again. Sometimes this issue happen (I have faced it), and it's not trivial to hide those again.

Pull down your notification bar down and drag out up again. This would hide the notification bar fully. It happens to me and this is how I hide it. What is your phone model and Android version.?


text:
Examine android (v30) selinux policy
I'm trying to find what policy is actually enforced by my phone using selinux.  You'd think this would be easy.  After all, for security it is good to verify that your policy matches expectations.  Unfortunately, I've found this shockingly hard to do, because A) android seems to use a forked policy version 30, and B) the policy toolchain seems to have a very low-quality build process (lots of hard-coded paths, etc.).
Here are two things I've tried that have not worked.  If I try to use off-the-shelf setools tools (such as come packaged for fedora, or can be installed from AUR with arch linux), then I get the following (after pulling /sepolicy from by phone's root directory or factory image):
$ sedispol sepolicy
Reading policy...
libsepol.policydb_read: policydb version 30 does not match my version range 15-29
sedispol:  error(s) encountered while parsing configuration
$ sesearch --all sepolicy
ERROR: policydb version 30 does not match my version range 15-29
ERROR: Unable to open policy sepolicy.
ERROR: Success
$

Okay, so that suggests I have to build the android version of the selinux libraries.  The AOSP source tree comes with precompiled versions of some tools but these depend on old shared libraries that I don't have (like libpcre3).  Anyway, it's pretty shocking if the only way to check your security policy is to trust some binary shared library you get off the net.
So here's what I did to build the android selinux libraries.  On arch, I had to install ustr-selinux from AUR, because ustr uses inline where it is now required to use static inline.  Okay, so far so good.  Unfortunately, the build process is really gross, but I was able to get enough of it compiled and installed with the following:
git clone https://android.googlesource.com/platform/external/selinux \
    android/external/selinux
export ANDROID_BUILD_TOP=$PWD/android
DESTDIR=$HOME/android_selinux
export LD_LIBRARY_PATH="$DESTDIR/lib:$DESTDIR/usr/lib"
cd android/external/selinux
sed -ie '/^LDLIBS.*(LIBDIR)/s/$/ ..\/lex.yy.o/' checkpolicy/test/Makefile
make install DESTDIR="$DESTDIR" \
     PREFIX='$(DESTDIR)/usr' \
     CFLAGS='-I$(PREFIX)/include' \
     -j20 -k
cp checkpolicy/test/dispol "$DESTDIR/usr/sbin/sedispol"
cp checkpolicy/test/dismod "$DESTDIR/usr/sbin/sedismod"

At this point, sedispol works an an ordinary SElinux policy (like a version 29 policy.29 from fedora), but still won't show me what's going on with android:
$ ~/android_selinux/usr/sbin/sedispol sepolicy
Reading policy...
libsepol.avtab_read_item: more than one specifier
libsepol.avtab_read: failed on entry 457 of 5582
/home/user/android_selinux/usr/sbin/dispol:  error(s) encountered while parsing configuration
$

I also tried compiling the vanilla setools3 tools against the android libraries.  Again, not so easy, but I got it to work with:
DESTDIR=$HOME/android_selinux
export LD_LIBRARY_PATH="$DESTDIR/lib:$DESTDIR/usr/lib"
git clone https://github.com/TresysTechnology/setools3.git
cd setools3
./configure --prefix=$DESTDIR/usr --with-sepol-devel=$DESTDIR/usr CPPFLAGS="-I$DESTDIR/usr/include -L$DESTDIR/usr/lib"
make -k -j20

This doesn't fully build, but builds enough of the source tree that I can execute secmds/sesearch.  This sort of works on a vanilla policy.29 file (I can search -A and -T, but --all gives me operation not supported).  However, it completely fails with a similar error when trying to examine an android version 30 file:
$ ./secmds/sesearch -A sepolicy
ERROR: more than one specifier
ERROR: failed on entry 457 of 5582
ERROR: Unable to open policy sepolicy.
ERROR: Success
$

At this point my mind is kind of boggling that the tooling around something so critical as the system security policy is really this hard to build.  Surely I must be doing something wrong.  Has anyone actually managed to examine an android security policy without relying on externally distributed binary shared libraries?
I should add that I also tried the techniques suggested for rebuilding all prebuilt tools (ndk/build/tools/download-toolchain-sources.sh and ndk/build/tools/rebuild-all-prebuilt.sh).  However the download-toolchain-sources.sh script is currently broken.  It tries to check out old version directories that are not in the repositories any more, and anyway it doesn't appear to download any selinux related tools, despite that fact that prebuilts/python contains selinux-related code.  Again, I'm shocked at how crufty these build systems are, and think there has to be an easier way.  The question how can I get tools that allow me to check my android selinux policy?

First of all, I must admit that I fully agree with your "I've found this shockingly hard to do" statement. Google has designed Android mainly from a consumer perspective, and not for power users. The result is that, as soon as you want to do something outside of using the latest Facebook app or playing with Candy Crush, you very quickly find yourself back in realm of early-2000 Linux, when a developer-like knowledge was required to change what should be simple settings. I believe that the situation will fastly evolve as Android system gets more mature, but for now we have to do with what we have got...
As you said, there are two reasons why it is necessary to compile your own SELinux toolset:

The system provided toolset is usually a version behind. While Android's SELinux relies on policy DB version 30, current Linux boxes usually handle only version up to 29.
Even if it would be more recent it would not help, in fact building SELinux from upstream code (which is easilly done, at least on Fedora machines following upstream recommendations) effectively allows the system to handle policy DB version 30, however Android's SELinux has been heavilly modified (Google documentation highlights a few modifications) so trying to handle Android's SELinux fails due to syntax and parsing errors.

So, to keep on the Android's SELinux analysis quest, we will have to put our hands in the dirt... in the cleanest possible way:

First we will setup a sane environment,
Once this is done we will compile Android's SELinux libraries and first tools,
On top of them we will build SELinux tools,
We will finish by adding a few supplementary utilities.

Setup a proper environment
Environment properties
The cleanest recommended, an possibly maybe only reliably working way is to dedicate a environment to your Android work:

A virtual machine is perfectly fine (if not the best option). Prefer to use a VMware one since you will have to connect your phone through USB to the guest system. The free alternative Qemu doesn't seem to handle such task very well. I did not try with other virualization software.
It will need to be a 64 bits system, otherwise the code will simply not compile due to integers being of the wrong size.
It is strongly recommended, possibly mandatory, to use a Ubuntu system. Feel free to use Xubuntu instead if you prefer XFCE's lighter desktop environment, this does not change the system's core and available package and will have no impact on your Android related work (whatever I say about Ubuntu in this procedure also applies to Xubuntu). You may find in Android's SELinux source tree some ReadMe files recommending the use of Fedora instead, these files are inherited from upstream NSA's SELinux project and their content do not necessarily match Google's Android.
The exact version of Unbuntu to use depends on the version of Android you want to build. For Android 6.0, Ubuntu 14.04 (Trusty) is recommended. Check Google requirements page for more information.
You will need plenty of disk space (at least 50GB if you plan only SELinux-related investigation, at least 100GB if you plan for a complete build of Android). CPU and memory are less relevant, they only impact time for a full build and will have no real impact for SELinux related tasks.

Using Ubuntu has two main advantages:

By using the recommended system, you are working in a well-known and well-tested environment: system libraries, tools and packages are at the version and location expected by the project.
And more specifically in our current case: Ubuntu itself relies on AppArmor which is a SELinux alternative, it does not use SELinux. The good news is that you will therefore be able to install Android's SELinux tools and binaries system-wide without risking to alter system reliability.

Environment installation procedure
You can install Ubuntu the traditional way by starting from a full-fledged live-DVD, but a faster alternative is to use a netboot install (textmode install) and select the desktop environment you prefer at the end. Doing so will save you the initial update time by directly installing up-to-date packages version instead of first installing obsolete ones, then asking to apply 389 pending updates on the first boot.
The ISO for Ubuntu/Xubuntu 14.04 (same ISO) netboot installer is available here.
To skip VMware's troublesome "Easy Install" feature, it's a good habit to start by selecting the "I will install the operating system later" option.
Be sure to select Linux, then Ubuntu 64 bits as guest OS.
The VM will need the following ressources:

Mandatory: disk space must be at the very least 40GB (the default 20 GB will not be enough, the source code alone takes more space than that), higher is recommended. A full build requires a 100 GB disk minimum, this is the value I usually take. Do not forget that this setting is just a maximum limit: the actual size taken by the VM grows dynamically with guest's requests.
Facultative: Increase RAM from 1024 to at least 2048 or higher (depends on your host capacity, I use 4096),
Facultative: Increase the number of processor cores from 1 to 2 or higher (depends on your host capacity, I use 3).
The CD-Rom must point to the installation ISO file.
You may want to switch USB from the default 1.1 to 2.0 as the former may give warnings when you connect your device. Depending on your usage, you can also safely uncheck "Automatically connect new USB devices" and "Share Bluetooth devices with the virtual machine".
Depending on your environment, you may also need to tweak display settings (disable 3D, enforce a screen size).

Attention:

If you choosed the netboot install, do not forget to select your desktop environment (Ubuntu desktop or Xubuntu desktop) when reaching the Software selection screen, or you will end-up with a minimal text-only environment!
Upon first boot, refuse to upgrade to the latest release: the whole point here is to stay in 14.04!

Upon first boot, one of the first you may want to do is install Linux guest tools:
sudo apt-get install open-vm-tools

This packet put boot-time triggers, its installation will therefore be complete only after a guest restart.
Fetch Android source code
While similar, the procedure details depends on the chosen ROM:

For CyanogenMod, search for your device (select the vendor first) then click on the "How to build CyanogenMod" link to get instruction adapted for your device.
For AOSP, follow the procedure which starts here.

It can be worth noting that CyanogeMod bundles in its source tree a tool allowing you to unpack boot.img files. To say it differently, CyanogenMod provides you a tool which will allow you to access the sepolicy file stored in devices and ROM archives. Google's AOSP does not provide such tool, so if you have no other imperative using CyanogenMod's source tree may be the most convenient choice, otherwise you will have to install it appart (which is quick and easy to do, so no worry here).
Here I'm following CyanogenMod 13.0 (Android 6.0) procedure. Explanation on the commands used is available on the pages linked above. Please read them, the typescript below is given only for reference purposes.
Tip: While I use apt-get in this post to stick to the lowest common denominator and keep everybody happy, you may prefer to use aptitude instead since it will take care of the dependencies in a better way (when removing a package which required the installation of some dependencies, these dependencies will be removed too, leaving your system cleaner). AFAIK the aptitude command must be installed in Ubuntu but is available by default on Xubuntu.
sudo apt-get install bison build-essential curl flex git gnupg gperf \
libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 \
libxml2-utils lzop maven openjdk-7-jdk pngcrush schedtool squashfs-tools \
xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev \
lib32readline-gplv2-dev lib32z1-dev
mkdir -p ~/bin
mkdir -p ~/android/system
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod u+x ~/bin/repo
cd ~/android/system/
git config --global user.name "Your Name"
git config --global user.email "you@example.com
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
repo sync
# Coffee time: around 20GB are being downloaded, this may take several hours.
source ./build/envsetup.sh
breakfast

Now you have a clean and nearly complete source tree. The proprietary blobs are
missing, but you don't need them for SELinux related tasks.
Tip: Fetching the sources is a tedious process, it may be worth to do a snapshot or backup of your VM now.
Compile and install Android's SELinux toolset and libraries
Now the funny part of the trip begins ;) !
Until now the procedure should have been pretty straightforward. The goal was mainly to ensure that you have the very same environment as me. If you do, the sequel should remain straightforward too.
Under the hood Google's do not hesitate to apply deep changes to Android's source code between versions, therefore the exact compilation steps will be quite certainly version dependent (for instance AOSP master shows that the sepolicy/ directory will be moved).
I will first share my exact procedure to compile and install Android's SElinux libraries and toolset, but in order to keep the relevance of this post over time I will then add some notes about the generic approach to follow in order to solve most compilation issues.
Step-by-step procedure
Android's SELinux libraries provide the abstraction layer which will allow upper layer software to deal with Android-specific SELinux policy files. We will therefore need to compule and install them first (which, in itself, actually represents the core if the difficulties here, until you've found your way).
We will then be able to build and install SELinux tools. As we will see, fortunately these do not need to be Android specific, they only need to match the SELinux library version.
This procedure has been tested both using CyanogenMod and AOSP source code trees.
Compile and install Android SELinux libraries and first tools
First install dependances:
sudo apt-get install libapol-dev libaudit-dev libdbus-glib-1-dev libgtk2.0-dev \
libustr-dev python-dev python-networkx swig xmlto

In this post the variable $ANDROID_BUILD_TOP stores your source location (the directory where you issued the repo sync command). Feel free to change its name as you like.
ANDROID_BUILD_TOP=~/android/system
cd $ANDROID_BUILD_TOP
source ./build/envsetup.sh

By default the policy core utils compilation fails due to restorecond's Makefile being unable to locate some libraries. You have to edit this Makefile in order to use paths dynamically generated by pkg-config instead of hardcoded ones (do not confuse backticks with single quotes!):
sed -i 's/^CFLAGS ?= -g -Werror -Wall -W$/& `pkg-config --cflags --libs dbus-1 gtk+-2.0`/' \
$ANDROID_BUILD_TOP/external/selinux/policycoreutils/restorecond/Makefile

Feel free to open the Makefile with some text editor to ensure that the modification has been correctly taken into account.
And now compile and install:
cd $ANDROID_BUILD_TOP/external/bzip2/
make -f Makefile-libbz2_so
sudo make install
cd $ANDROID_BUILD_TOP/external/libcap-ng/libcap-ng-0.7/
./configure
make
sudo make install
cd $ANDROID_BUILD_TOP/external/selinux/
make -C ./libsepol/
sudo make -C /libsepol/ install
EMFLAGS=-fPIC make -C ./libselinux/
sudo make -C ./libselinux/ install
make -C ./libsemanage/
sudo make -C ./libsemanage/ install
make
sudo make install
make swigify
sudo make install-pywrap
sudo cp ./checkpolicy/test/{dispol,dismod} /usr/bin/

Attention: Do not miss the EMFLAGS=-fPIC environment variable setting when building libselinux. It will not generate any error yet, but in the next step you will be unable to build SETools. In case you missed it or did anything else wrong, simply issue a make clean and restart your compilation.
Compile and install SELinux tools
SELinux tools are provided in a prebuilt form which includes:

Python scripts (and their shell script wrappers) within the $ANDROID_BUILD_TOP/external/selinux/prebuilts/bin/ directory
Python packages (including *.o compiled files) below $ANDROID_BUILD_TOP/prebuilts/python/linux-x86/2.7.5/lib/python2.7/site-packages/.

I would have expected the source code of these tools to be available below $ANDROID_BUILD_TOP/external, but it isn't. Actually, I did not find any place where Google shared the exact version of SETools they used (FYI the GPL only mandates to share the code if it has been modified), so we will have to guess and try and do as best as we can.
The tools themselves are Python scripts, this a new evolution from SETools 4 (in SETools 3, commands like sesearch were binary executable coded in C). However, the tools themselves still show a version of 3.3.8:
$ $ANDROID_BUILD_TOP/external/selinux/prebuilts/bin/sesearch --version
3.3.8

So my guess is that Google took some early development snapshot from SETools 4. Until 4.0.0 beta SETools relied on libsepol versoin 2.4, with 4.0.0 release they started to rely on the version 2.5 of the library which is not compatible with the version of SELinux bundled in Android 6.0 (you can try to compile this, it will just fail).
So the wisest choice seems to go with SETools 4.0.0 Beta.
Install supplementary dependencies:
sudo apt-get install python-setuptools

Download and extract the source code:
cd ~/android/
wget https://github.com/TresysTechnology/setools/archive/4.0.0-beta.tar.gz
tar xzf 4.0.0-beta.tar.gz
cd ./setools-4.0.0-beta/

Due to a bug affecting Flex 2.5, we need to remove -Wredundant-decls from compiler's flags:
sed -i '/-Wredundant-decls/d' ./setup.py

And finally compile and install:
python ./setup.py build
sudo python ./setup.py install

Generic procedure (or "How to unstuck yourself")
In case the procedure above did not work in your case, here is a higher level view on how to try to progress.
There is sadly no magic (and no helper :( ) around here: the only way to get this code to compile is the classical yet dreaded cyclic "try-and-see" approach.
Try to compile a first time, it will most likely fail due to some *.h file being not found:

Search in Android's external/ directory:
find $ANDROID_BUILD_TOP/external -name filename.h

If you find the requested file, then this means that a specific version of the corresponding library or tool has been bundled within Android source code. You should therefore not try to install it from Ubuntu's package system, but instead compile and install the version bundled in Android source code.
Be aware that this goes against general advice you may found on forums: "Your compilation fails because of this library missing? Install this package then it will be fine!", by doing this you will most probably just go into worse issue: if a specific version is bundled, it is most probably because a specific version is needed (due to compatibility issues or because this version contains specific changes from Google).
BTW, if you are wondering: of course this library or tool may also have dependencies raising errors due to some *.h file being not found, and yes you should apply this very same cyclic "try-and-see" approach.
Search systemwide:
find / -name filename.h 2>/dev/null

If you find "missing" the file to be already present in your system in some standard shared library location, this mean that this dependency is probably already met in your environment but the Makefile who raised the error is too dumb to find it.
If you manually directly call this Makefile, it may be possible for you to set some environment variable fixing this (LIBDIR=/usr/lib make for instance), otherwise you may need to modify the Makefile itself (the pkg-config command may be of precious help to automatically generate missing build parameters).
Search in the packaging system:
apt-cache search filename-dev

Where filename-dev represents the name of the missing file in lowercase with the .h extension replaced by the -dev suffix (for instance, if Python.h is not found, search for python-dev). Some tweaking in the exact name may be needed to find the right package.
If you remain stuck and that even a quick search on Internet did not provide any clear answer, then apt-file will be your best friend. apt-file is not installed by default, you need to install it and generate its database:
sudo apt-get apt-file
sudo apt-file update

apt-file allows you to search for packages (even uninstalled ones) providing a particular file. To avoid having too much result, I recommend to associate it with grep as below:
apt-file search filename.h | grep -w filename.h

If there is a package in Ubuntu's repository providing this file, then apt-file should be able to find it.
Once you've found the right package, install it using apt-get install packagename where packagename is your package's name.

Tip: If you screwed something on your system, the command to reinstall a package is this one: apt-get reinstall pkg_name. It will work even when a classical remove & install would not be possible due to breaking dependencies (which is most likely for system's libraries).
Supplementary tools
At this step, you should now have a clean environment allowing you to investigate Android's SELinux rules both in compiled and source formats.
However, most chances are that at the end of your investigation you will want to take some action. In its current shape, your environment will not permit you to modify a device's sepolicy file. In fact, this file cannot be easilly replaced: it is part of the device root directory, and the content of the root directory is extracter at boot time from a RAM disk file, which in turn is stored in the device's boot image.
So you still miss two things before your environment is complete:

A way to access and modify the device's boot image,
A way to modify its sepolicy file.

Fortunately, these are precisely the subject of the two last sections of this post! :)
Fetch and update device's boot image
Tools to fetch and update devices' boot image can be used for a wide variety of things apart from SELinux rules tampering. I have therefore created a dedicated answer, please refer to it.
Modify device's SELinux rules
You have two main possibilities here:

Build a new sepolicy file from the rules in your source tree (search for .te files to find them: find $ANDROID_BUILD_TOP -name \*.te, they are spread into several directories).
Modify the sepolicy file currently used by the device.

Unless you really need to build your rules from scratch, which is more a development-related task and therefore out-of-scope here, the second choice seems by far the safest one as you are sure that the only changes will be the one your explicitely made.
There has been a project to make a tool allowing you to decompile a sepolicy file into a recompilable form, allowing to freely edit rules in between. However this project has been abandonned in proof-of-concept state. You will find all information at the end of this blog post, the rest of the article contains enough details to allow anyone else interested to take over.
The currently recommended way to alter sepolicy rules goes another route: by directly modifying the sepolicy binary file. sepolicy-inject tool allows just that and is actively maintained.
For completeness sake, note that a fork of this tool exist. It adds a few features, some of them being on the original author's to-do list (like the possibility to remove a rule), don't ask me why they choosed to fork instead of contributing...
To compile and install sepolicy-inject, simply proceed as follow:
cd ~/android/
git clone https://bitbucket.org/joshua_brindle/sepolicy-inject.git
cd ./sepolicy-inject/
LIBDIR=/usr/lib make
sudo cp ./sepolicy-inject /usr/bin/

Use-case example
Let's say for instance you want to add the autorization matching the following error message:
avc: denied { read } for pid=128 comm="file-storage"
path="/data/media/0/path/to/some/file"
dev="mmcblk0p28" ino=811035 scontext=u:r:kernel:s0
tcontext=u:object_r:media_rw_data_file:s0 tclass=file permissive=0

You will need to fetch device's boot image, then unpack it to get access to it's sepolicy file.
A quick check using sesearch shows that there is indeed no allow rule (yet!):
$ sesearch -A -s kernel -t media_rw_data_file -c file -p read ./sepolicy
$

The command has no output.
Then, use the command below to add the required rule (note the similarity between sesearch and sepolicy-inject parameters):
sepolicy-inject -s kernel -t media_rw_data_file -c file -p read -P ./sepolicy

Now we can call back our sesearch command:
$ sesearch -A -s kernel -t media_rw_data_file -c file -p read ./sepolicy
allow kernel media_rw_data_file:file read;
$

sesearch output shows that the policy has correctly been updated.
You can now repack the device's boot.img file and flash it back to the device. Checking the last modification time of the /sepolicy file is an easy way to ensure that your device is now running the newly updated sepolicy file.
Conclusion
You should now have a complete environment allowing you to freely inspect and modify Android devices SELinux policies. Enjoy! :)
As a side note, there are also tools allowing to analyze and modify SELinux policy directly from the device.

just one note - never do "repo sync" unless you have a plenty of coffee to drink ;) Use "repo sync -q -f --force-sync -c" instead - it would save you tons of time and hard drive space.  -q is quiet, -f and --force-sync would help you to proceed in case of temporary network errors,  -c would fetch current branch only. P.S. I also use "-d --prune" flags during development when I need to fully erase any local changes and switch to manifest version.

@Oleksandr: Thanks for your information, this is useful to know. I tested with the -c flag, but did not notice any big difference: still as much data for the computer to download (25 GB), still as much caffeine for me to drink ;). I'm a bit wary of the -f flag, as per my understanding this will force repo to ignore when it failed to download some part of the source code and still consider the final result as a success. I prefer to reserve the "success" state to a complete fetch, and avoid finding myself in an unknown situation where files may be randomly missing.

You should first build an older version of libsepol from the AOSP code (like the one corresponding the 6.0 version), then link sepolicy-inject, dispol, etc against it. This recipe worked for me on debian jessie:
cd /to/the/aosp/dir
[repo init, etc]
repo sync external/selinux
cd external/selinux
git checkout android-6.0.0_r1^
cd libsepol
make
libsepol=`pwd`
cd /to/the/selinux-inject-source-dir
make LIBDIR=$libsepol

unlike the sepolicy-inject linked against the system's libsepol, this one works fine with the /sepolicy from the 6.0 image included in the android sdk:
$ sepolicy-inject -Z shell -P /tmp/sepolicy -o /tmp/sepolicy
libsepol.policydb_read: policydb version 30 does not match my version range 15-29
error(s) encountered while parsing configuration
Could not load policy
$ ./sepolicy-inject -Z shell -P /tmp/sepolicy -o /tmp/sepolicy
libsepol.policydb_index_others: security:  1 users, 2 roles, 525 types, 0 bools
libsepol.policydb_index_others: security: 1 sens, 1024 cats
libsepol.policydb_index_others: security:  87 classes, 4767 rules, 0 cond rules

For the tools included in the selinux distribution, the trick is to build them with the same DESTDIR:
cd libsepol
make DESTDIR=/some/dir install
cd ../checkpolicy
make DESTDIR=/some/dir
# here you have a working 'dispol' in the 'test' subdir

Thanks.  This gave me a version of sedispol that seems to work, but I still can't compile sesearch.  Sesearch dies looking for the include file <apol/policy.h> (from within another policy.h file).  Do you know which module contains apol?

@user3188445: The file apol/policy.h is provided by the package libapol-dev (at least it is this one on Ubuntu systems). Please refer to my answer for more detailed information.

You should try to apply this patch to the sources of libsepol, and then incrementaly rebuild all that stuff. It worked for me in the sam issue
You can try to use libsepol clone with applied patch from this repo https://metizik@bitbucket.org/metizik/selinux_tools.git
I use it to build dispol under Windows, and it works to me fine (still notice that I'm using cygwin for this)

To the people facing the issue with:
policydb version 30 does not match my version range 15-29

while working with AOSP code.
Assuming, your AOSP code is checked out to ~/android/source dir:
cd ~/android/source
source build/envsetup.sh
export ANDROID_BUILD_TOP=$(pwd)

And now you are free to use bundled audit2allow utility:
./external/selinux/prebuilts/bin/audit2allow

P.S. Also, I would like to address comment Examine android (v30) selinux policy

Sesearch dies looking for the include file  (from within another policy.h file). Do you know which module contains apol?

Building selinux toolkit from sources https://github.com/SELinuxProject/selinux is not very trivial (unless you are using Fedora). On Ubuntu, you need to install (assuming you've already installed basic dev tools like bison and C compiler) libglib2.0-dev, libcap-ng-dev, xmlto, libsemanage1-dev, libustr-dev, libaudit-dev, libsepol1-dev
But at the end I've still failed to compile it because of https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/793155 and have no idea how to resolve it

I also encountered this glibconfig.h error you are linking at the end of your post, it was raised by restorecond's Makefile because wrong paths were hard-coded in it. You have to modify it to let it dynamically resolve paths using pkg-config. See my answer for more details.

audit2allow, audit2why, and sesearch are all broken with the update AOSP
upstream policy to v.30.
You have to apply patches below and rebuild your Android tree to update policy db. These patched already merged to master branch and available starting from Android N.
https://android-review.googlesource.com/187140
https://android-review.googlesource.com/187111


text:
Error 505 during installation from Play Store
I have LG G Pad. I have been trying to update Google Play Services since October. It always fails during installation. Many of my apps are not working such as YouTube, Gmail, etc.
I tried clearing cache, and I also did it with Play Store too. I restarted the tablet after clearing cache and still to no avail can't update Play services. My LG G4 phone has no problem.
What can I do?

Just for confirmation, is it 505 or -505?

Try to download and install from http://www.apkmirror.com/apk/google-inc/google-play-games/google-play-games-3-7-23-release/google-play-games-3-7-23-2867637-836-android-apk-download/download/
It worked out for me on slimrom for Kindle Fire 5th gen

Solution 1 – Restart your Android Phone:
This is one of the most basic solutions to fix most of the Google Play Store Errors. So, you can try restarting your android phone in order to Fix Error 505 in your android phone. If restarting does not help you fixing the error, then follow below solutions.
Solution 2 – Clear Cache and Data of Google Play Store, Google Service Framework and Download Manager:
Since Error 505 can be caused due to cache conflict or data crash, so you can try clearing cache and data of Google Play Store, Google Service Framework and Download Manager. To do the same, follow the below steps.
Go to Settings.
Click on Apps or Application Manager option.
Now, swipe right further to open All tab.
Now, scroll down and look for Google Play Store app. Click on it.
Here, you will see two buttons – 1. Clear Cache and 2. Clear Data. Click on them.
Fix Google Play Store Error 505 in Android
Click on Clear Cache and Clear Data Options
Now, go back and look for Google Service Framework and Download Manager app. Follow the same above step for them too.
Solution 3 – Reconfigure your Google Account:
Since Google Play Store Error 505 can also be caused due to Google Account Sync Problem, so try reconfiguring your Google Account again. To do the same, follow below steps.
Go to Settings.
Click on Google option under Accounts Section.
Now, click on your Google account and select Remove Account option.
Solution To Fix Google Play Store Error 505 in Android
Remove your Google Account
Now, restart your android phone and reconfigure your Google Account.
Once done, see if it helped you to Fix Android Error 505 in Google Play Store.
Solution 4 – Factory Reset your Android Phone:
This is the last option left to Fix Google Play Store Error 505 in Android Phones.


text:
ERROR : I have enough memory but showing Insufficient storage; can't install app
I am using Moto E(1st Gen.), updated to Lollipop.
Now my internal storage 235mb free,

I try to install hike messenger app. Which has only 16.78 mb,

But, when I try to install am getting an error message as insufficient storage,

When I click view storage,

How to solve it ?

Possible duplicate of "Insufficient storage" when trying to install new app

Have you ever used Lucky Patcher by any chance? Sometimes orphaned .odex files can cause this glitch. If you have, follow the directions here to fix the issue. Alternatively, you can manually delete any relevant .odex files from /data/app/ - they'll be stored in the folder of the app you patched. Normally you should only have to delete .odex files relevant to the app that's giving you the install error.

This could be an SD card issue. Try removing the SD from your device if you have one, and try re-installing this application. Sometimes when you have under >500mb of storage left, your SD card may try to split the download between the internal and external storage.
Maybe try deleting some pictures, applications, or videos you don't need anymore. You can use Google Drive to back-up your data.

It happens to me most of the time. Clearing  cache for the Play Store works, but don't get your hopes up, it only works a couple of times. To clear the cache, try:
Settings → Apps → [offending app] → Clear Cache (a button).
On Marshmallow, this becomes:
Settings → Apps → [offending app] → Storage (tap on the item) → Clear Cache (a button).


text:
32 gb internal storage having 10.82 gb of total files but shows only 5 gb free
I have samsung sm900(galaxy note 3) and out of 32 gb internal storage, only 10.82 gb is used but it shows only 5 gb space free. Please solve this.

Give us the output (screenshots) of Diskinfo and DiskUsage.

That is only the /sdcard partition. Since you are not rooted, that is all you can access. But actually there are a lot of other partitions that are occupying the 32 GB space you have. They include but not limited to, /system, /boot, /cache, /root etc. You can consider them like C:\ and other drives from PC. What you access using File Manager and is equal to 10.82GB is only the /sdcard partition (storage/emulated/0) so there is nothing to help since there is nothing unordinary.


text:
How to disable whatsapp pop notification?
-I just want to disable the annoying           whtsapp headsup notification on lollipop.
-I dont want to Completely stop the notification by unchecking the "show notification" option in the application manager.

You want to disable not completely stop?  Both are contradictory.Please edit and state your intention

@beeshyams I want notification only to appear in notification panel not as a popup. I tried to disable it through the app but still it appears as popup.I think this is a lollipop feature.

Which Android version? In Android 5.1, you can manage the heads-up notification on per app basis or perhaps it is a custom ROM feature, I can't tell for sure.

A non root option is now available. The HeadsOff app can disable all Lollipop Heads-up notifications on your phone. It can also disable Heads-up notifications only for selected apps. If you purchase the Pro key you can restore the ticker text in the status-bar to see a little notification preview.
Original post : How to disable Heads Up notifications in Android Lollipop? (notification popup at top of the screen)

Please see Is it okay to copy-paste answers from other questions?  and Users are calling me a plagiarist. What do I do? The acceptable way is to either flag the question if it is a duplicate of the original, or link the answer in the comments, or, quote the relevant part from the original answer in your answer followed by proper attribution to the author and making the post a community wiki. This solves the issue of amassing reputation from somebody's work..

@Firelord I think if user has mentioned the original post (which in the case it is), there's no problem.

@SantoshKumar, no,  there is a problem: the first step of proper attribution requires  mentioning both the link as well as the author's name. It hasn't been done here. Second, if you're mentioning something word by word from somewhere, then differentiate it from the rest of the content by using quotes. Third, it would constitute as good etiquette for making the post a community one if you have nothing further to add. // Your reasoning can be considered applicable for those cases where the link is additional or supplementary but not important to understand the origin of current answer.

Anyhow, it's not that I want to argue here. I voted the answer and simply explained why I did so. It is up to the poster from now on, whether to become better or maintain status quo.


text:
Music stored on the External SD Card is removed from playlists at reboot
So I'm getting a really frustrating issue happening with my phone wherein any .mp3 files stored on my external SD card are removed from their playlists whenever I restart my phone. Any music stored on the internal phone storage still remains in the playlists but everything else gets cleared out of them. I've taken a look into the Media Store's SQL logs and found this:

Basically, I cleared the Media Store's data to reset the Android media database, then I rebooted. On the first reboot, all my playlists displayed perfectly (external SD music AND internal SD music). This produced the 3 log lines above the highlighted line in the image. Then I restarted my phone again and once again all the music on the external SD card was erased from my playlists. Restarting gave the log lines below and including the highlighted line. What seems to be happening is Android is removing any reference to files stored on my external SD from the Media Store database at reboot, then it rescans when the phone starts, but it generates the playlists BEFORE it scans the external SD for media, so it just thinks there's loads of missing media in the playlists and removes any reference to external SD music. Then it scans the external SD for music and finds all my media there.
So in the end I can still access all the music stored on my external SD and my phone sees it just fine, it's just that it's never maintained in any playlists. If anyone has any method of fixing this or any advice at all, I'd really appreciate it! I don't have enough room on my internal SD to store all my music.
Thanks!
(I'm on a Google Play Edition Galaxy S4 running Android 5.1)

After more experimentation, I've made a breakthrough. Ultimately, this all happens cause Android's Media Scanner will scan the internal SD for media at startup. When it finds Playlist files it attempts to import them into the system database but because the SD card takes a while to mount at startup and is temporarily unreadable for a while at boottime, when it tries to follow the path back to the music on the SD card it can't find the music since the SD card is still mounting. Instead of, yknow, doing anything logical like waiting for the SD to mount, it just erases the entries from the playlist. So to get around this stupid flaw in the system, you need to move all your playlists (.m3u/.pla/etc files) to the external SD card.
By moving the playlist files to the SD card, it ensures that they only ever get read once the SD card has finished mounting and the Media Scanner then attempts to scan the external SD for media. At this point it finds the playlists and follows their mp3 file paths back to the finally loaded Music folder on the external SD.


text:
Is it possible to use one android as a remote speaker for all audio on another android, using no more hardware than an unmodified wifi access point?
I have an android phone (Sony Xperia Compact Z1 / Stock) with an "eh" speaker, and a tablet (Kindle Fire 7" HD / Cyanogen) with amazing speakers. I use the phone a lot to listen to audiobooks, but at home i'd like to be able to use the tablet so i can hear the audiobooks over other noises.
I currently use Smart Audiobook Player since it seems to be the best audiobook software on the market, but it cannot synch progress between different devices, or stream audio between them on its own.
So i would like to stream all audio that is currently playing on my phone, over to my tablet and have it play via the tablet's speakers.
I suppose this should be feasible via Bluetooth or Wifi, but:

No Bluetooth solutions seemed to work, none of them even indicated being able to connect between the two devices.
No Wifi solutions seem to exist that can work with only the two android devices and the unmodified Wifi AP.

Did i overlook some piece of software that can do this?

Progress neither syncs in any of the apps available.

@SantoshKumar I have no idea why you tell me this. If i can stream the audio directly to another device from the one device that tracks progress, then there is no need for synching.

Here are three similar questions. They all deal with Android-PC streaming, but maybe something suggested there will work for you:
http://android.stackexchange.com/questions/95845/realtime-transfer-stream-the-audio-to-another-mobile-device-directly-witho?rq=1
http://android.stackexchange.com/questions/29566/how-can-i-stream-audio-from-my-phone-over-wifi-to-a-speaker-or-receiver
http://android.stackexchange.com/questions/44264/it-is-possible-to-forward-all-audio-to-the-android-smartphone-via-wi-fi?rq=1

@MichelfrancisBustillos The answers in the linked questions either try to do something wildly different from what i described, or flat out did not work on my devices.

THIS app does the trick...
You need to install it on both Android devices and pair them. Then put the tablet in ListenMUSIC over Blueetooth mode and the the phone in shareMUSIC over Bluetooth mode.
HOPE IT HELPS...

Your question led me to this app call AmpMe (both Android an iOS) which promises to do exactly or probably, something similar to your heart desire.
AmpMe:

Sync your phone with friends to create the world's most portable sound system

With the app above, you can play sound to even multiple tablets.

Tried it and it was only able to act as an audio file/stream player which directed remote clients. It was not able to stream all audio as mentioned in my question, nor even specific programs' audio (which could be a suitable substitute.)

Okay. Maybe the exact solution to your problem isn't yet created, perhaps an opportunity to solve a problem?

There is an opportunity to solve a problem here. I'm just baffled it hasn't been done yet, since there are already hundreds of bluetooth speakers available for purchase, and all that would be needed for this is to have an android device act as a bluetooth speaker.


text:
How can I get rid of emulated External SD storage, to allow using a real SD?
I have a Visual Land Prestige Elite 10Q tablet (KitKat 4.4.2, rooted with KingRoot), and have discovered that even after rooting and using a utility to "fix" the SD to be writable from KitKat, I can't move applications to the SD using X-Plore or App2SD, though I can now write files and create folders there.
Based on the error messages I've received from App2SD, this appears to be due to the manufacturer of my tablet having created an emulated external SD using dynamically allocated space in the internal storage (16 GB, so I'm not short on storage yet, at least).  I believe that if I can get rid of this internal_sd storage, move its contents to external_sd, and change the appropriate OS settings so it looks for external_sd, I'll be able to move/install apps to SD.
There don't seem to be any specific ROMs for this device, so flashing to Lollipop or Marshmallow is risky -- I'd prefer to get KitKat to behave, if possible, though I'll consider forcing an upgrade if I must.  I also don't have dozens of hours to spend fooling with this thing.
So, the real question: how can I convince the device to ignore or delete the internal_sd and use external_sd instead?
Update: I've installed a root terminal app, and appear to have access (as su) to the root file system, but I don't find /system/etc/vold.fstab.

Good question. I also would like to know if this is operationally viable. Hopefully some of SE's Gurus will have an answer for you (and me). The correct location would be /system/etc/vold.fstab

I'm not finding /system/etc/vold.fstab on my system.  I've read that Android changed how they control mounting storage between 4.3 and 4.4, eliminating or reducing dependence on this file.  Now I guess I'll have to look up what they changed to.

Thats the location on my LG 4.4.2 Use total commander (or something like) and search your system

I just searched with X-Plore's search and found no entry anywhere for vold.fstab.  In searching for vold.*I found a vold folder, and two files named vold with no extension; one of those was empty, the other 98 kB and appeared to contain non-ASCII data.  Searching for `.fstab came up blank.

If you open the 98kB file with a text editor, there should be a license/disclaimer from Linux. At the end, there should be a reference to a location on your device. If thats not what you see, then the manufacturer has deviated from the "norm".

That 98kB file is /bin/vold -- but as far as I can tell with a text editor, it doesn't have either a Linux license statement, a disclaimer, or a path to the actual fstab equivalent at the end.  It does seem to have a lot of embedded clear text, some of it file paths/names, but it seems to mostly consist of output messages for some program (likely itself).


text:
Root Asus ZenPad S 8.0 (Z580CA)
How can I root ZenPad Z580CA - 8'' IPS - 64 GB - Wifi? Are there any ROMs available for it?

I also found many tutorials, this is one of them http://androidground.com/how-to-root-asus-zenpad-s-8-0-z580ca/ . I wanted to be sure that someone has succeeded rooting this device. That is what I meant. Now we have many replies that help no one. Please only post if you have an answer.

I successfully rooted ZenPad Z580CA by following these two links:
Link1: http://www.asus-zenfone.com/2015/11/how-to-root-asus-zenpad-s-80-z580c.html
Link2: http://dottech.org/190386/how-to-root-asus-zenpad-s-8-0-z580c-on-android-5-0-guide/
Thanks to the authors of the above links, but some steps mentioned in this link need more clarification, so I am adding a detailed procedure here:
Tools Required
 1. Windows PC
   2. Download ADB Fastboot tool (Download)
   3. Download the Intel USB driver (Download)
   4. Download IntelAndroidFBRL05162015PTR (Download)
   5. Download SuperSu (Download)

STEPS
1. Install ADB fastboot tool, Intel USB driver on your Windows machine. Check the link mentioned in Link2:Step4 for installation and checking whether ADB fastboot tool is working. I followed METHOD 1 mentioned in that link.
2. Activate  USB  Debugging  at ZenPad (Settings->Developer  Options,  if  no
developer options, then go to Settings->About->Software information->tap build number 7 times)
3. Connect ZenPad to your Windows machine (laptop/PC).
4. Copy the SuperSU package (the zip file) to the internal SD storage of the ZenPad device.
5. Type: adb devices in windows cmd (press Windows key + R -> type in cmd -> OK) to check whether your device is connected properly or not. If connected properly you can see some key number as the output for this command in cmd. If your device is connected properly proceed to next step.
6. Extract the IntelAndroidFBRL05162015PTR package on your Windows machine. Click the launcher.bat file that is found inside the same extracted folder. Run it in cmd. Wait until it says your device is detected. Now select T2 and Enter. Wait for the device to boot into the custom recovery after about 2-5 minutes.
7. Once the main page of recovery menu has appeared on your tab, use the Volume keys to navigate through the recovery menu and power button for selection. Choose the Install option to browse the SD card and then install SuperSU zip file (file copied in step 4).
8. Once the installation is done, go back to main menu of recovery mode and reboot.
9. Done
You can see that the SuperSu app is installed in your ZenPad now. You can double check the root status by some root-checker apps available in the Play Store.


text:
Why are heads up notifications not showing after an update in Samsung Galaxy E7?
I've recently updated my Samsung device to Android 5.1.1 lollipop and as I have been playing around with it I noticed that I wasn't getting any heads up notifications. Is there a certain option to turn it on or I just don't have it?

Have you checked if it is switched on in Settings > Notifications > Heads up?

See that's just it I don't have such a option like that in my settings...

Is there a search function in your settings? What device do you have specifically?

I have a search function but I when I search "heads up" It doesn't show anything. I have a Samsung Galaxy E7

AFAIK, there's no system option to turn-off heads up, unless you turn off the whole notification (but doesn't seem your case, since you still received normal notification?). Otherwise, check the system notification on Settings - Notifications - App Notifications (or similar).

Could it be that Samsung disabled the heads up functionality in the ROM?

Probably related: How can I get heads-up notification for  on Lollipop?. I think you updated from KitKat directly to Lollipop 5.1.1? If that's the case, then FYI not all apps show heads-up. It depends if the app developers implement it or not.

Go to settings>sound and notification > notification on lock screen>show content hope it work for you

Notification on lock screen =/= heads-up notification. The former is only shown on the lock screen, the latter may be shown anytime, popping from the top of the screen.


text:
Extracting contacts from broken phone
I've broken the glass of my LG G2. Touch is not working. Although I can still connect the phone via USB and see its contents. I want to extract contacts and copy them to my new Android phone.
The phone is not rooted.
Yes, I had sync with my gmail account, but for some reason many contacts where not synced.
Is there anything I could do?

Although touch is not working, can you read the screen? If yes, then does you device support OTG? If true, then buy an OTG cable and use a standard mouse with it and install a contacts backup app from Play Store to make backup of your contacts. ( [tag:adb] can't backup the contacts.)

Also, you can try to sync contacts if your OTG is working.

You will not be able to access the contacts data on an unrooted phone using a file  explorer.
You may be able to use "LG PC Suite" to control and manage the phone from your PC.
As a final option, have you thought of having the phone repaired? Lots of glass replacement businesses out there. Many will  fix while you wait.

Linked has been added


text:
Replicating features of Doze mode using other tools/apps
target android version: 4.2.2
Doze mode is one of the new features of Android 6.0 Marshmallow; In the documentation it is said that:
The following restrictions apply to your apps while in Doze:
Network access is suspended.
The system ignores wake locks.
Standard AlarmManager alarms (including setExact() and setWindow()) are deferred to the next maintenance window.
If you need to set alarms that fire while in Doze, use setAndAllowWhileIdle() or setExactAndAllowWhileIdle().
Alarms set with setAlarmClock() continue to fire normally — the system exits Doze shortly before those alarms fire.
The system does not perform Wi-Fi scans.
The system does not allow sync adapters to run.
The system does not allow JobScheduler to run.

My question is how we can create Doze mode behavior by tools like Amplify, Greenify or other available tools?
For example how we can create a condition that in which the system ignores wake locks? (What tool/app? what config?)


text:
Camera Firmware not installed on GT-I9515L
TL;DR
My Rear Camera doesn't work and the Firmware version for it is null and I think I need to install it manually. How do I do that in a Samsung Galaxy S4 GT-I9515L with PDA I9515LUBU1BOJ1 and CSC I9515LZTM1BOI1?

Everytime I open my camera app, I get a black screen and some of those times it shows a Updating Camera Firmware. Please Wait...
When researching the web,  I found the *#0*# code that tells me Data Line Fail and Camera Failed when I hit the Mega Cam buttom.
Also, the *#34971539# code shows me that I have no firmware installed:
Rear Camera (Main)
Cam FW Ver: null
Phone FW Ver: S13F0LAGE10

What I tried:

Factory Reset. After this, the Google Account got in and re-installed every app and restored every data, but I didn't consider this being the problem due to the Cam FW Ver: null appearing to state that I have no Camera Firmware currently installed.
Phone Firmware Update. I found a Firmware on SamMobiles that matches my Country and Carrier dated 2 weeks ago for Android 5.0.1. I know I hadn't gotten this from OTA because although I use TIM carrier, my phone had the Claro carrier logo, so technically my provider and the firmware didn't match each other. I successfully installed the 5.0.1 firmware and the phone works perfectly, except the camera problem that still persists (no Firmware version).

My guess is that I have to install the camera firmware manually, but I have no idea how to do it. I'd love if somebody could point me to the direction in which I can find the solution.
When opening the app, it gives some freezes, but it's possible to hit the switch camera and use the front camera regularly.
Thank you very much.

Have you tried updating the camera firmware from that *#34971539# menue? use the second option which you can see here

@benjaminS in my case, it's the 3rd button and it's disabled along with almost all buttons in that menu.

when did this problem occur? have you had any damaged hardware or replaced something on your device? seems really weird to me

@benjaminS I believe before I installed the 5.0.1 firmware, all those buttons were enabled (which was yesterday), but I didn't pay attention to any of them and I thought that updating the phone firmware could solve it all. But the actual problem in the camera has been happening for about 1 month now, I just was too busy with other stuffs to set aside some time to play with it and see if I can get a fix. My biggest problem now is that I can't access Web Whatsapp because the QR Code uses the camera and the camera seems to be uninstalled (no firmware).

Maybe this thread can give some pointers?

@beeshyams I have gone through all pages of that thread. Although a few people seems to suffers from the same problem as me (null on camera firmware), no solution for it were provided.

Some inputs different model

@beeshyams that seems to be a dead thread since the OP never replied anyone and nobody posted back a success message reply. Also, the procedure he proposes require files which he doesn't provide. I don't know how to perform those steps in my phone.

Unfortunately, I could not find a software solution, so I took it to the warranty and they fixed it by replacing the camera.


text:
How does the "Cast screen" display feature work?
I have a Galaxy Nexus running Android 4.4.4. Under Settings->Display & lights, there is an option called "Cast screen", which can be toggled on and off. What devices and/or software are compatible with this feature? Is this for Chromecast, or something else? Is the screen picture/video sent via WiFi, Bluetooth, or USB?

It is meant to work with Chromecast, but there are other desktop applications like Reflector 2 that will work with the cast screen setting. You can use the Chromecast app from the Google play store to do the same thing.


text:
What is android.process.acore?
What is the purpose of android.process.acore?
I see many, many questions about acore-related error messages and how to fix them, but not really anything about what the process is in the first place. All I was able to find is this thread at xda-developers which suggests it has something to do with Contacts storage. Can anyone provide a more detailed explanation?

android.process.acore seems to be a process specifically defined for an activity of ContactsProvider/ContactsStorage app. See what is  android:process and the answers for Usage of android:process. Overall, it's a process name defined by an app for its component. That's all I needed to know.

For me it belonged to /system/app/ContactsProvider.apk


text:
How to install superuser HD2 rom on SD card
Usually I just install superuser.zip through recovery. But now nothing happens. I tried using TWRP both from NAND and from SD (latest version with F2FS support).
I try to root this rom: SLIMLP LP5.1.1 based on CM12.1 for HTC HD2.
Looks like the recovery wants to install superuser on NAND always.
I can install superuser application like apk, but root did not work this way. But with adb shell I can get root access. And from screenshots I see in thread people have root. I want to use superuser with this ROM. How do I go about doing it?

UPD: I tried mount two sd_ext partitions before installing superuser, but no changes at all. Also tried change buildin su binary with superuser su binary in rom archive and flash. (permissions are correct) Still no root. Tried install supersu with recovery too.
Maybe someone can ask dev in xda thread about rooting, tried with different vpns and proxy, several e-mail but xda think I'm a spammer. Also wrote support about problem with registration, no reply.

Please specify device and Android version in the question itself, since this may be a device specific issue.

Also, the ROM is probably already rooted. In CM based ROMs, there is a built-in Super User privileges manager, access it through either Developer Options or Superuser settings under Settings. It is not recommended to flash SuperUser on a pre-rooted device, because it leads to a whole host of problems.

It was easier then I thought. I just need activate Developers options and under Developer section activate root.
Video: https://www.youtube.com/watch?v=Knm1kKVkJd8


text:
What do the different device/code names mean?
Most devices seem to have multiple "names" depending on the context, e.g. marketing, updates or rooting. For example:

Huawei P8 lite (actually, not specific enough since there are at least two variants)
ALE-L21 (or ALE-L04)
hi6210sft (ro.product.name from build.prop)
BalongV8R1SFT (ro.product.board)

What are the definitions of all these "names"?

Huawei P8 Lite: This is the basic model; design, UI and features are usually assigned to the model name.
ALE-L21/ALE-L04: This is the specific model; depending on carrier, location etc. This is often used for determining different revisions of one model and specifies the firmware that needs to run on the device.
hi6210sft: This is the internal product name used for identification (e.g. in apps) and update configuration.
BalongV8R1SFT: This is the Mainboard model. It defines which chips (CPU, GPU, RAM, antennas etc.) are build in your device. This may or may not differ from different models, revisions of your model etc. and are usually important for updates, firmwares, custom ROMs etc.


text:
Changing CPU architecture in build.prop won't effect browser
Web pages using NavigatorObject can query my platform and see that it is armv7l. for testing reasons i need impersonate i686 CPU. when i edit ro.product.cpu.abi at system/build.prop it doesn't change anything. are there more files to edit?

Why don't you just use the emulator that comes with the SDK? It's available as an x86 device so it would just fit. You also can't change your CPU's ABI in some file and be done. Just like on desktop PCs, an app can query the hardware for capabilities including the ABI.

@GiantTree no app. i just want change my browser info. now javascript can query my ABI. how can i change that? it is possible

Possibly Firefox (or a fork of it) can change all the information with an extension. I am pretty sure there is something that can make your device appear as a different one (by changing the UserAgent or similar).

@GiantTree for testing reasons i have to use the stock browser. how about that mate?

AFAIK the stock browser does not give you the option to change anything (e.g. UserAgent string). So you need to either use an actual i686 device or an x86 emulator.

Im not at home to post a complete answer, so its a comment until then. Here is how you do it. Using stock browser, go to address bar and type "about:debug" (w/o ""). Then enter browser settings, tap newly added choice DEBUG. Adjust as needed the UAString.

@HasH_BrowN it have only a few profiles. if i try PC it makes me look like a PC to destination website and damage my test. there is a server-side program that renders the page based on UA it gets

@user137070 you stated in your question you "need to impersonate i686 CPU", that's what its doing.


text:
Samsung Galaxy S2 (i9100) stuck @boot & unable to flash
Nearly three years ago my Samsung Galaxy S2 (i9100) system completely broke (after about 1 or 1.5 years of what I would call normal Samsung usage :D - a lot of errors and problems, but usually fixable) and wasn't bootable any more and I decided to install CyanogenMod. After some struggling I was able to flash it correctly via heimdall (on Linux) and used it for more than a year afterwards.
At some point it suddenly stuck at the Samsung boot logo (I can't tell any more if there was a specific reason) and I was really stressed by my job so I had little time to repair it. I bought an HTC and still am very happy with that. Sadly, my brother is in big need of a replacement for his damaged phone so I am trying to repair the Samsung.
I found out that it does not only hang on the boot logo, but also is not able to boot into Recovery Mode by pressing (in that and any other order) [Vol-Up]+[Home]+[Power]. I am able to boot it into Download Mode by pressing [Vol-Down]+[Home]+[Power] though, so I decided to simply try and flash a current CyanogenMod kernel following the CyanogenMod Guide for my device. Neither the latest of the Snapshot nor the latest of the Nightly releases and not even an allegedly official 4.0.3 ROM are working, though.
All kernel uploads hang at ~30MB (cm-12.1-20151114-NIGHTLY-i9100.zip with a size of 232252K @13%, cm-11-20141115-SNAPSHOT-M12-i9100.zip with a size of 210012K @14% and I9100XXLPQ_I9100OXALPQ_XEO.zip with a size of 391632K @7%) and the heimdall command respectively breaks after quite exactly 10 minutes of hanging at that percentage. The output is always something like this:
root@debian:/home/david/Desktop# heimdall flash --KERNEL cm-11-20141115-SNAPSHOT-M12-i9100.zip --no-reboot
Heimdall v1.4.0

Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading KERNEL
14%
ERROR: Failed to confirm end of file transfer sequence!
ERROR: KERNEL upload failed!

Ending session...
ERROR: Failed to send end session packet!
Releasing device interface...
Re-attaching kernel driver...

root@debian:/home/david/Desktop#

The phone does not show a blue transfer bar as indicated by the guide. lsusb recognizes the device as the following, which seems to be correct to me:
Bus 003 Device 013: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)

I have no idea on what to do to fix this or continue debugging. Can anyone help?

[2015-11-19 20:45] Update I:
I downloaded the latest ClockWorkMod Recovery from here and tried to flash it, but the result did only slightly change from hanging at ~30MB to hangig at 100% (the clockworkmodrecovery.6050.i9100.touch.img I tried to flash having a size of 5024K). The process is pretty much the same by any other account:
root@debian:/home/david/Desktop# heimdall flash --RECOVERY clockworkmodrecovery.6050.i9100.touch.img
Heimdall v1.4.0

Copyright (c) 2010-2013, Benjamin Dobell, Glass Echidna
http://www.glassechidna.com.au/

This software is provided free of charge. Copying and redistribution is
encouraged.

If you appreciate this software and you would like to support future
development please consider donating:
http://www.glassechidna.com.au/donate/

Initialising connection...
Detecting device...
Claiming interface...
Attempt failed. Detaching driver...
Claiming interface again...
Setting up interface...

Initialising protocol...
Protocol initialisation successful.

Beginning session...

Some devices may take up to 2 minutes to respond.
Please be patient!

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
ERROR: Failed to confirm end of file transfer sequence!
ERROR: RECOVERY upload failed!

Ending session...
ERROR: Failed to send end session packet!
Releasing device interface...
Re-attaching kernel driver...

root@debian:/home/david/Desktop#

Again, the command breaks after quite exactly 10 minutes of nothing and throws the Failed to confirm end of file transfer sequence! error.
Sadly there is no CM Recovery for my device on the CyanogenMod download site, so I can't try that out. Also the current latest of Snapshot and latest of Nightly releases are getting the same results as before: Both hang at ~30MB - cm-12.1-20151116-SNAPSHOT-YOG7DAO1JN-i9100.zip with a size of 231056K and cm-12.1-20151118-NIGHTLY-i9100.zip with a size of 232248K both @13%.

I would download a custom recovery for your device(TWRP or CWM) fist, flash that one with heimdall and then copy the cyanogenmod zip to your device. Then enter recovery mode and flash the CM rom

See my updated answer. Can't even flash a recovery image - but thanks for the hint, I didn't actually think of that myself.


text:
Can't save anything to sd card
I have an HTC desire 320. I just bought from a koodo stand and the lady talked me into getting a 16g sd card and I didn't even notice till my internal storage was full that it pretty much doesn't work so far I have a notepad app a messenger app and a photo app on it using less than one gig but other than that nothing will save to it even if my internal storage is full and sometimes it randomly unmounts it's self. I've tried everything I could but nothing seems to work.

See this and report your observations by editing question if needed http://android.stackexchange.com/tags/external-sd/info

Since Android 4.4.0 Kitkat, Google has disabled the write permission by default for security measures.
Since the HTC desire 320 is shipped with Android OS, v4.4.2 (KitKat), you can't write to the SD-card by default.
If you want to get the write permission back you must root your device and use an app such as SDFix. You also can manually edit the permission list when you are rooted, but it will be reset every power cycle.