yashsingh1/xdaforums huggingface dataset:
[Galaxy Tab 4 General] moonbutt74:
This NOT a Q&A thread. Only people working out the problem are welcome.

okay , so as of flashing even supersu beta version BETA-SuperSU-v2.49 this is the issue i'm guessing for our device

for reference the firmware release api in question is Android 5.1 , API Level 22

root@kali:/# adb logcat -d | grep F/
F/appproc ( 305): Error changing dalvik-cache ownership : Permission denied
F/libc ( 305): Fatal signal 6 (SIGABRT), code -6 in tid 305 (app_process32_o)
F/appproc ( 1026): Error changing dalvik-cache ownership : Permission denied
F/libc ( 1026): Fatal signal 6 (SIGABRT), code -6 in tid 1026 (app_process32_o)
F/appproc ( 1389): Error changing dalvik-cache ownership : Permission denied
F/libc ( 1389): Fatal signal 6 (SIGABRT), code -6 in tid 1389 (app_process32_o)
F/appproc ( 1758): Error changing dalvik-cache ownership : Permission denied
F/libc ( 1758): Fatal signal 6 (SIGABRT), code -6 in tid 1758 (app_process32_o)
F/appproc ( 2123): Error changing dalvik-cache ownership : Permission denied
F/libc ( 2123): Fatal signal 6 (SIGABRT), code -6 in tid 2123 (app_process32_o)
F/appproc ( 2482): Error changing dalvik-cache ownership : Permission denied
F/libc ( 2482): Fatal signal 6 (SIGABRT), code -6 in tid 2482 (app_process32_o)
root@kali:/#

after looking at the script i ran and got this

root@kali:/# adb shell ls -al /system/bin/app*
[COLOR="Red"]lrwxrwxrwx root root 2014-03-07 10:19 app_process -> /system/xbin/daemonsu
lrwxrwxrwx root root 2014-03-07 10:19 app_process32 -> /system/xbin/daemonsu
-rwxr-xr-x root shell 13588 2015-07-02 14:29 app_process32_original[/COLOR]
-rwxr-xr-x root shell 13588 2014-03-07 10:19 app_process_init
-rwxr-xr-x root shell 57688 2015-07-02 14:29 applypatch
-rwxr-xr-x root shell 213 2015-07-02 14:29 appops
-rwxr-xr-x root shell 215 2015-07-02 14:29 appwidget

undoing that with this

rm -f app_process app_process32
ln -sf /system/bin/app_process32_original /system/bin/app_process

"resolved" the "error" so if you flashed supersu thinking YAY ROOT ! and ended up with what you got you need to run what i did to

regain what you had.

SO, linking daemonsu in a different way is probably the thing but, how?

so far selinux is still alive i am trying out a patch [MENTION=4861219]RunasSudo[/MENTION] suggested here

http://xdaforums.com/google-nexus-5/devs-only/correct-to-compile-permissive-selinux-t3074761

also i am trying to figure out how app_process works

[MENTION=5954417]thisisapoorusernamechoice[/MENTION]

sorry for hijacking your thread. m :o
[Galaxy Tab 4 General] moonbutt74:
Okay, so with a modified adbd in /sbin i achieve a root prompt through adb

Note - at this point i do have full control over the system. yay!

but at the cost of blank display and no functions of hardware input [no touch hard buttons] awww (frowny face)

interesting note, the stock adbd has root access/privelege when executing adb reboot recovery.

does anyone have a lead on how to bind a block device to a tcp port ?

something like this, but that works, and as a service maybe?

cat /dev/whatever | nc -l 2345
[Galaxy Tab 4 General] moonbutt74:
okay if i'm seeing this right...,

F/appproc ( 305): Error changing dalvik-cache ownership : [COLOR="Red"]Permission denied[/COLOR]
F/libc ( 305): Fatal signal 6 (SIGABRT), code -6 in [COLOR="Red"]tid[/COLOR] 305 (app_process32_o)

my gues would be selinux denial based on wrong/incorrect type id

from file contexts

/system/bin/app_process32	u:object_r:[COLOR="Red"]zygote_exec[/COLOR]:s0

from zygote.te

# zygote
[COLOR="Red"]type[/COLOR] zygote, domain;
type [COLOR="Red"]zygote_exec[/COLOR], exec_type, file_type;

