[Q] Possible to install modified app (from system/app) as normal app? - Android Q&A, Help & Troubleshooting

Hi,
I modified "SamsungCamera2" from my Note 3 and would like to install it now on my Note 3. My phone is not rooted and doing so would currently trip the knox counter (I don´t want that).
If I try to install the apk I get the message "application not installed".
Is it somehow possible to convert the apk so that I can install it as a "normal app"?
Best wishes,
Klaus

oclock said:
Hi,
I modified "SamsungCamera2" from my Note 3 and would like to install it now on my Note 3. My phone is not rooted and doing so would currently trip the knox counter (I don´t want that).
If I try to install the apk I get the message "application not installed".
Is it somehow possible to convert the apk so that I can install it as a "normal app"?
Best wishes,
Klaus
Click to expand...
Click to collapse
no root no party, however i think that its possible to root the phone over knox without count
to install system apk you can do in 3 ways
1.install normally by a file manager as normal apk but in this way you can only install ORIGINAL APK like official update NO MOD
2.copying the apk and maybe the odex in /system/app NEED ROOT
3.using clockworkmod NEED ROOT,or maybe using the stock samsung recovery need a flashable zip of your app
enjoy

AXD96 said:
no root no party, however i think that its possible to root the phone over knox without count
to install system apk you can do in 3 ways
1.install normally by a file manager as normal apk but in this way you can only install ORIGINAL APK like official update NO MOD
2.copying the apk and maybe the odex in /system/app NEED ROOT
3.using clockworkmod NEED ROOT,or maybe using the stock samsung recovery need a flashable zip of your app
enjoy
Click to expand...
Click to collapse
Thank you for your answer.
With my current firmware there is no known method to get root without knox=0x1.
If I develop my own app I can install it without problems. So, what exactly makes apps from system/app different?
How does Android know that I did not implement this App by myself?
Is there a way to further modify the app so that it looks like I implemented it by myself and install it then?

oclock said:
Thank you for your answer.
But if I develop my own app I can install it without problems.
So, what exactly makes apps from system/app different?
How does Android know that I did not implement this App by myself?
Is there a way to further modify the app so that it looks like I implemented it by myself and install it then?
Click to expand...
Click to collapse
Android expects applications installed by opening the APK to be signed.
It's quite easy to sign them with a generic certificate: but when apps are updated both the old (in /system) and the new version must be signed with the same one.
(Extreme problems lead to extreme solutions: if you need Samsung service, flash a bad bootloader so that's permanently bricked and doesn't even get to Odin...)

Ryccardo said:
Android expects applications installed by opening the APK to be signed.
It's quite easy to sign them with a generic certificate: but when apps are updated both the old (in /system) and the new version must be signed with the same one.
Click to expand...
Click to collapse
Thank you for the explanation and thank you for the hint
But how does Android know that I am trying to Update an already existing app? Is it just because of the class names of the MainActivity? Is it possible to refactor the app, so that it looks like a brand new app?

oclock said:
Thank you for the explanation and thank you for the hint
But how does Android know that I am trying to Update an already existing app? Is it just because of the class names of the MainActivity? Is it possible to refactor the app, so that it looks like a brand new app?
Click to expand...
Click to collapse
I believe, but have never tried, that it goes by the package ID

Ryccardo said:
I believe, but have never tried, that it goes by the package ID
Click to expand...
Click to collapse
It seems to be the correct way. However, something seems to be odd:
I the log I get the following:
12-29 23:47:03.981: E/AndroidRuntime(27444): java.lang.RuntimeException: Unable to resume activity {com.sec.android.app.cameraoc/com.sec.android.app.camera.Camera}: java.lang.SecurityException: Requires SET_ANIMATION_SCALE permission
However, this permission is set in the AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sec.android.app.cameraoc">
<uses-permission android:name="android.permission.CAMERA"/>
[...]
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"/>
[...]
Do you have any ideas why this permission isn´t recognized?

oclock said:
Thank you for your answer.
With my current firmware there is no known method to get root without knox=0x1.
If I develop my own app I can install it without problems. So, what exactly makes apps from system/app different?
How does Android know that I did not implement this App by myself?
Is there a way to further modify the app so that it looks like I implemented it by myself and install it then?
Click to expand...
Click to collapse
dont said me thanks, just click the thanks button on the left of message
no you can't
every APK has got a signature when you modify an apk or the mali code the signature became invalid so you cant install that apk anymore until you sign again the apk
if the signature is different you cant install system apk when you has already installed an app with the same packace address
else if the signature is the same (only the author of the app has got the original key of signature) you can install it
there is a critical bug in android until 4.2.2 version, the MASTERKEY BUG
google fix it in android 4.3
i got root with this bug using cydia impactor
with this bug/exploit you was able to modify system partition bypassing signature protection and then get root so you was able to have full access to your phone
---------- Post added at 01:16 PM ---------- Previous post was at 01:12 PM ----------
oclock said:
It seems to be the correct way. However, something seems to be odd:
I the log I get the following:
12-29 23:47:03.981: E/AndroidRuntime(27444): java.lang.RuntimeException: Unable to resume activity {com.sec.android.app.cameraoc/com.sec.android.app.camera.Camera}: java.lang.SecurityException: Requires SET_ANIMATION_SCALE permission
However, this permission is set in the AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sec.android.app.cameraoc">
<uses-permission android:name="android.permission.CAMERA"/>
[...]
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"/>
[...]
Click to expand...
Click to collapse
where did you find the log?

