[Q] Root permission granted - App still does not have root? - Android Q&A, Help & Troubleshooting

Hey people,
I've got a problem here...
Whenever one of the apps of my custom rom needs root permissions, I get the usual SuperSU-prompt. But even if I accept the request, the app won't gain root permissions.
This problem occurs with several different apps.
Is it possible that SuperSU does not have root access?
My rom has prober su symlinks in its updater-script..
At least I think so.
delete("/system/bin/su");
symlink("/system/xbin/su", "/system/bin/su");
set_perm(0, 0, 06755, "/system/xbin/su");
So, got any ideas how to solve my problem?
Thx in advance.

Is it working for some apps, and not for others? Or, are all apps not getting root access?
You could try updating the su binary, or fixing permission from recovery, for starters.

AW: [Q] Root permission granted - App still does not have root?
It is working for no app.
And the su binary should be alright, as I've taken it from a working rom of the same version.
Fixing permissions?
Hmm, I could try that.. Wait one.
Sent from my HTC Desire using xda app-developers app

Seems there is no option to fix permissions in CWM Recovery v2.5.0.7.. :/
Anyway, I'd prefer to fix the issue in my rom.
So, what permissions does the su binary need in an updater script?

Ahh, I've found the solution! :laugh:
My updater script looks like this:
[...]
delete("/system/bin/su");
symlink("/system/xbin/su", "/system/bin/su");
set_perm(0, 0, 06755, "/system/xbin/su
[...]
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
[...]
I think the issue was caused because set_perm_recursive overwrites the permissions for system/xbin/su..
So my superuser binary didn't have the right permissions.
Moving these lines at the end of my updater script solved the problem.
delete("/system/bin/su");
symlink("/system/xbin/su", "/system/bin/su");
set_perm(0, 0, 06755, "/system/xbin/su
By the way, fixing permissions in recovery would probably also fix this issue..

Glad you got it working.

Related

enabling init.d support

In dsixda's kitchen, i enabled init.d scripts support but i can't find any folder in /system/etc. I tried creating a folder name "init.d" and flash my rom, but the scripts would not run. Anyone can help me
terratrix said:
In dsixda's kitchen, i enabled init.d scripts support but i can't find any folder in /system/etc. I tried creating a folder name "init.d" and flash my rom, but the scripts would not run. Anyone can help me
Click to expand...
Click to collapse
Well, maybe you could try use some other startup-init scripts. I am NOT android developer but LINUX developer, so i suppose that android-modified kernel still uses Linux-style boot sequence.
Maybe you could try to create this file
/etc/rc.local
its text file, in this file you can store your bash script, everything us executed with superuser permissions so avoid using su.
Another deep-system file is /etc/inittab, but you should avoid modifying this file unless you know, what you are doing.
terratrix said:
In dsixda's kitchen, i enabled init.d scripts support but i can't find any folder in /system/etc. I tried creating a folder name "init.d" and flash my rom, but the scripts would not run. Anyone can help me
Click to expand...
Click to collapse
Do you have a (working) busybox installed?
How are the scripts called (the filenames)?
dr.notor said:
Do you have a (working) busybox installed?
How are the scripts called (the filenames)?
Click to expand...
Click to collapse
1.Yes
2. example: 00banner
Ok, i added some permissions into updater-script for the scripts copied from other GB roms and edit them.
Code:
set_perm(0, 0, 0777, "/system/etc/init.d/00banner");
set_perm(0, 0, 0777, "/system/etc/init.d/01zipalign");
set_perm(0, 0, 0777, "/system/etc/init.d/02zipalign");
set_perm(0, 0, 0777, "/system/etc/init.d/03ramscript");
set_perm(0, 0, 0777, "/system/etc/init.d/04sdcard");
set_perm(0, 0, 0777, "/system/etc/init.d/05loopysmoothnesstweak");
set_perm(0, 0, 0777, "/system/etc/init.d/06screenstate");
set_perm(0, 0, 0777, "/system/etc/init.d/07sysctl");
set_perm(0, 0, 0777, "/system/etc/init.d/99complete");
and this too
set_perm_recursive(0, 2000, 0755, 0750, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
Well, if you are sure you have not screwed up when adding init.d support in the kitchen, move to the relevant thread. The guy is very responsive.
dr.notor said:
Well, if you are sure you have not screwed up when adding init.d support in the kitchen, move to the relevant thread. The guy is very responsive.
Click to expand...
Click to collapse
Ok thanks

Need help in setting right permissions using CWM

When I tried to create a CWM script for flashing certain mods on systemui.apk, email.apk and twwallpaperchooser.apk, after flashing permission of these apks are rw-rw-rw instead of rw-r--r--. I am not sure why this is happening and I have tried different scripts as well.
Code:
ui_print("");
ui_print("--------------");
ui_print(".XXXXXXXXXX.");
ui_print("--------------");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
delete("/system/app/com.google.android.email.apk");
package_extract_dir("system", "/system");
set_perm(0, 0, 0644, "/system/app/com.android.email.apk");
set_perm(0, 0, 0644, "/system/app/com.android.systemui.apk");
set_perm(0, 0, 0644, "/system/app/com.sec.android.app.twwallpaperchooser.apk");
show_progress(0.100000, 0);
ui_print(".Sucessfully fixed all bugs.");
ui_print("----------------------------");
unmount("/system");
Please help me to set right permissions
have you tried permission
have you tried cwm then its either in advanced or on the first page theres an option that says fix permissions, depending on how many apps on phone could take 2-50+ secondsm. im no expert but whenever i change permissions and get them wrong this always reverts them back to default for me. or you could try using solid explorer, or root explorer to manually set permission with no scripting required.
good luck otherwise hope i helped

Trying to make a flashable zip for TWRP

Hi all
I have been trying to make a flashable zip for my mod for jb 4.2.2.
I haven't really seen a detailed guide (exact steps) on how to achive this.... most of the threads are for CWM, the op of the thread attaches a sample.zip but its for CWM.
My problem is the update-binary. When I come to flash the file it give an error and quits the install.
My mod is to be written to the system folder.
Where do I get an update-binary file compatible with 4.2.2 if that is what I require.
I am willing to read/learn if there is a guide.
Thanks all
Sent from my GT-I9300 using xda app-developers app
Hey there mate,
try the following method:
http://teamuscellular.com/Forum/topic/3488-how-to-make-flashable-zip-files-for-cwm-or-twrp/
Thanks for the reply mate. Yeah have read this post but still need to find out about the update binary file.
Again thanks
Sent from my GT-I9300 using xda app-developers app
I'd recommend finding a flashable zip that already works for TWRP and replacing the contents of it with your mod.
That should work...
You could try this blank TWRP zip I use it for 4.1.2 so not sure if it will work with 4.2.2 as it stands.
If you rename it make sure you don't have any spaces in the naming format all words must be linked with a _ or - or something no gaps
Top work guys thanks alot for ya fast responses will try when I get in
Sent from my GT-I9300 using xda app-developers app
ag4751 said:
You could try this blank TWRP zip I use it for 4.1.2 so not sure if it will work with 4.2.2 as it stands.
If you rename it make sure you don't have any spaces in the naming format all words must be linked with a _ or - or something no gaps
Click to expand...
Click to collapse
i tried the attached file but as it starts its says
E: Error executing updater binary in zip
error flashing zip
this is on the internal memory.
this is the update script im using.... more that likely wrong...
ui_print("Lockscreen Clock Font");
show_progress(0.500000, 0);
ui_print("inspired by Delight CFW Font");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
set_perm_recursive 0 0 0755 0644 SYSTEM:app
unmount("/system");
ui_print("Reboot now!");
show_progress(1.000000, 0);
i took mikep99 advice and edited the script and put my info in
i busybox installed so am now a little stuck
Try with a ';' at the end of the set_perm line..
EDIT. remove the line completely and try.
EDIT2. That line should be:
set_perm_recursive(0, 0, 0755, 0644, "/system");
Sent from my GT-I9300 using xda app-developers app
mikep99 said:
Try with a ';' at the end of the set_perm line..
EDIT. remove the line completely and try.
EDIT2. That line should be:
set_perm_recursive(0, 0, 0755, 0644, "/system");
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
thanks for replying
i just tried the editions to the file and it did install this time but sent me in to boot loop... all restored in 127 seconds.... love TWRP lol just wish my mod would flash.
i am trying to flash the keyguardwidget.apk to the /system/app folder.
the set_perm line has had different values ive notice in other flash files, are mine correct for what im trying to do.
Its just file permissions. that wont cause a boot loop in itself
Sent from my GT-I9300 using Tapatalk 2
i tryed adding a couple of more lines but still boot looped.... after it flashes it says "fix permissions... looks like you are not rooted"
i just dont want to edit someone elses work.
Boooooooom!!!! done it :silly:
For all..... this line DID send me in to boot loop
set_perm_recursive(0, 0, 0755, 0644, "/system");
it should be
set_perm(0, 0, 0644, "X");
were X is the directory in the zip
thanks to all for your help
pug1 said:
Boooooooom!!!! done it :silly:
For all..... this line DID send me in to boot loop
set_perm_recursive(0, 0, 0755, 0644, "/system");
it should be
set_perm(0, 0, 0644, "X");
were X is the directory in the zip
thanks to all for your help
Click to expand...
Click to collapse
odd
The only thing I can think is that:
0, is /system, Next 0 is app, And the 644 is to the app itself.
Had to look at another flash file (gs4 keyboard)
Sent from my GT-I9300 using xda app-developers app

[Q] DSIXDA Kitchen ROM

Has anyone got one to boot on the Mega?
I have tried various ideas and have got the install working but it fails to boot after the reboot.
Is anyone further along than this?
Kangburra said:
Has anyone got one to boot on the Mega?
I have tried various ideas and have got the install working but it fails to boot after the reboot.
Is anyone further along than this?
Click to expand...
Click to collapse
Having similar issues, aroma is not parsing to update-script on 3 versions 2.00, 2.5 and 2.76. Standard install process not going great and cannot for the love of the big g work out why, yet i did a small test flash to system and all went fine. just gonna take time to plod on through lol
---------- Post added at 03:45 PM ---------- Previous post was at 03:22 PM ----------
scrub that by removing kernel its booted ok now
So you are able to flash a complete Rom with Aroma?
Sent from my GT-I9205 using Tapatalk 2
Kangburra said:
So you are able to flash a complete Rom with Aroma?
Sent from my GT-I9205 using Tapatalk 2
Click to expand...
Click to collapse
No
Aroma bums out at handing over to the update script. The updater script works fine on its own this was tested on 2.00 2.5 and 2.76 the first two worked fine on n7000 so I know its not my scripting. I have mentioned this to the peeps eho know.
The only thing struggling to flash is kernel but as we need stock anway for the mo thats not an issue. But that will be easy to sort just ran out of yime yesterday
Whats the issue you facing in aroma or normsl update script. Can you post your script here
Sent from my GT-I9205 using xda premium
thering1975 said:
No
Aroma bums out at handing over to the update script. The updater script works fine on its own this was tested on 2.00 2.5 and 2.76 the first two worked fine on n7000 so I know its not my scripting. I have mentioned this to the peeps eho know.
The only thing struggling to flash is kernel but as we need stock anway for the mo thats not an issue. But that will be easy to sort just ran out of yime yesterday
Whats the issue you facing in aroma or normsl update script. Can you post your script here
Sent from my GT-I9205 using xda premium
Click to expand...
Click to collapse
I have gone down the updater-script from the kitchen, I am having problems with permissions but I have got it booting now.
I am working on tweaks and bloat for now and trying them out.
What permissions you having probs with. Whats the issue
Sent from my GT-I9205 using xda premium
I have removed them.
I am down to this
Code:
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 1000, 0755, "/system/xbin/busybox");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(0, 0, 04755, "/system/xbin/busybox");
Now just need to try it out.
Odd what issues did that cause you
thering1975 said:
Odd what issues did that cause you
Click to expand...
Click to collapse
I got the ROM to boot with this
Code:
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 1000, 0755, "/system/xbin/busybox");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(0, 0, 04755, "/system/xbin/busybox");
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
which is from the S3 script.
I cam attech my installer script
If u want for future ref
Sent from my GT-I9205 using xda premium
thering1975 said:
I cam attech my installer script
If u want for future ref
Sent from my GT-I9205 using xda premium
Click to expand...
Click to collapse
I have got it now, thanks, I am working on the bloat now.

Need help with updater-script. About set_metadata.

Hey peeps, I'm attempting things here. I'm trying to modify an update.zip file that installs properly on my device. I'm mostly trying to get root access on this device.
So far in this little weekend project, I have already put the su binary in the system folder within updater.zip. So I have found that I need to edit a updater-script file.
I have found this line:
Code:
set_metadata("/system/xbin/su", "uid", 0, "gid", 0, "mode", 06755, "capabilities", 0x0, "selabel", "u:object_r:su_exec:s0");
This is here because this tablet already has root but is not in a place where supersu can find it. So, I already have the part where it copies the su binary into /system/bin.
So how should I set the permissions with this command?

Categories

Resources