soooooo when the shuffling around of app_process* happens and /system/xbin/daemonsu is linked to /system/bin/app_process

should daemonsu instead of being [from supersu installer script]

/system/xbin/daemonsu 0755 u:object_r:system_file:s0

be

/system/xbin/daemonsu 0755 u:object_r:zygote_exec:s0

?

i don't think it sepolicy version 26, same as sm-t530nu, i'm also using the sm-t53nu's LL kernel source release for my sm-t330nu LP kernel build, so it's not the knox ****ery in the kernel source. so it's the actual policy itself ?
[Galaxy Tab 4 General] moonbutt74:
I'm going to do an experiment by flashing/writing the system.img.ext4 from the sm-t530nu LP release with a modified boot.img

to the sm-t330nu [post LP release flash]

If it works it would effectively be a downgrade to 5.0.X

This has worked with [MENTION=3132221]sub77[/MENTION] 's LP builds for sm-t530nu to "port" them to sm-t330nu soooo

more to come ?
[Galaxy Tab 4 General] moonbutt74:
okay, sooooo

now that my sm-t330nu has the official LP release installed, i CAN flash the system.img from the official sm-t530nu to it and boot successfully,

so i was right about the tied to firmware thing.

Now after a few different tests i am unable to "downgrade" my boot.img to match the sm-t530nu release version wise, policy and all

and remain at android 5.1.1 NNNYYYAAAAAHHHHHHHHH ! [WHEW okay , glad to get that out.. ]

SO, i flashed supersu to see what would happen and got the same result as before BUT, totally sepolicy contexts

Without restoring system or doing the meatball surgery from the previous post, i instead manually changed the policy context

of /system/xbin/daemonsu through adb in recovery