AXD96 said:
dont said me thanks, just click the thanks button on the left of message
no you can't
every APK has got a signature when you modify an apk or the mali code the signature became invalid so you cant install that apk anymore until you sign again the apk
if the signature is different you cant install system apk when you has already installed an app with the same packace address
else if the signature is the same (only the author of the app has got the original key of signature) you can install it
Click to expand...
Click to collapse
OK. This was already made clear some posts above. My new question was: Can I change the signature to install it as a "new" app.
I tried it out by myself. I modified the manifest file to change the android package name from "com.sec.android.app.camera" to "com.sec.android.app.cameraoc". The java package is unchanged.
With this modification i could install the app without any problems, but I get a permission exception, when I try to execute the App:
12-29 23:47:03.981: E/AndroidRuntime(27444): java.lang.RuntimeException: Unable to resume activity {com.sec.android.app.cameraoc/com.sec.android.app.camera.Camera}: java.lang.SecurityException: Requires SET_ANIMATION_SCALE permission
However, this permission is set in the AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sec.android.app.cameraoc">
<uses-permission android:name="android.permission.CAMERA"/>
[...]
<uses-permission android:name="android.permission.SET_ANIMATION_SCA LE"/>
[...]
So, i do not understand why I get this Exception. Do you have any ideas?
Klaus

I got the exact same issue when modding the S5's camera apk. The trick is to open your original apk with an archive manager and only replace the classes.dex and resources.arsc. I then copied the apk to /system/app/ and after a reboot I could successfully launch the camera.
More details about hacking system apk's can be found here: https://code.google.com/p/android-apktool/wiki/FAQ (My recompiled apk Force Closes (FCs). What gives?)

Related

[Q] Installable system app?

Hello XDA Members.
I would like to know how to convert a non-installable system apk into normal installable apk.
Example:
Let's say that test.apk is a system app.
If I take it to another device and try to install it, it will say app not installed, but if I put it in /system/app and chmod 0644 it, it simply works.
So what I want to know is:
How can I make test.apk install normally same as any other apk file
Regards,
~J2C
Just2Cause said:
llo XDA Members.
I would like to know how to convert a non-installable system apk into normal installable apk.
Example:
Let's say that test.apk is a system app.
If I take it to another device and try to install it, it will say app not installed, but if I put it in /system/app and chmod 0644 it, it simply works.
So what I want to know is:
How can I make test.apk install normally same as any other apk file
Regards,
~J2C
Click to expand...
Click to collapse
after deodex the app it will work
There are a few different ways. The main issue being that it has to be signed to be able to install it in/data/app. Easiest way on the phone is this:
https://play.google.com/store/apps/details?id=kellinwood.zipsigner2
On the computer, there are a few different signing tools. Not entirely sure if it matters what SDK platform you are on as it has been awhile since I have played with apps like that.
Vaibhav Chauhan said:
after deodex the app it will work
Click to expand...
Click to collapse
I already deodexed it but it is still not installable
es0tericcha0s said:
There are a few different ways. The main issue being that it has to be signed to be able to install it in/data/app. Easiest way on the phone is this:
https://play.google.com/store/apps/details?id=kellinwood.zipsigner2
On the computer, there are a few different signing tools. Not entirely sure if it matters what SDK platform you are on as it has been awhile since I have played with apps like that.
Click to expand...
Click to collapse
So if I re-sign it, it will work?
Just2Cause said:
I already deodexed it but it is still not installable
So if I re-sign it, it will work?
Click to expand...
Click to collapse
i have face this problem
when i deodexed the app and sign it it was working
@es0tericcha0s
I signed it right now and removed it from /system/app so I can try it, it installed!
But didn't work.
The apk is a close all button from Xperia Z2, I extracted it and deodexed it and I was able to get it to work when it's in /system/app but after I signed it, it installs but it doesn't appear in the recent apps list, as if it wasn't installed.
So I want it to be installable.
@Just2Cause
Ok now you can try this task killer on the attachment
it's based on the old task killer from here:
http://www.xperiablog.net/2014/01/1...ose-all-recent-apps-works-on-xperia-z-series/
and I've modded it to look like z2 task killer
I didn't tested it so tell me if worked with you
@naheel azawy
It didn't work, it installed but doesn't show up.
Just2Cause said:
@naheel azawy
It didn't work, it installed but doesn't show up.
Click to expand...
Click to collapse
what about the one which I based my mod on? does it works?
naheel azawy said:
what about the one which I based my mod on? does it works?
Click to expand...
Click to collapse
Nope.
Just2Cause said:
Nope.
Click to expand...
Click to collapse
!!!
does any task killer worked with you???
if yes plz give me that apk
If it installed, then it's SOMEWHERE... Try this: Use a root explorer to browse through /data/app and see if you see it there. Sometime if the app isn't working right or has the wrong permissions, it'll install but can't see it. Which tool did you use to sign?
es0tericcha0s said:
If it installed, then it's SOMEWHERE... Try this: Use a root explorer to browse through /data/app and see if you see it there. Sometime if the app isn't working right or has the wrong permissions, it'll install but can't see it. Which tool did you use to sign?
Click to expand...
Click to collapse
The app from play store that you suggested.
Edit:
It is in /data/app with rw-r--r-- permissions so it should work.
I attached the apk just in case if you want to check some things.
Edit 2:
The SystemUI.apk has this line in the AndroidManifest.xml:
Code:
<permission android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" android:protectionLevel="signatureOrSystem" />
and this one is in the TaskKiller.apk's AndroidManifest.xml:
Code:
<uses-permission android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" />
the TaskKiller is asking for permission from SystemUI instead of framework-res, idk why.
I'm thinking that this has to be a system app and tied to SystemUI to function properly. It doesn't seem to have it's own interface which is why no open option when installed and no icon showing.
es0tericcha0s said:
I'm thinking that this has to be a system app and tied to SystemUI to function properly. It doesn't seem to have it's own interface which is why no open option when installed and no icon showing.
Click to expand...
Click to collapse
Exactly, but the old apk from the Japanese Z1 is installable.
Does resigning affect that much that it stops working?

