[Q] edit permissions of a .apk - Android Q&A, Help & Troubleshooting

how to edit permissions of a .apk just like you get to select/ deselect permissions in Blackberry (RIM) OS before installing the APK.

Related

[SOLVED] Edit .ogg in camera.apk

I have a rooted Galaxy M Style phone with stock Gingerbread 2.3.4 firmware. I am trying to customize my stock camera app, but am not sure what I'm doing wrong. I plan to replace the autofocus_ok.ogg with a different tune from my phone. I checked the properties of the autofocus_ok.ogg and saw it's a mono, 44100hz, and 96 bitrate file. The tune that I have has the same properties. So this is what I have done so far:
I backed up camera.apk to /system/app/camera.apk.bak and the camera.odex to /system/app/camera.odex.bak. I left a copy of camera.odex in /system/data. I copied the camera.apk to my memory card and placed the file on my computer. I renamed the file to a .rar. I then deleted the autofocus_ok.ogg and placed the tune that I wanted in that directory. Then I renamed it to autofocus_ok.ogg. I renamed the file back to .apk and transferred the file back to the memory card, then over to /system/app. The camera app will not install/not showing up on my phone. I am transferring the files through root explorer on my phone.
I worked with the original apk file again with apktool. I was able to decompile and replaced and renamed the files that I needed again. I compiled the file and transferred the file to /system/app again, but the apk will still not install. I checked the complied apk file and noticed that the file didn't have the META-INF folder, so I copied that over to. Tried to install it again by copying the file to /system/app, but it still won't show up on my phone. Is there anyway for me to change the autofocus_ok.ogg without a custom rom?
Thanks.
ImAhNoBoDy said:
I have a rooted Galaxy M Style phone with stock Gingerbread 2.3.4 firmware. I am trying to customize my stock camera app, but am not sure what I'm doing wrong. I plan to replace the autofocus_ok.ogg with a different tune from my phone. I checked the properties of the autofocus_ok.ogg and saw it's a mono, 44100hz, and 96 bitrate file. The tune that I have has the same properties. So this is what I have done so far:
I backed up camera.apk to /system/app/camera.apk.bak and the camera.odex to /system/app/camera.odex.bak. I left a copy of camera.odex in /system/data. I copied the camera.apk to my memory card and placed the file on my computer. I renamed the file to a .rar. I then deleted the autofocus_ok.ogg and placed the tune that I wanted in that directory. Then I renamed it to autofocus_ok.ogg. I renamed the file back to .apk and transferred the file back to the memory card, then over to /system/app. The camera app will not install/not showing up on my phone. I am transferring the files through root explorer on my phone.
I worked with the original apk file again with apktool. I was able to decompile and replaced and renamed the files that I needed again. I compiled the file and transferred the file to /system/app again, but the apk will still not install. I checked the complied apk file and noticed that the file didn't have the META-INF folder, so I copied that over to. Tried to install it again by copying the file to /system/app, but it still won't show up on my phone. Is there anyway for me to change the autofocus_ok.ogg without a custom rom?
Thanks.
Click to expand...
Click to collapse
erm... is the permissions set correctly rw-r--r-- ?
MoonBlade said:
erm... is the permissions set correctly rw-r--r-- ?
Click to expand...
Click to collapse
Yup, permissions were set correctly like rw-r--r--. Owner is root:root. Those are the permission that I set on the apk file like they were on the original file. I just realized that the compiled apk's from apktools doesn't show up on my phone. The apk that I created by opening up winrar and just replacing the .ogg files do show up, but I get the error "The application Camera (process com.sec.android.app.camera) has stopped unexpectedly. Please try again."
Anything else I can try or a thread to refer to?
ImAhNoBoDy said:
Yup, permissions were set correctly like rw-r--r--. Owner is root:root. Those are the permission that I set on the apk file like they were on the original file. I just realized that the compiled apk's from apktools doesn't show up on my phone. The apk that I created by opening up winrar and just replacing the .ogg files do show up, but I get the error "The application Camera (process com.sec.android.app.camera) has stopped unexpectedly. Please try again."
Anything else I can try or a thread to refer to?
Click to expand...
Click to collapse
why dont you try to push the modified apk manually using root explorer or so instead of pushing via adb ..
after decompiling apk and modifying it, compile it into some folder and then copy it into you sd card then use root explorer and manually push(copy) the apk into system/app .. give proper permissions and then reboot your phone..
Here are some guides to use apktool
http://forum.xda-developers.com/showthread.php?t=1891686
http://forum.xda-developers.com/showthread.php?t=1989533
MoonBlade said:
why dont you try to push the modified apk manually using root explorer or so instead of pushing via adb ..
after decompiling apk and modifying it, compile it into some folder and then copy it into you sd card then use root explorer and manually push(copy) the apk into system/app .. give proper permissions and then reboot your phone..
Here are some guides to use apktool
http://forum.xda-developers.com/showthread.php?t=1891686
http://forum.xda-developers.com/showthread.php?t=1989533
Click to expand...
Click to collapse
I have been pushing the modified apk through root explorer all this time. I don't even have adb install, haha. The procedure you explained have been the way I have been doing it the whole time, lol. I read the threads you posted and the procedure is the same as I've been doing it, except for the second thread. I can't grab the apktool from 4shared because I don't have an account. I am using the latest apktool 1.5.2. Also, I didn't understand what PulseDroid was talking when he said "We are NOT done just yet, we cannot use the new apk's... we have to take what we did and add it back to the original apk file to keep proper signature use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk". So I'm suppose to replace the resources.arcs and the .ogg files that I created from the new apk to the old apk? I didn't mess with any xml file.
Anyways, is there anything else I can try?
EDIT: ........I feel so embarrassed. I checked out this thread http://forum.xda-developers.com/showthread.php?t=2378177 and saw this post "Drag your replacement files into WinRAR and (here's the important part) in the Compression Method drop-down choose "Store"." All this time I have been compressing the file as "Normal" in Winrar, instead of "Store".
All in all, I did not need apktool at all. I used the original apk and opened it up in Winrar. I deleted the files that I wanted to replaced and put in the files that I wanted. Each time I put something in the file in Winrar I get a prompt for compression and instead of "Normal" compression just use "Store". It was that simple.
This helped me, thank you!