[note- you must enbale dev-options--->debugging

adb reboot recovery
adb shell mount /system
adb shell
chcon u:object_r:zygote_exec:s0 /system/xbin/daemonsu
chattr +i /system/xbin/daemonsu
reboot

SHINY ! no root. but boots

shell@milletwifikx:/system/bin/.ext $ ls -Z /system/xbin/daemonsu
-rwxr-xr-x root root u:object_r:zygote_exec:s0 daemonsu

Okay so now we need to know proper context for

/system/xbin/su

/system/bin/.ext/.su

hmmmm... i am going outside to play.

Nature sucks, the resolution is terrible ! xD

okay android 5.1.1 samsung policy context for system libraries is

u:object_r:system_library_file:s0
[Galaxy Tab 4 General] moonbutt74:
okay so far nutz..,

i found this for setool utility [setools-android-sepolicy-inject] project by [MENTION=1912440]Mikos[/MENTION]

http://xdaforums.com/android/software/setools-android-sepolicy-inject-t2977563

i've forked his sources https://github.com/xmikos/setools-android

adjusted for api, and will try this method.

Android NDK

wget https://dl.google.com/android/ndk/android-ndk-r10e-linux-x86.bin

m
[Galaxy Tab 4 General] moonbutt74:
okay,

got Miko's toolkit compiled, this is the output of seinfo

\shell@milletwifiue:/ $ seinfo

Statistics for policy file: /sepolicy
Policy Version & Type: v.26 (binary, mls)

Classes: 86 Permissions: 271
Common classes: 5
Sensitivities: 1 Categories: 1024
Types: 1169 Attributes: 162
Users: 1 Roles: 2
Booleans: 0 Cond. Expr.: 0
Allow: 14802 Neverallow: 0
Auditallow: 0 Dontaudit: 401
Type_trans: 458 Type_change: 0
Type_member: 0 Role allow: 0
Role_trans: 0 Range_trans: 0
Constraints: 59 Validatetrans: 0
Initial SIDs: 27 Fs_use: 19
Genfscon: 43 Portcon: 0
Netifcon: 0 Nodecon: 0
Permissives: 0 Polcap: 2

shell@milletwifiue:/ $

i'm looking for someone who can run me through how sepolicy injection works specifically.

I don't know enough to interpret a generic example.

what i can understand right now is daemonsu disguised as app_process cannot access/change what it needs to in dalvik-cache due to incorrect/wrong -tid if that's the right way to say it. :confused:

this again

F/appproc ( 305): Error changing dalvik-cache ownership : Permission denied
F/libc ( 305): Fatal signal 6 (SIGABRT), code -6 in tid 305 (app_process32_o)

Mikos said the following as to command line syntax

m
[Galaxy Tab 4 General] jazzespresso:
so how much progress you have done so far? need any help?
[Galaxy Tab 4 General] moonbutt74:
Jazz,

have you ever done any work with sepolicy, setools ?

is there a way or do you know the right way to do the policy injection part of what Mikos described for

su and daemonsu ?

when i run strings on the sepolicy binary i do find su_exec.

so i'm still at daemonsu being the culprit. [MENTION=631273]Chainfire[/MENTION] does make it clear the there is a hijack of app_process going on

and i do believe it works for other devices running a "state sanctioned" 5.1.1 so this is/has to be a dicky samsung move.

also how to determine the correct tid if that is indeed what i'm looking for. [see OP]

m
[Galaxy Tab 4 General] jazzespresso:
Will look into that, not sure how much differences between android 5.0.X and 5.1.1..
[Galaxy Tab 4 General] moonbutt74:
It seems to be all sepolicy, i had to adblock and put in my usual apps minus root apps via adb push.

Swapping policy from the 5.0 boot.img reseults in no visuals or input but at adb/terminal i have access,

It just occured to me that i have not yet tried the policy swap and then applied root, hmm.

After i unscrew my system, i upgraded but forgot to change from sid so now wifi is totally boned, xD

I'll try that out, i figure it's something with ueventd.?

On disabling the policy it's complete no go so far.

In spite of modding init.rc

To disab;e sepolicy reload, to write to sys/fs/selinux/enable/0 and trying kernel cmdline edits for enforce=0 androidboot.selinux=0 etc, results

In bogus disable or no boot and dead adbd. Fun fun fun !
[Galaxy Tab 4 General] moonbutt74:
this is a copy/paste from my earlier sepolicy trip from galaxy tab 3 forum, putting here for reference

On-Device Policy Files

/sepolicy: Kernel binary policy

/file_contexts: File security contexts

/property_contexts: Property security contexts

/seapp_contexts: App security contexts

/system/etc/security/mac_permissions.xml: App certificate to seinfo mapping

On mac_permissions.xml

●At build time, mac_permissions.xml signature tag names (e.g. [MENTION=451225]platform[/MENTION]) are rewritten to the actual

certificate value extracted from .pem file specified by external/sepolicy/keys.conf

.●build/tools/releasetools/sign_target_files_apks rewrites mac_permissions.xml with updated certificate values for new keys.

System Apps by Certificate

●mac_permissions.xml:

<signer signature= [MENTION=451225]platform[/MENTION]" >

<seinfo value="platform" />

</signer>

●

seapp_contexts:

user=_app seinfo=platform domain=platform_app

type= app_data_file

---------------------------------------------------

Okay so what is this _u _r _t suffix stuff?

• _u – SELinux user

eg: system_u – used for running system services

• _r – SELinux role

eg: system_r – for daemons and background processes

• _t – SELinux type / domain

eg:httpd_t

you can change a single domain to permissive mode

-------------------------------------

the original thread is here, i forgot all about mac_permissions.xml when swapping policy

http://xdaforums.com/galaxy-tab-3/general/se-linux-policy-information-thread-t2865457
[Galaxy Tab 4 General] jazzespresso:
I was thinking about getting policy from the 5.0 boot.img and try and see...not sure if it would work - you may try and let me know your results

1) 5.0 sepolicy file.

2) initrd.img current one

3) initrd.img current one

It has been long time man I worked on it or dig this stuff......hmmm....hmmm....Galaxy S6 developers got root on 5.1.1, so this should be not so hard.....
[Galaxy Tab 4 General] moonbutt74:
okay so the sesearch string looks something like this , yielding the following output

root@kali:/storage/AIK-Linux/ramdisk# sesearch -A -s shell -t system [COLOR="Red"]-c file[/COLOR] sepolicy
Found 3 semantic av rules:
allow shell newAttr33 : file { ioctl read write getattr lock open } ;
allow newAttr7 newAttr33 : file { ioctl read write getattr lock open } ;
allow appdomain newAttr33 : file { ioctl read write getattr lock open } ;

but if i leave out the -c [class=name] option it works sort of like a wild-card and i get this