[Dev's] Potential Sony Exploit using Sony's app

I was playing around with my Z2 I have flashed Lollipop using Flashtool (All Official).
I found two interesting apk's that can be installed over the existing ones as an update (Which have a permission to write to system files I guess).
I tried to decompile them but no luck. What I had in my plan is to inject some code in the apk that will let it give permission to other application that we specify in the Manifest.xml (It is a long shot)
I will attach the apk's
/system/app/PremiumSmsUpdate
/system/priv-app/UpdateCenter
Both can be installed over and over with no failed installation.
Can anyone tell me if it is possible to inject one of the two apks with something to root?
Thanks
Safar
Just a simple yes or no from a developer would do it
No because SELinux will pick it up and kill it

install apk as clone for same system app

Hi all,
I want to install an apk as clone. Because it also exists as a system app. So when I tried to install, it couldn't. Is there a way to do this?
Thanks
daredevvll said:
Hi all,
I want to install an apk as clone. Because it also exists as a system app. So when I tried to install, it couldn't. Is there a way to do this?
Thanks
Click to expand...
Click to collapse
It would be easier to search why it wouldn't be installing with a log or an error code.
unclesado said:
It would be easier to search why it wouldn't be installing with a log or an error code.
Click to expand...
Click to collapse
It says 'App not installed. The package conflicts with an existing package by the same name'.
Also I tried this but it didn't work.
[HOW TO][GUIDE][MOD] Change Package Names of APKs
daredevvll said:
It says 'App not installed. The package conflicts with an existing package by the same name'.
Also I tried this but it didn't work.
[HOW TO][GUIDE][MOD] Change Package Names of APKs
Click to expand...
Click to collapse
Then, if you have access to source code, you can change the references to package name in the source code.
Or you can try some 3rd party applications like parallel space.

Set multiple backgrounds in the lock screen (Tested in One UI)

There's a Samsung feature that only works in some devices, and it is the ability to select several pictures to set them as the background of the lock screen, so it changes every time the screen is turned on. The only way to do this officially with A7 (2018) is through Samsung Themes, choosing a "multi-pack" background. There's no other possible way (you cannot select a couple of images from Gallery and set them as background, for example).
But there is a "hidden" app that is called My Interests, which lets you to choose multiple backgrounds for the lock screen. The problem with this is that if you try to launch it through an activity launcher it says that the app needs the storage permission to work, but you can't enable it because the request of that permission has not been declared in the app code. So I've edited it to add that request, and it works properly.
If you want to do it yourself, or just want to know what I have done:
To make this APK, I've edited the original APK with APK Editor Pro, and I've added in the AndroidManifest.xml the following line between the other requests for permissions:
Code:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Then I've built the app, and the generated APK file has been cloned with APK Cloner, in order to avoid conflicts with the original app.
To install it:
Install the attached APK
Install and open QuickShortcutMaker
In the search box, write updatos, it should appear one result which icon is a picture of a mountain
Open it and select the first element of the list, and then select "Try"
Accept the permission
Now you are able to choose the images you want with the "+" button, and then set them as the background of the lock screen
You can also add a widget to your home screen to add the activity as an icon, so it is quicker to change the backgrounds.
Just make a permission file and put it in system/etc/permissions
LuanTeles said:
Just make a permission file and put it in system/etc/permissions
Click to expand...
Click to collapse
But in that case you would need root access.
I'm getting a "Clones are device locked" error when I do the "Try it" option.
I installed app cloner but I can't seem to do anything with it. Any ideas?
Edit: I made a clone of com.samsung.android.keyguardwallpaperupdatos.apk but when I try to set permissions, there is none available for storage. Agh.
Satsumomo said:
I'm getting a "Clones are device locked" error when I do the "Try it" option.
I installed app cloner but I can't seem to do anything with it. Any ideas?
Edit: I made a clone of com.samsung.android.keyguardwallpaperupdatos.apk but when I try to set permissions, there is none available for storage. Agh.
Click to expand...
Click to collapse
So it looks like if I clone an app it can only be installed in the same device...
When I have time I will upload the edited APK without cloning and change the steps, because you will need to clone it.
Thanks for the feedback
So I did your steps, I downloaded the original APK from APKMirror, edited the XML and then cloned it.
I was able to launch the shortcut, and it let me select multiple backgrounds but it only applies one. I think Samsung might have blocked this... I'm currently using a Galaxy A50. Maybe I should try an older version?
Satsumomo said:
So I did your steps, I downloaded the original APK from APKMirror, edited the XML and then cloned it.
I was able to launch the shortcut, and it let me select multiple backgrounds but it only applies one. I think Samsung might have blocked this... I'm currently using a Galaxy A50. Maybe I should try an older version?
Click to expand...
Click to collapse
It changes, but it takes some time. In other devices (where this feature is official) it changes every time you see the lockscreen, but with this method the change is not that frequent.
Satsumomo said:
So I did your steps, I downloaded the original APK from APKMirror, edited the XML and then cloned it.
I was able to launch the shortcut, and it let me select multiple backgrounds but it only applies one. I think Samsung might have blocked this... I'm currently using a Galaxy A50. Maybe I should try an older version?
Click to expand...
Click to collapse
could you share the APK file to try? Thank you
danimanz98 said:
It changes, but it takes some time. In other devices (where this feature is official) it changes every time you see the lockscreen, but with this method the change is not that frequent.
Click to expand...
Click to collapse
This feature was in my previous Huawei mate 8
Than you it worl
youwi said:
Than you it worl
Click to expand...
Click to collapse
How did you make it work?
after doing all the installtion steps do this;
in quickshortcut maker app search ''updator'' instead of ''updatos''
there will be 2 search results open the first one and tap try now it should allow you to do this.
the trick is to open the one with updator mentioned in it. thats the official one preinstalled in the phone.
myshya said:
How did you make it work?
Click to expand...
Click to collapse
try it
Snowpirate07 said:
after doing all the installtion steps do this;
in quickshortcut maker app search ''updator'' instead of ''updatos''
there will be 2 search results open the first one and tap try now it should allow you to do this.
the trick is to open the one with updator mentioned in it. thats the official one preinstalled in the phone.
Click to expand...
Click to collapse
I know. But the thing is that the one that is preinstalled doesn't have the needed permissions registered, so they can't be enabled. That's why the APK file has to be edited, to manually add those permissions.

Google music app work around

So i liked the google music app because it worked with my sony smartwatch3 but i got a new phone and it had a newer version of the app that didn't work with it. Ive been trying to change the package name of the older apk so i can install two of the same app on my phone. Problem is I have no previous experience and and im having a lot of trouble doing it. Can someone help me by either guiding me or doing it for me, id really appreciate that. Here is the app i want to modify. (PS I know i can unistall the google app if i root my device but that seems like a lot of trouble and it voids the warranty of my device).
You can't install an app with same package name ( here: com.google.android.music ) twice. An app's package name is hardcoded in its APK's AndroidManifest.xml file.
jwoegerbauer said:
You can't install an app with same package name ( here: com.google.android.music ) twice. An app's package name is hardcoded in its APK's AndroidManifest.xml file.
Click to expand...
Click to collapse
I know that but is there any way to modify the apk?
Unpack the APK - it's merely a .ZIP-file
Make the changes you want
Repack to APK
Sign the APK

Categories

Resources