Hi guys,
Sorry for asking this question here, but I don't have privileges for writing on the Developer threads.
I am looking for a way to rename the original Viber package name so that I can install two viber applications on one device.
I've decompiled the application and changed the "package name" in the AndroidManifest.xml file, also the "cur_package" and "original_package" in the yml file to the new package name, but it gives me the following error on Recompiling:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
sdk-version, 9, --target-sdk-version, 15, -F, .....\Temp\APKTOOL130542784550865622.tmp, -0, arsc, -I, ...\apktool\framew
ork\1.apk, -S, viber.apk\res, -M
, ...\viber.apk\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:353)
at brut.androlib.Androlib.buildResources(Androlib.java:281)
at brut.androlib.Androlib.build(Androlib.java:209)
at brut.androlib.Androlib.build(Androlib.java:177)
at brut.apktool.Main.cmdBuild(Main.java:237)
at brut.apktool.Main.main(Main.java:79)
I know that this is not the right thread to post this, but I am hoping that the admins, will move it where it belongs.
Not sure what your talking about but if you have the project source file to rename is actually easy
PHP:
go and edit the manifest.
remove every old package name in the manifest.
put instead of the old package name, the new package name in every location inside the manifest. You might have classes(Activities that is) that need direct package name references.
save the manifest.
Then Right click the package name inside the project.
Select "Refactor".
Select "Rename".
Type the new package name.
select "update references".
press OK and your done and watch out also what should be done to replace the new name.
DON'T forget to update also the layout xml files with the new package name. you might have a custom View. look for them.
I found that online just with a few clicks. Let me know if that helps.
astroSkills said:
Not sure what your talking about but if you have the project source file to rename is actually easy
PHP:
go and edit the manifest.
remove every old package name in the manifest.
put instead of the old package name, the new package name in every location inside the manifest. You might have classes(Activities that is) that need direct package name references.
save the manifest.
Then Right click the package name inside the project.
Select "Refactor".
Select "Rename".
Type the new package name.
select "update references".
press OK and your done and watch out also what should be done to replace the new name.
DON'T forget to update also the layout xml files with the new package name. you might have a custom View. look for them.
I found that online just with a few clicks. Let me know if that helps.
Click to expand...
Click to collapse
I don't have the real source code of Viber, what I did is I decompiled the application with "android-apktool". I think that you are talking about if I have the project opened in some IDE and I have control over the source code.
Hindski said:
I don't have the real source code of Viber, what I did is I decompiled the application with "android-apktool". I think that you are talking about if I have the project opened in some IDE and I have control over the source code.
Click to expand...
Click to collapse
You need to change all package name references in the smali folder as well. This link will walk you through it.
http://forum.xda-developers.com/showthread.php?t=2760965
[HOW TO][GUIDE][MOD] Change Package Names of APKs
Sent from a Shaftamle Galaxy S4
"Thanks Button" is always appreciated!
149ThemedGoogleKeyboards!!!!!!
If you root your phone, you need to know this!!
MyColorScreen
Shaftamle said:
You need to change all package name references in the smali folder as well. This link will walk you through it.
http://forum.xda-developers.com/showthread.php?t=2760965
[HOW TO][GUIDE][MOD] Change Package Names of APKs
Sent from a Shaftamle Galaxy S4
"Thanks Button" is always appreciated!
149ThemedGoogleKeyboards!!!!!!
If you root your phone, you need to know this!!
MyColorScreen
Click to expand...
Click to collapse
Thank you for your proposal, I've tried it and when I recompile Viber, sign the apk and install it, the application is crashing all the time. It is not stable at all. Do you have any other articles, I can look into?
Hindski said:
Thank you for your proposal, I've tried it and when I recompile Viber, sign the apk and install it, the application is crashing all the time. It is not stable at all. Do you have any other articles, I can look into?
Click to expand...
Click to collapse
Hello, friend.
You found a way how to recompile the application ??
I mean it Viber.
I want something to do with this app but it does not work.
After installing the app just does not start or starts but falls
succeeded ?
have any of you guys figured out on how to do this ?
i want to use 2 viber accounts on my phone w/o root.
A lot of things that you have to do to rename it.
1. App decompile into a new project.
2. Change app package using defactor.
3. Change it in Manifest.xml
4. Change it in Gradle file.
5. I believe that Viber using lib.so, it will be quite difficult to change function name in .so library. Google how to do it because it's quite complicate and you will need some special tools and you will be able to read some bytecode.
Brgs,
Related
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
Click to expand...
Click to collapse
What did you use to decompile it? APK Manager from this thread?
http://forum.xda-developers.com/showthread.php?t=695701
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Click to expand...
Click to collapse
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
mazdarider23 said:
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
Click to expand...
Click to collapse
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
MongooseHelix said:
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
Click to expand...
Click to collapse
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
mazdarider23 said:
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
Click to expand...
Click to collapse
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
MongooseHelix said:
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
Click to expand...
Click to collapse
Thanks, I didn't know this! I'm glad there's people like you and mazdarider23 on this forum that know **** like this!!!
I was wondering if anyone knew how to change the name of the service provider from "Virgin Mobile" to whatever i want. (Like my name for instance.) I have already tried changing the build.prop file and it didn't work. The app "Carrier Name" doesn't work. I tried extracting the framework.apk and going deeper to the eri.xml and changing the provider name to something else but "Virgin Mobile" wasn't even there. Also in cdma workshop changing the banner doesn't do anything and the banner isn't even "Virgin Mobile" which it should be. I have tried other forums with no success and i'm hoping a dev can help. Yes i am rooted.
x2 would also like to know how to change that name to something else..
Self-bump for hope
QPST didn't work.
Ya i forgot to mention I also tried QPST with no luck.
under CDMA carriers I believe if you edit the framework-res.apk/values/strings.xml you can change something like zz_nationalRoaming_Carrier=Virgin Mobile
i know it sounds weird, roaming, but check it out....
I've been trying to accomplish this on GSM phones but they pull the variable from the sim card.... if you can simply change the txt value in framework-res.apk/layout/keyguard_screen_lock.xml then maybe that would work?
You need to change it from something like android:id="@id/carrier" whatever it says;
to android:text="custom" or whatever that is... (Open up eclipse and check out a basic text fields layout.xml so that you can use that as a guide if you need to...)
I'll check it out soon; it's something I intended to do for a guy.. I just don't personally own the triumph this worked great on Samsung Moment... but it was android 2.1 ....
I was so excited when I saw your post! But then I became bummed again as I saw that I don't have a "values" folder on my triumph's framework-res.apk. The three folders that I have as I open the .apk are "assets", "META-INF",and "res." I have attached a picture to show you what I mean. Thanks for the effort. Keep me updated.
Don't extract it... use apktool,
it needs decompiled... (if you use root explorer or something you can't see the correct text either)
-- Please be ready to recover your rom before trying this you may have a bootloop if you forget to fix permissions etc... ---
Windows instructions
Place framework-res.apk in your c:\ in a new folder called frame (or wherever);
example will use c:\frame\
Put apktool and aapt in \frame; (I will try to find something to attatch sorry i'm on my lunch break @ work)
C:\frame\framework-res.apk
C:\frame\aapt.exe
C:\frame\apktool.bat
C:\frame\apktool.jar
Open command prompt as administrator (open start menu type cmd right click it hit run as administrator)
In this prompt type cd\frame (Or wherever you put those files)
Run this;
apktool d framework-res.apk
this will extract all files to C:\frame\framework-res\
Check then for your values folder, you should see tons... just worry about Values. the rest are locales... (languages,, if it fails maybe try values-EN?)
Once you're done you can run apktool b framework-res and it will build the contents of the c:\frame\framework-res\ folder into C:\framework-res\dist\framework-res.apk
now you have to put this file in your /system/
you can get it there via the phone if you have issues I will try to help for now here are adb instructions:
adb remount
adb push c:\frame\framework-res\dist\framework-res.apk /system/framework-res.apk
adb shell chmod 644 /system/framework-res.apk
This may or may not work again I'm on my lunch sorry...
report back i'll stay active here;
I don't own a triumph but my buddy does so I can't test much
I am learning this stuff too but I have spent some time with it so i'd be more than happy to share; likewise i'd love anyones help learning aswell.... that's actually what brought my attention to this triumph; =D
edit; btw i'll see if i can't test this realtime tonight I had heard that 7zip is fine for framework-res but I think that was for the GFX themeing not for the xml editing? I dont' know, I apologize if you got stuck on my guide however I will work with you to make it through it
Thanks man. I appreciate your write up. I will try it today after school and get back to you on the results.
You may have an issue in adb, i noticed that I was unable to get the device to pick up in ADB ... I rebooted the phone and noticed that the device manager picks up the Android ADB Interface for a minute, but as it finalizes boot it drops it...
Perhaps I just have driver issues but it seems like a start up script is runing the command stop adbd
Anyway if that's the case we need to remove the stop adbd command from the startup scripts;
Anyways; if you can't get ADB USB drivers maybe w/ your root access you can set it up on wifi? connect to wifi and run
(From phone terminal)
setprop service.adb.tcp.port 5555
stop adbd
start adbd
(From PC)
adb tcpip 5555
adb connect IPADDRESS:5555 -Note that i mean the ip address to the phone on wifi)
then if it's successful you should be able to adb remount adb push framework etc...
remember to chmod or you WILL bootloop.
I was able to successfully follow your guide up until when i (try to) compile with the apktool b framework-res command I get this:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
The new and improved .apk never gets made because of this error. I google searched and tried to find a solution for at least an hour with no luck. I would just like to thank you in advance for all of your help.
I was able to successfully follow your guide up until when i (try to) compile with the apktool b framework-res command I get this:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
The new and improved .apk never gets made because of this error. I google searched and tried to find a solution for at least an hour with no luck. I would just like to thank you in advance for all of your help.
EDIT: It posted twice for some reason!? Weird
i'll take a look i believe it it's entirely because of what version of APKtool I submitted (perhaps a bad one, sry...) I'll get the framework from the system dump in the other thread and try it out
Ok thanks a lot man.
Wow I joined in 2008 and got my first thanks; yet I went to reply and thanked you for saying thanks!
Hahahah, no but for real it's cool cause thanks for trying; fyi i was able to compile okay...
I found apktool.yml or whatever, but it's supposed to be in the decompiled folder... when you recompiled are you doing it like this?
apktool d framework-res.apk
apktool b framework-res (NO .apk it is the FOLDER you are targetting)
I will test my rebuilt framework, this is what I changed;
<string name="roamingText1">Virgin Mobile</string>
to
<string name="roamingText1">Ryan S.</string> (The guys name.)
You guys what you have to edit is the line "zz-roaming text 1" just editing this one will change them all. (Lockscreen and notification bar) as for the tool to decompile the framework-Res.apk I recommend apk manager. It is the easiest to use. (Note to newbs) with apk manager you don't have to remember command prompt codes
Sent from my MOTWX435KT using XDA App
I found no zz in it, was the problem... several zzz but no zz roaming
anyway i should forwarn that my framework-res.apk broke the guys phone i restored it and we're good but looking at the files they're 700kb differences so perhaps apk manager alone will recompile more successfully?
I appreciate the reocmmendation most of the tools I have found so far havn't allowed access to the xml files just the pngs, or not all of the contents of the apk (not decoding them)
I'll try apk manager and report back soon.
I've never tried apk tool, I may try this once someone does it successfully so I'll be watching. I don't know how to backup my phone so I'm wary of tinkering.
using apk tool
From my own experience I find that apk manager can sometimes be tricky to use. And sometimes when you recompile the first time it doesn't work properly. If it doesn't work the first time try it again. Ill try doing this when I can get to my computer. BTW make sure you import the old files and delete whichever one you changed. That's where it can get tricky
the current issue i'm having is that the apk file made is like 6-800kb smaller and all i didwas remove ascii,
i'll test it when i can though sorry
I have installed a ROM.When i go to settings,it shows at the end 'Custom build by Rocky" This really sucks.
I tried to change it by build.prop but i couldn't do that as 'Custom build by Rocky';this text was even not present there. I searched a lot for this.Now can anyone tell me how to change this..I am sure this specific text is not present in build.prop,is there any other file to do that?
I've had my fair share in rom development a year or so ago. And I can tell you that the name there is just a way of marking the rom.
But if you're really bothered by it, I can tell you how to find the string, edit it or completely remove it. To find the string - Custom build by Rocky, you can't just change it in build.prop. For this, you must go into /system/app and then copy Settings.apk file to your desktop. From there, go ahead and decompile Settings.apk with a preferred decompiler. When decompiled, head into the project, and navigate to the following folder - res/values and open strings.xml with a text editor. Search for Custom build by Rocky in the text file, once found. You may change it to whatever you wish. But if you want to remove it, you have to remember the ID of the string. For example, in - example text - which is the string, the text to the right. The ID is text the ID is found in the left hand side, it's after the word name . So remember that, now go back to the res directory and scroll down to the xml folder, open it and look for about.xml. In there search for text which is the ID. And remove the line completely. Also make sure to remove the header line too. As this will stop the layout from having an invisible section.
Now compile the Settings.apk and push it to your device - adb push desktop/path/to/Settings.apk /system/app or just copy Settings.apk to device and do it from there.
I do not encourage you to do this. And you can do this at your own risk. I will not take any responsibility if you mess up your phone.
Sent from my Nexus 5 using Tapatalk
krishneelg3 said:
I've had my fair share in rom development a year or so ago. And I can tell you that the name there is just a way of marking the rom.
But if you're really bothered by it, I can tell you how to find the string, edit it or completely remove it. To find the string - Custom build by Rocky, you can't just change it in build.prop. For this, you must go into /system/app and then copy Settings.apk file to your desktop. From there, go ahead and decompile Settings.apk with a preferred decompiler. When decompiled, head into the project, and navigate to the following folder - res/values and open strings.xml with a text editor. Search for Custom build by Rocky in the text file, once found. You may change it to whatever you wish. But if you want to remove it, you have to remember the ID of the string. For example, in - example text - which is the string, the text to the right. The ID is text the ID is found in the left hand side, it's after the word name . So remember that, now go back to the res directory and scroll down to the xml folder, open it and look for about.xml. In there search for text which is the ID. And remove the line completely. Also make sure to remove the header line too. As this will stop the layout from having an invisible section.
Now compile the Settings.apk and push it to your device - adb push desktop/path/to/Settings.apk /system/app or just copy Settings.apk to device and do it from there.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Can u suggest me some apk decompilers?
Try "APKTool" just search for it on the search part of this site, it should come up.
Sent from my Nexus 5 using Tapatalk
krishneelg3 said:
Try "APKTool" just search for it on the search part of this site, it should come up.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Hey bro! This method worked..
But,now i am in a more big problem.
By the way that test was 'Custom build by Jatin' not Rocky.
The new settings.apk which i recompiled after editing that line successfully was not directly installing on my phone.
So,i replaced that new apk with the settings.apk in my ROM which contains 'Custom Build by Jatin' text..
Now,when i installed that ROM again,everthing went right ..but when i cheked the apps ...My settings option was no more..It was not installed during the ROM installation..I manually also tried to install that but nothing was achieved!
Now ,how to fix this? Hey bro,I am also attaching that settings.apk ,see if you can edit that line yourself and then again attach here for my use.Its line 176 in res/strings ,,just replace that line from 'Custom Build' only...
Please help me bro.
This happens sometimes. Its best to push the .apk to your device rather than moving it
Sent from my Nexus 5 using Tapatalk
krishneelg3 said:
This happens sometimes. Its best to push the .apk to your device rather than moving it
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Now,the settings.apk is crashing..Bro,there is somewhere error between the app..I have attached that apk in this forum before..Can't u yourself rename that line and attach here..Please bro
Problem fixed
The unsigned settings.apk worked now....
Sorry, I just saw your post. Oh and I'm glad it works now. With system apps, you mustn't sign them. They don't work properly.
Sent from my Nexus 5 using Tapatalk
How can I edit the package name of Facebook.apk ?
I want to install two facebook apps in same device
pasindupeiris said:
How can I edit the package name of Facebook.apk ?
I want to install two facebook apps in same device
Click to expand...
Click to collapse
Before you begin you need to install these two apks
1. Apk Editor.apk
2. Apk editor patch.apk
Installing same application twice
Now after downloading these two apks.
First, install Apk Editor and then the Apk editor patch.
Now open Apk editor and browse to the apk of the application you want to install.
Long press the apk and select "Clone".
Now change the name of the apk and press ok.
Now open your regular file manager and install the apk as you would normally
Source: http://swapmyapp.com/how-to/run-multiple-instances-of-one-app/
Google has the best answers!
Don't forget about the Thanks button :silly:
Hey thanks for the reply. I've already tried this method.
But Cant open the clone app. Every time it force closes. :crying:
pasindupeiris said:
Hey thanks for the reply. I've already tried this method.
But Cant open the clone app. Every time it force closes. :crying:
Click to expand...
Click to collapse
Will do some research for you when I'll have some time.
Btw I don't even use one facebook app!!
Newyork! said:
Will do some research for you when I'll have some time.
Btw I don't even use one facebook app!!
Click to expand...
Click to collapse
Thanks mate!
pasindupeiris said:
Thanks mate!
Click to expand...
Click to collapse
Its not that simple.
If you decompile the app and change it's package name it won't work. The reason behind this is because when an app is coded, you specify the package name in the manifest and then use the same or a special package name for storing code.
Libraries are attached to the code via package names and so are custom imports. If none of this is correctly modified then you have no chance at getting this app to work at all.
There is however one approach many don't use around here but it's very complicated and takes time, but in the end you can completely reverse engineer any app and have the source code for a closed source application.
You will need the following things.
Time
Eclipse IDE (I only know how to set it up on that)
Dex2Jar
APKMultiTool (Or any decompiling tool)
Notepad++
JavaViewer (or any programming that let's you view Java code).
And the libraries used in the applications (this is because the libraries sometimes break for some reason? Atleast for me.)
Reply back to me if you want to know how to reverse engineer the app.
TheArc said:
Its not that simple.
If you decompile the app and change it's package name it won't work. The reason behind this is because when an app is coded, you specify the package name in the manifest and then use the same or a special package name for storing code.
Libraries are attached to the code via package names and so are custom imports. If none of this is correctly modified then you have no chance at getting this app to work at all.
There is however one approach many don't use around here but it's very complicated and takes time, but in the end you can completely reverse engineer any app and have the source code for a closed source application.
You will need the following things.
Time
Eclipse IDE (I only know how to set it up on that)
Dex2Jar
APKMultiTool (Or any decompiling tool)
Notepad++
JavaViewer (or any programming that let's you view Java code).
And the libraries used in the applications (this is because the libraries sometimes break for some reason? Atleast for me.)
Reply back to me if you want to know how to reverse engineer the app.
Click to expand...
Click to collapse
So I see that these instructions all over the internet is just bs....
Never tried to have two apps running on one device. Maybe I'll try next time I'm bored
Newyork! said:
So I see that these instructions all over the internet is just bs....
Never tried to have two apps running on one device. Maybe I'll try next time I'm bored
Click to expand...
Click to collapse
Well sometimes it may work it is a step in the instructions. There is just more to the whole process though. Nothing would be that easy if it were people would be having duplicates of apps everywhere [emoji14].
The only duplicate app I've seen so far is Instagram.
TheArc said:
Its not that simple.
If you decompile the app and change it's package name it won't work. The reason behind this is because when an app is coded, you specify the package name in the manifest and then use the same or a special package name for storing code.
Libraries are attached to the code via package names and so are custom imports. If none of this is correctly modified then you have no chance at getting this app to work at all.
There is however one approach many don't use around here but it's very complicated and takes time, but in the end you can completely reverse engineer any app and have the source code for a closed source application.
You will need the following things.
Time
Eclipse IDE (I only know how to set it up on that)
Dex2Jar
APKMultiTool (Or any decompiling tool)
Notepad++
JavaViewer (or any programming that let's you view Java code).
And the libraries used in the applications (this is because the libraries sometimes break for some reason? Atleast for me.)
Reply back to me if you want to know how to reverse engineer the app.
Click to expand...
Click to collapse
I tried to reverse engineer the facebook app. But I couldn't. I'll text you. BDW in UC Browser 9.2.3. I edited package name in AndroidManifest.xml and I could install two UC Broswers
pasindupeiris said:
I tried to reverse engineer the facebook app. But I couldn't. I'll text you. BDW in UC Browser 9.2.3. I edited package name in AndroidManifest.xml and I could install two UC Broswers
Click to expand...
Click to collapse
:good:
BTW if you want two Facebook accounts on your phone you can download a third party app like Seesmic
Newyork! said:
:good:
BTW if you want two Facebook accounts on your phone you can download a third party app like Seesmic
Click to expand...
Click to collapse
But you know any app is not comfortable as Official one :3
Hi, I'm trying to modify /system/framework/framework-res.apk (on the stock Samsung Oreo ROM), more exactly config_locationProviderPackageNames in res/values/arrays.xml so that I can add org.microg.nlp as location provider. I've used the latest apktool (2.3.4) to unpack and repack the apk. I'm replacing it from TWRP and I checked that it has the same owner and rights. And after rebooting the device never finishes booting up (stuck at Samsung logo and blue led).
If I boot back to recovery and put back the original framework-res.apk the system boots fine.
What else do I need to do to make it accept the modified framework?
hey
Are you ONLY modifying the apk?
I would say there is a lot of things to check. It could be that the apk is being rejected by your handling of it. Compare both versions by 7zip lz4 without extracting. Try and use the best tools during the process.
Also more than likely you're conflicting with a service or permission that a perfect apk can't fix.
Have you tried a search in your ROM to see if any files might be associated with the result you want?
Stuff like...
com.android.location.provider.jar
com.android.location.provider.odex
com.android.location.provider.xml
Try doing all the work from your phone without any windows apps. FX explorer and symlink the apk.
Now that everything I said was probably wrong, someone else can tell you how. I'd try fx and symlink, though. It may just align the planets for you
I'm only modifying one XML resource file, but I don't know what else apktool is doing to the apk.
I'm replacing the original framework-res.apk from TWRP, by cat-ing the modified apk over the original, and I've double checked that the ownership and permissions are unchanged.
I guess I can try using another unpack/repack tool and see if it turns out any better, but I've been told that apktool is as good as it gets.
Perhaps it's because the ROM expects the apk to be signed with a certain key? I don't suppose that the key used by Samsung is available somewhere inside the ROM is it?
wirespot said:
I'm only modifying one XML resource file, but I don't know what else apktool is doing to the apk.
I'm replacing the original framework-res.apk from TWRP, by cat-ing the modified apk over the original, and I've double checked that the ownership and permissions are unchanged.
I guess I can try using another unpack/repack tool and see if it turns out any better, but I've been told that apktool is as good as it gets.
Perhaps it's because the ROM expects the apk to be signed with a certain key? I don't suppose that the key used by Samsung is available somewhere inside the ROM is it?
Click to expand...
Click to collapse
@wirespot - Did you ever solve the problem you described in this thread?
Not really. My last attempt was to use Runtime Resource Overlays (RROs) to override certain framework values in order to allow org.microg.nlp to run side by side with Google's service.
I will provide them below but it ultimately didn't work. The RRO apk was installed correctly, I could access the NLP settings in the system settings but the main app still could not detect or connect to the service and none of the apps that use location would work.
If anybody else wants to build or use the RRO apk I'm attaching the relevant files as well as the apk. Please note that the built apk only has "org.microg.nlp" as service in arrays.xml (but I provide an arrays.xml with all three services).
apktool.yml is provided as txt file because it wouldn't let me upload it otherwise, remove the .txt. It's used if you build the package with apktool. Remember that you'll also have to generate your own certificate and sign the package in order to install it.
Also some links that may help:
https://forum.xda-developers.com/t/guide-how-to-make-gsis-overlay-file-for-your-phone.3878974/
https://github.com/ReinhardStrauch/framework-res-overlay-sample
https://android.stackexchange.com/questions/110927/how-to-mount-system-rewritable-or-read-only-rw-ro
https://source.android.com/devices/architecture/rros#configuring-overlays
https://source.android.com/devices/automotive/hmi/car_ui/appendix
https://source.android.com/devices/automotive/hmi/car_ui/rro#step_6_dump_the_idmap
https://dzone.com/articles/customizing-android-devices-using-the-runtime-reso
https://dzone.com/articles/android-solution-install-parse-1
https://stackoverflow.com/questions...s-not-recognized-internal-or-external-command
https://github.com/lineageos4microg/android_prebuilts_prebuiltapks/issues/22
wirespot said:
I guess I can try using another unpack/repack tool and see if it turns out any better, but I've been told that apktool is as good as it gets.
Click to expand...
Click to collapse
For decompiling and building Android Oreo, I prefer version 2.3.1 of APKTool to other versions of APKTools.
wirespot said:
I'm only modifying one XML resource file, but I don't know what else apktool is doing to the apk.
...
Perhaps it's because the ROM expects the apk to be signed with a certain key? I don't suppose that the key used by Samsung is available somewhere inside the ROM is it?
Click to expand...
Click to collapse
wirespot said:
Hi, I'm trying to modify /system/framework/framework-res.apk (on the stock Samsung Oreo ROM), more exactly config_locationProviderPackageNames in res/values/arrays.xml so that I can add org.microg.nlp as location provider.
What else do I need to do to make it accept the modified framework?
Click to expand...
Click to collapse
I have not tried modifying framework-res.apk of a Samsung Android Oreo nor have I particularly tried the location services mod you are attempting (though I might get around to trying it someday) and do not know if it is valid to to accomplish what you want with it, but believe that the process should be similar to modding the file on LG Android Oreo. I shall try to guide you to how to prepare a framework-res.apk that is proper.
To answer your question about expecting a certain key. The answer to that is that that is usually the case. The signing scheme checks on system apps; however is usually not as thorough as non-system apps. framework-res.apk is also special in that it is not a running app and is instead used as a cache of system resources and system meta information. In the past, before Android Oreo, a rebuilt framework-res.apk may be made to work simply by including original signature files (META-INF) and corresponding AndroidManfest.xml file from the original framework-res.apk into the rebuilt fraemwork-res.apk file. The system would evaluate these files, and pass a check for valid platform signature. With Android Oreo, it appears that there is an additional check that was not present in the past; my best guess is that the system is checking for the V2 signing scheme signing block within the V2 Signing Scheme APK file structure. The check does not, however, thoroughly validate the signing block information.
Your mod seems rather simple and, given your previous posts, would only involve a modification to framework-res.apk "resources.arsc" member file (which contains the compiled "res/values/arrays.xml" file). If the rebuilt "resources.arsc" can be used to update ("Update" is an actual ZIP archive operation) the original framework-res.apk's member file, the updated framework-res.apk should work (and remained zip-aligned if originally zip-aligned), so long as the packed file size of the updated member file is less than or equal to the packed size of the original member file, plus up to 4 bytes depending on proximity to the next member file data if original framework-res.apk is zip-aligned as expected. If the packed modified member file(s) are larger, the original APK file structure would likely not be preserved, and a different method might have to be used. Also note that 7-Zip is not reasonable software to use for this, despite it being included with many tools on XDA to modify APK files; the software has had a history of rearranging unnecessarily zip file table entries when a change is made to an archive. Use a different tool that does not do this, such as WinRAR (I have tested version 5.61).
For normal apps, one may not copy over "resources.arsc" or resources from two different app builds and have things work correctly when the app runs; one would also need to make corresponding changes in the *.dex APK member files. framework-res.apk, not being an app the runs, has no corresponding *.dex files, and one need not worry about corrupting the relationship between the *.dex files and the resource files because none exists to corrupt.