root@kali:/storage/AIK-Linux/ramdisk# sesearch -A -s shell -t system sepolicy
Found 20 semantic av rules:
allow shell system_server : process { transition siginh rlimitinh } ;
allow shell newAttr33 : process getattr ;
allow shell newAttr33 : file { ioctl read write getattr lock open } ;
allow shell newAttr33 : dir { ioctl read getattr search open } ;
[COLOR="Red"]allow shell newAttr33 : lnk_file { ioctl read getattr lock open } ;[/COLOR]
allow appdomain domain : process getattr ;
allow domain system_server : fd use ;
allow newAttr7 newAttr33 : file { ioctl read write getattr lock open } ;
allow newAttr7 newAttr33 : dir { ioctl read getattr search open } ;
[COLOR="Red"] allow newAttr7 newAttr33 : lnk_file { ioctl read getattr lock open } ; [/COLOR]
allow newAttr1 binderservicedomain : fd use ;
allow newAttr1 binderservicedomain : binder { call transfer } ;
allow appdomain system_server : fd use ;
allow appdomain system_server : fifo_file { ioctl read write getattr lock append open } ;
allow appdomain system_server : tcp_socket { read write getattr getopt shutdown } ;
allow appdomain system_server : unix_stream_socket { read write getattr getopt setopt shutdown } ;
allow appdomain newAttr33 : file { ioctl read write getattr lock open } ;
allow appdomain newAttr33 : dir { read getattr search open } ;
allow appdomain newAttr33 : lnk_file { read write getattr open } ;
allow appdomain system_server : binder { call transfer } ;

the lnk_file ones seem interesing, i'm not sure if write is the correct perm or if it's readwrite

using sepolicy inject i've been adding to that list like so

sepolicy-inject -s appdomain -t newAttr33 -c lnk_file -p write -P sepolicy -o sepolicy-UNdead

but nothing yet, as i go further i will learn more, i think it's finding out what need to be made permissive, getting a read on audit and allow rules don't seem to work, i'm using debian's sepolicy dev tools, as well as Miko's set, and the originating source for sepolicy-inject as well.

finding the permissions/av denial connected to daemonsu being prevented from changing dalvik-cache ownership is what i think i'm looking for

but i'm not 100% on that, though when i

chcon u:object_r:su_exec:s0 su

, i do get a denial in terminal when i reboot and run su, so i'm still uncertain if su is the culprit.
[Galaxy Tab 4 General] jazzespresso:
what makes you think su is the culprit, it is because 5.1.1?
[Galaxy Tab 4 General] moonbutt74:
well, su runs the daemon right the daemon and supolicy need root privelege to run and load

for the portion of the logcat, changing ownership in dalvik-cache fails because damonsu hijacks the app_process/32

changing ownership is the function of chown which needs root priveleges, that particular function happens after the init process,

the init process work with root privelege for the beginning stages of the boot process then lock down and throws over to the system,

without the system's su functioning that process of changing dalvik cache ownership fails and sigabrt , the system hangs.

the reason i'm not 100% sure it's su is because when i chcon app_process/32 -> /xbin/daemonsu to u:object_r:zygote_exec

then the process goes through so... :confused:
[Galaxy Tab 4 General] jazzespresso:
re-moved
[Galaxy Tab 4 General] moonbutt74:
Jazz,

what i am actually going to say is;

pingpong root is a fail, i tried it a few days ago.

dumping general links into this thread is not help.

Linking DIRECTLY to kernel patches/mods etc., is better.

I am looking at the s6 source from the thread you linked to.

I don't think kernel version will make too much of a difference.

The interest, MY interest is in how to mod the default sepolicy to unbreak root.

I do NOT want permissive, i want enforcing with root functioning correctly.

I am getting a better hang of the sepolicy tools but have yet to find what needs changing adjusting

I did manage to disable [set permissive] the policy AND achieve root BUT with display,touch,input broken as before. [grumble]

In the furture please remove quoted text when you reply to post. Thanks.

m
[Galaxy Tab 4 General] jazzespresso:
sorry....removed the links and references on my previous post....
[Galaxy Tab 4 General] moonbutt74:
Jazz,

security: SELinux: Avoid enabling enforcing by conventional flag

as to this https://github.com/djvoleur/V_925R4_BOF7/commit/3e33f1fb5538fb2f0f055e9035fe8885a3471322