[Q] Permissions for new app in /system/app

If I look at all the existing .apk files in /system/app, I see that they all have 644 as their permissions. Is that what's usually expected?
If I add a new .apk to /system/app, I have read that I need to set its permissions to 755. Is that true?
I also read that I need to change all the existing .apk files from 644 to 755. Is that true as well? If so, I am curious as to why since I am not looking at changing any of those.
WaltA said:
If I look at all the existing .apk files in /system/app, I see that they all have 644 as their permissions. Is that what's usually expected?
If I add a new .apk to /system/app, I have read that I need to set its permissions to 755. Is that true?
I also read that I need to change all the existing .apk files from 644 to 755. Is that true as well? If so, I am curious as to why since I am not looking at changing any of those.
Click to expand...
Click to collapse
--the same question!
--need expert explain
--thanks in advance!!!
Wow, no one can help? :crying:
WaltA said:
If I look at all the existing .apk files in /system/app, I see that they all have 644 as their permissions. Is that what's usually expected?
If I add a new .apk to /system/app, I have read that I need to set its permissions to 755. Is that true?
I also read that I need to change all the existing .apk files from 644 to 755. Is that true as well? If so, I am curious as to why since I am not looking at changing any of those.
Click to expand...
Click to collapse
all apk in system must use 644 for the permission, if not, the apk won't be installed, but not all apk/app working if you put in system folder, for example, if you put opera mini in system folder, the application will not even you have set it the permission at 644,
and the best to add/install new app in system use manually way
1. choose apk that you want
2. put in the system/app
3. set permissions to 644
4. reboot
if success, the app will appear on menu,
Don't forget to hit THANKS button

[Q] Choose Specific App Install Path

Hi
I'm trying to move my security software apk file to the /system/app folder to make it hard reset proof. I renamed the original apk which is in the /data/app folder. I then copied the file to the /system/app folder and renamed it to the original filename. I then installed the apk, chose replace. What happend was that the app created another apk in the /data/app folder this time with a "2" behind it.
I'm guessing the apk has code in it that tells it to install there. So what I was wondering, can I set a specific default install directory, install the apk and then return it to default?
or
Where do the file go after the apk is ran, the program isn't ran by the apk because when you try and run it, it just asks to install it, not open the program. Could I move the actual app files and edit the install path in where the os stores the list of installed apps and there paths (where ever that is?)?.

How to change folder of a system app...

I made some stupid things to my smartphone and now I am close of solving them...
My question is...Does anybody know how I can change the name of a folder from /system/priv-app/ so my device still considers the app as installed?
The app that I'm talking about is Google Services Framework and my device says it's installed but he says the app takes 8,00KB instead of 3,28MB(the size of the apk as told by Apps2SD)
Also Apps2SD seems to identify where is the app located after the folder name change but my system doesn't...
I change the file's name from "com.google.android.gsf-1" to "GoogleServicesFramework" so that the .odex file can work...
So anybody knows how should I set the permissions and owners of the folders and files so that the system finds where the .apk and .odex are located?

Help needed in file permission fix

i have shv-e210l and i have cm13 installed on it. i decompress system.new.dat and make addition in system/app and again compress it and it flashed successfully. but when system starts up my application (ChatSecure) which i added to rom was popup ("stoped working"). do i need to add some permissions or what? because my general concept is that when i download application from google play store it asks certain permissions. i need help if i need permissions or not and if i need permissions how can i add them.

Categories

Resources