i'll give it a try and see what happens, but i still want sepolicy enforcing.

[MENTION=4758472]jazzespresso[/MENTION]

EDIT - okay i tried it out straight and no-go, but looking at the diff between our selinuxfs.c

and the one you linked to i see that we have a compile/build flag

#ifdef CONFIG_ALWAYS_ENFORCE

//If build is user build and enforce option is set, selinux is always enforcing

new_value = 1;

[blah blah blah]

selinux_enforcing = new_value;

there's some more but i think you get the idea of where i'm going with this.

the new_value change has been used before to success so it will work with our kernel source,

it's just a matter of getting it right. =]
[Galaxy Tab 4 General] jazzespresso:
that's I believe would work...I have been looking at their S6 UniBase / UniKernel source code in github way too long, my eyes hurt now....but again, you did excellent progress here...anyway, I was comparing their selinuxfs.c and our 5.1.1...but have very good feeling you are on right track...you are surely more experienced than I am....:good:
[Galaxy Tab 4 General] :
DERP

okay correction

[MENTION=4758472]jazzespresso[/MENTION]

that patch did work, i was using the wrong ramdisk [experi-mental] instead of stock unsecured, :silly:

root@kali:~# adb shell

shell@milletwifiue:/ $ uname -a

Linux localhost 3.4.0-Mina-my-love-33x--g01708b5-dirty #1 SMP PREEMPT Fri Jul 24 14:26:26 EDT 2015 armv7l GNU/Linux

shell@milletwifiue:/ $ getenforce

Permissive

shell@milletwifiue:/ $ su

root@milletwifiue:/ # whoami

whoami: unknown uid 0

1|root@milletwifiue:/ #
[Galaxy Tab 4 General] :
[SOLVED] for permissive anyway

see thread

http://xdaforums.com/tab-4/development/smnu-lp-touchwiz-5-1-1-kernel-rootable-t3164499/post62022802

still need to do this with selinux intact.
[Galaxy Tab 4 General] LenAsh:
Thread closed on OP's request
[HTC One SV] PoLiThS:
ok the story is...

A friend of mine owns (or owned right now) an ONE SV LTE the k2_ul variant

i dont know what she did but right now in my hands i have a phone that i cannot actually do things to help her out apart from gettin to bootloader...

she probably did clear storage or something like that and the phone has gone dead..

My problem is that i am not able to connect the phone to my PC as when it;s connected in my win 8.1 PC shows under the Android devices section as My HTC with a triangle... i cant seem to get adb to work due to that and well.... dunno what to do...

any ideas?

sometimes when i get into bootloader and select recovery i sort of get into somewhere and at this moment my pc sees the device as Portable device (F:\)

on normal boot up i end up into a black screen (and a dead phone apparently)

um... and i also cant see the phone at alla on a USB2 port but only on USB3 which i do believe is an issue as well...

please heeeeeelp

(ok i admit it she is way too hot:P)
[HTC One SV] old.splatterhand:
Have you tried fastboot commands in bootloader (fastboot mode)?

Try and install latest HTC Sync, this will bring all drivers needed (after that you can uninstall the software, but not the driver which will show up seperately from the software).

You should be able to see the serial number of the phone, after fastboot cmd:

fastboot devices
[HTC One SV] PoLiThS:
My main issue is that that the phone is recognised in the computer's device manager as problematic ....

Στάλθηκε από το GT-N7105 μου χρησιμοποιώντας Tapatalk
[HTC One SV] old.splatterhand:
Well, then you need to find out, if there are drivers which can solve this.

Maybe try another pc (Win 7).
[Android Q&A, Help & Troubleshooting] kushlikez:
Onhax.net
[Mi 3 General] vasishath:
This is a fix for the audio skipping when playback starts (audiophiles must have noticed it, while others dont bother :D) and audio howling/distortion on full volume.

The audio_hw module is taken from omni, so thanks [MENTION=5880909]rooque[/MENTION] for that. And the MTP (acdbs) are mi note's files taken from ivans repo .

Tested working on rr and aicp.

Flash using CWM/TWRP.

Please test and confirm.

Thank You.

Edit: Updated the zip file since it was causing puchier sound in earpiece.
[Mi 3 General] 24likan:
I guess it is to fix audio cracking when in full volume for speaker
[Mi 3 General] vasishath:
Yes and it also fixes audio skipping in the begining.
[Mi 3 General] 24likan:
Thanks bro
[Mi 3 General] ankushgautam:
after flashing the zip,the sound quality has improved drastically but i am facing a bug now..Whenever i call someone with loudspeaker on,the other person cant hear anything...infact i am able to hear my voice from the mic as if my voice is getting reflected back...please fix this issue...thanks
[Mi 3 General] z1d4n21:
Not works on los 14.1,it give no sounds,both speaker and headset
[G4 Q&A, Help & Troubleshooting] aniler:
Browsing in Chrome, %30 brightness and just mobile data turned on. Nothing else no GPS, bluetooth, NFC etc.

This is really frusturating and my phone is 2 days old.

H815TR. International Version TR for Turkey.

When battery is at %100 it takes 20~ minutes to lose %1. After it goes to %99 it starts to lose 1% every 3 or 4 minutes.
[G4 Q&A, Help & Troubleshooting] lordarik:
Look for apps thet you don't use, i had hangouts working even when i never opened it, maybe you got it too
[G4 Q&A, Help & Troubleshooting] Boston Powers:
If I ever had to look at a screen at 30% brightness I would junk it. Personal preference, I like to see a big bright crisp white screen. Even at 100%, my G3 is vastly brighter than my G4.

I have every possible bloatware app either removed or disabled. I also use my trusty "Advanced Task Killer Free" (by Rechild) which kills everything in sight except the apps you tell it to leave running.

With that said, the G4 battery drops like a 50 pound rock. The battery itself is not the problem, its the heating/throttling/dimming garbage that LG tricks you into thinking is a good thing whrn they're really only putting lipstick on a pig.

Free battery promo? Should be 5 free batteries.
[G4 Q&A, Help & Troubleshooting] xantanion:
Try a factory reset

And don't use a task killer.
[G4 Q&A, Help & Troubleshooting] Boston Powers:
No. That would be counter productive.
[G4 Q&A, Help & Troubleshooting] Pfeffernuss:
You lose 1% battery per 2-4 minutes.

Scenario 1: 1% per 2 minutes: 100 x 2 = 200 minutes = 3 hours and 20 minutes of SoT

Scenario 2: 1% per 3 minutes: 100 x 3 = 300 minutes = 5 hours of SoT

Scenario 4: 1% per 4 minutes: 100 x 4 = 400 minutes = almost 7 hours of SoT.

Scenario 1 is a bit below average. Scenario 2 is very good. Scenario 3 is utterly amazing.

;TLDR: Nothing wrong with the battery at all :good:
[G4 Q&A, Help & Troubleshooting] tdevaughn:
Task killers are worse than letting apps run. You are killing tasks that the system has to reopen them, causing more battery drain
[AT&T Samsung Galaxy S 4 Q&A, Help & Troubleshootin] Tiagra:
Hi there, i need stock rom for i377 ATT 4.4.2 or 4.4.4 with 4 files to flash by odin, cause i have problem, when i flash 4.4.2 nb1 by 1 files a have no worked wifi, no signal, and my storage in recovery are empty, or can i flash 4.2 rom ? i'm find 4files rom.:crying::crying::crying:
[AT&T Samsung Galaxy S 4 Q&A, Help & Troubleshootin] jd1639:
They don't exist. MDL from sammobile or nb1 from xda are the only ones that exist.
[AT&T Samsung Galaxy S 4 Q&A, Help & Troubleshootin] Tiagra:
Thnx, I'm installing att wifi modules and modem to nb 1 and ..... its works

Отправлено с моего SM-G7102 через Tapatalk
[XDA Assist] waazup:
Hello guys, I want to root my phone, i find a few topics, but i don.t know how to start and what files i need to install first. Sow if someone can help me with all the files and in witch order must be installed. My phone have the original software P70020f-EUR-XX and the android software is 4.1.2 .
[XDA Assist] Razvan:
Hi there,

Please see this tutorial:

Lg optimus l7 p700/p705 rooting and installing cwm[clock work mod] v20 jelly beans

For other questions please use this thread:

[USE IT][GUIDE]Fast Answer To Your Question[GUIDE] [TeamOptima]

Good luck