How to change and layout xml file from apk and repack it - Java for Android App Development

I have a following APK of JIO tv app Reddit Thread
APK Mirror Link
Problem:
I have installed it on my Mi Box android Tv. It works flawless. But on every restart, it ask for username and password.
The person who shared this apk has already filled the login details, which is in res/layout/fragment_details.xml.
I want to change the login details there, so that I don't have to type username and password every time, I start Mi Box.
I tried using apktools and Android studio to decompile and repack it with modified xml.
But, modified APK give error, Not installed.
Thanks in advance.

Hi, did u find a solution?

Did you try signing the apk?

Related

HOW TO translated a APK to your language

Hi here i am going to do a tutorial to made know people how to tranlate a APK to their language or other languages.
Required:
A program for extracting and compiling APKS (In the tutorial we are going to used apktool)
WINDOWS/LINUX/MAC
The APK
An take a rest
HOW TO:
First donwload apktool:
https://code.google.com/p/android-apktool/
Windows:
Download apktool-install-windows-* file
Download apktool-* file
Unpack both to your Windows directory
Linux:
Download apktool-install-linux-* file
Download apktool-* file
Unpack both to /usr/local/bin directory (you must have root permissions)
Mac OS X:
Download apktool-install-macos-* file
Download apktool-* file
Unpack both to /usr/local/bin directory (you must have root permissions)
When you have the executable know you can run the comand in all the directories of your computer.
HOW TO extract apk
Go to the rute were it is the apk with cd.
If it is a system apk you need to do this:
Pick up framework-res.apk of your rom.
and type this:
apktool if framework-res.apk
If it is a normal apk do not do this step
Then tipe this:
apktool d name of your apk
It will started to descompile it.
When it done it will create a FOLDER call with the name of the APK.
Go to it.
Enter in this rute: res/values/ and there most of the time is string.xml doccument to translate.
copy it create a FOLDER in res/ name it values- the initials of your country for example. Spain is es
Then in that folder paste the string.xml, open it with a XML editor or any other.
Then translate to your language.
When you finish translating it.
Type this comand:
apktool b name of folder
Wait it will start to compile.
When it finnish go to NAME of the folder/ dist/ and there will be the application you translate.
If it need sign used APK-MANAGER to sign it.
All done take a rest.
how to translate? I did try with google translate but it does not translate properly ...?
mrjoy said:
how to translate? I did try with google translate but it does not translate properly ...?
Click to expand...
Click to collapse
Maybe you can find something useful in section Marketing, Distribution, and Analytics > Localization
http://forum.xda-developers.com/marketing-analytics/localization
Some interesting tools are listed in discussions, and there are also some volunteers there...
Hello,
I've exactly done what you described, tried with APKTool and Multitool. I carefully watched out not to touch anything else but the XML I'm wanting to adjust. After I did my changes I recompiled, signed and installed, which was no problem. Unfortunately the app is not running properly anymore, online functions don't work etc.
So I tried not to change anything, just decompiling and immediately after I recompiled the apk and signed it. Same thing, I can easily install but it doesn't run properly. Is it possible the app only runs with the developers private key? Can anyone help me on this please?
Thanks
i tried apktool to translate an apk file but after decompile there is no any res folder to find strings.xml file?
i did copy the strings.xml file from res/values folder & translated & then pasted to new folder res/values-en according to the country & then i recompiled the apk file but it still shows in same old language?
---------- Post added at 05:51 PM ---------- Previous post was at 05:49 PM ----------
Benko111 said:
Hello,
I've exactly done what you described, tried with APKTool and Multitool. I carefully watched out not to touch anything else but the XML I'm wanting to adjust. After I did my changes I recompiled, signed and installed, which was no problem. Unfortunately the app is not running properly anymore, online functions don't work etc.
So I tried not to change anything, just decompiling and immediately after I recompiled the apk and signed it. Same thing, I can easily install but it doesn't run properly. Is it possible the app only runs with the developers private key? Can anyone help me on this please?
Thanks
Click to expand...
Click to collapse
Do u successful to translate app?
No, there's no way if developer signed with his private key. Though I did stagger over one thread at stackoverflow.com where someone posted a method recompiling and signing with a public key. Didn't follow it in the end, sometimes it pisses me off how devs from normal paid apps make it impossible to just change the strings.xml but then coming to our translation thread to plea for free translation. Mostly when I did translate an app which I like I send my strings.xml to the dev anyway. It would be much more if I wasn't blocked from running the app after signing. That all said, of course I understand the importance of piracy protection, just don't know if this is the right way.
Sent from i9300 running SlimKat OS
Benko111 said:
No, there's no way if developer signed with his private key. Though I did stagger over one thread at stackoverflow.com where someone posted a method recompiling and signing with a public key. Didn't follow it in the end, sometimes it pisses me off how devs from normal paid apps make it impossible to just change the strings.xml but then coming to our translation thread to plea for free translation. Mostly when I did translate an app which I like I send my strings.xml to the dev anyway. It would be much more if I wasn't blocked from running the app after signing. That all said, of course I understand the importance of piracy protection, just don't know if this is the right way.
Sent from i9300 running SlimKat OS
Click to expand...
Click to collapse
where is that thread to sign apk with public key on stackoverflow.com website?
How can make apk auto select English language only
But apk have multi language
And apk select languag by (default system language)
Or I want change number only
١٢٣٤٥٦٧٨٩٠ to 1234567890
In all language
1234567890 is default number only
Thx...very useful

[Guide] How to enable multi-user?

hello friends, I have a nice question for you!
I state that this is google translation so it will be the best.
anyway back to us ....
you own a nice tablet?
and maybe you are engaged or married and you have photos of your woman on the device in question, and maybe you do not want others to see,
or simply your friends are never their own business, and then maybe you want to make private your tablet, maybe with a secondary account, but do not know how to do it because the tablet does not support multi-user ...
well do not give up, this guide will do for you ...
I do not take any responsibility for what might happen to your device
these are the requirements:
-root
-this app : https://www.dropbox.com/s/wmc4vg8n1lyv1o1/4_2_multiple_user_enabler_root_1.2.apk
-a file manager with root permissions as root browser or other
-user app share (which allows you to decide the content to display to other accounts) is on play store or in this link https://www.dropbox.com/s/nh3vaqetj9fogzs/MultiUserAppShare.apk
well, now first download the app before "4.2 multi user enabler"
copy it to the sd of your dear and beloved tablet.
after this app copied to the folder system of your tablet, change permissions (I usually do I enable them all)
after that install the app . from the app enable the multi-user, reboot your tablet and you're done!
multi user share app you need to decide what to use the other account
Now you might ask: why not just install the app?
Try it! it will seem to work but when you restart the account will vanish,
Intead with this guide it will be ever
if you have been useful on press thanks
By friends!
Simix93 said:
hello friends, I have a nice question for you!
I state that this is google translation so it will be the best.
anyway back to us ....
you own a nice tablet?
and maybe you are engaged or married and you have photos of your woman on the device in question, and maybe you do not want others to see,
or simply your friends are never their own business, and then maybe you want to make private your tablet, maybe with a secondary account, but do not know how to do it because the tablet does not support multi-user ...
well do not give up, this guide will do for you ...
I do not take any responsibility for what might happen to your device
these are the requirements:
-root
-this app : https://www.dropbox.com/s/wmc4vg8n1lyv1o1/4_2_multiple_user_enabler_root_1.2.apk
-a file manager with root permissions as root browser or other
-user app share (which allows you to decide the content to display to other accounts) is on play store or in this link https://www.dropbox.com/s/nh3vaqetj9fogzs/MultiUserAppShare.apk
well, now first download the app before "4.2 multi user enabler"
copy it to the sd of your dear and beloved tablet.
after this app copied to the folder system of your tablet, change permissions (I usually do I enable them all)
after that install the app . from the app enable the multi-user, reboot your tablet and you're done!
multi user share app you need to decide what to use the other account
Now you might ask: why not just install the app?
Try it! it will seem to work but when you restart the account will vanish,
Intead with this guide it will be ever
if you have been useful on press thanks
By friends!
Click to expand...
Click to collapse
The easiest way to enable multiuser support especially for our Galaxy Tab 3.0 is to edit the framework-res.apk with apktool and change the max user in there. The best thing with this way, your account will not vanish when you restart the device.. :laugh::laugh:
faruqmunshif said:
The easiest way to enable multiuser support especially for our Galaxy Tab 3.0 is to edit the framework-res.apk with apktool and change the max user in there. The best thing with this way, your account will not vanish when you restart the device.. :laugh::laugh:
Click to expand...
Click to collapse
ah I did not know .. you tell me how to do? maybe put to me now if there is. Anyway .. this is useful for anyone who is not practical to make changes to the framework
@Simix93
Here is the alternative, modifying framework-res.apk.
What I've done on my Galaxy Tab 3 10.1 (GT-P5210) :
- Modifying framework-res\res\values\integers.xml (locate the entry, and put X, where X <= 8 instead of 1, X = the number of allowed max users) :
Code:
<integer name="config_multiuserMaximumUsers">8</integer>
- Modifying framework-res\res\layout-port\keyguard_host_view.xml (to show user selector on lockscreen) :
>> Adding this after the second </FrameLayout>
Code:
<FrameLayout androidprv:paddingTop="@dimen/status_bar_height" androidprv:layout_width="fill_parent" androidprv:layout_height="wrap_content">
<include androidprv:layout_gravity="top|center" androidprv:layout_width="fill_parent" androidprv:layout_height="fill_parent" layout="@layout/keyguard_multi_user_selector" />
</FrameLayout>
- Adding framework-res\res\layout-port\keyguard_multi_user_selector.xml file
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.internal.policy.impl.keyguard.KeyguardMultiUserSelectorView android:layout_gravity="bottom" android:orientation="horizontal" android:id="@id/keyguard_user_selector" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" android:contentDescription="@string/keyguard_accessibility_user_selector" android:layout_childType="userSwitcher"
xmlns:androidprv="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.android.internal.policy.impl.keyguard.KeyguardLinearLayout android:layout_gravity="bottom|center" android:orientation="horizontal" android:id="@id/keyguard_users_grid" android:layout_width="wrap_content" android:layout_height="@dimen/keyguard_avatar_size" android:layout_marginBottom="400.0dip" />
</com.android.internal.policy.impl.keyguard.KeyguardMultiUserSelectorView>
- After that, copied from the original framework-res.apk AndroidManifest.xml file and META-INF directory to your newly compiled one (using a zip file utility) so I can bypass the sign process (like you should do with auto sign tool - signapk.jar)
And voilà, after putting back my modified framework-res.apk to the device and rebooting, i'm able to add new users in settings
Regards
i have tried to modify my framework-res.apk, but it's not succesful.
I installed framework-res with this command:
java -jar apktool.jar if Framework-Res.apk
This installed a file named 1.apk in my users-directory.
After that i extract the framework-res.apk with this command:
java -jar apktool.jar d Framework-Res.apk
Everythings seems to be fine, a directory with the name Framework-Res is created.
I modified the 3 files "integers.xml", "keyguard_host_view.xml" and "keyguard_multi_user_selector.xml" as described.
Now i pack it together with this command:
java -jar apktool.jar b Framework-Res
Get 2 errors with PNG-Files "File is case-insensitive" and correct the filenames (uppercase .PNG to lowercase .png).
After that i found in the folder "dist" the framework-res.apk.
The filesize is less about 12mb then before, it's now round about 36mb.
I put this file in my /system/framework folder and reboot. But the system is still displaying the Samsung-Logo.
Replaceing the file with the original file and everything is ok.
What do i wrong?
with best regards,
Detlef
ok, now it works.
i have forgot to add the sign-process to the new .apk file.
now my tab 3 8.0 have the multi-user function, thank you!
Spatz said:
i have tried to modify my framework-res.apk, but it's not succesful.
I installed framework-res with this command:
java -jar apktool.jar if Framework-Res.apk
This installed a file named 1.apk in my users-directory.
After that i extract the framework-res.apk with this command:
java -jar apktool.jar d Framework-Res.apk
Everythings seems to be fine, a directory with the name Framework-Res is created.
I modified the 3 files "integers.xml", "keyguard_host_view.xml" and "keyguard_multi_user_selector.xml" as described.
Now i pack it together with this command:
java -jar apktool.jar b Framework-Res
Get 2 errors with PNG-Files "File is case-insensitive" and correct the filenames (uppercase .PNG to lowercase .png).
After that i found in the folder "dist" the framework-res.apk.
The filesize is less about 12mb then before, it's now round about 36mb.
I put this file in my /system/framework folder and reboot. But the system is still displaying the Samsung-Logo.
Replaceing the file with the original file and everything is ok.
What do i wrong?
with best regards,
Detlef
Click to expand...
Click to collapse
Before recompile your framework-res.apk, you should find the png files with uppercase (.PNG) from your decompiled framework-res.apk/res/ and rename them to lowercase (.png).
when finished, flash it using CWM or other recovery.
Does anyone have working framework-res.apk for T310 ? I've updated mine, but I do not see anything new. When I flash zip fro T311 from a different thread, I have this options, but some labels in the system are missing and messed up.
slobodan.bogdanovic said:
Does anyone have working framework-res.apk for T310 ? I've updated mine, but I do not see anything new. When I flash zip fro T311 from a different thread, I have this options, but some labels in the system are missing and messed up.
Click to expand...
Click to collapse
Just follow the guide in this thread to make your framework-res.apk working with multiuser. or if you have no time, just give me your framework-res.apk and i will try to decompile it for you,
Spatz said:
ok, now it works.
i have forgot to add the sign-process to the new .apk file.
now my tab 3 8.0 have the multi-user function, thank you!
Click to expand...
Click to collapse
You can also copy from your original framework-res.apk AndroidManifest.xml file and META-INF directory to your newly compiled one so you can bypass the sign process
I have an issue when having multiple users enabled.
When I am logged in as the owner (first user) I am able to connect device via usb and transfer files.
When I am logged in as the second user, and when I try to connect device vis usb, it is not recognized. MTP Driver installation fails in this case.
Anyone has the same issue?
Simix93 said:
hello friends, I have a nice question for you!
I state that this is google translation so it will be the best.
anyway back to us ....
you own a nice tablet?
and maybe you are engaged or married and you have photos of your woman on the device in question, and maybe you do not want others to see,
or simply your friends are never their own business, and then maybe you want to make private your tablet, maybe with a secondary account, but do not know how to do it because the tablet does not support multi-user ...
well do not give up, this guide will do for you ...
I do not take any responsibility for what might happen to your device
these are the requirements:
-root
-this app : https://www.dropbox.com/s/wmc4vg8n1lyv1o1/4_2_multiple_user_enabler_root_1.2.apk
-a file manager with root permissions as root browser or other
-user app share (which allows you to decide the content to display to other accounts) is on play store or in this link https://www.dropbox.com/s/nh3vaqetj9fogzs/MultiUserAppShare.apk
well, now first download the app before "4.2 multi user enabler"
copy it to the sd of your dear and beloved tablet.
after this app copied to the folder system of your tablet, change permissions (I usually do I enable them all)
after that install the app . from the app enable the multi-user, reboot your tablet and you're done!
multi user share app you need to decide what to use the other account
Now you might ask: why not just install the app?
Try it! it will seem to work but when you restart the account will vanish,
Intead with this guide it will be ever
if you have been useful on press thanks
By friends!
Click to expand...
Click to collapse
Working on Tab3 7" ?
Leehtaeyeon said:
Working on Tab3 7" ?
Click to expand...
Click to collapse
I do not know, I have not tried it, so you head to the end you just have to move an app
Leehtaeyeon said:
Working on Tab3 7" ?[/QUOT
Multiuser only supported by Android 4.2.2 or higher. As i know, the android version in Tab 3 7" is 4.1.2. If you want to use multiuser, wait until tab 3 7" recieved update for 4.2.2..
Click to expand...
Click to collapse
faruqmunshif said:
Leehtaeyeon said:
Working on Tab3 7" ?
Click to expand...
Click to collapse
Multiuser only supported by Android 4.2.2 or higher. As i know, the android version in Tab 3 7" is 4.1.2. If you want to use multiuser, wait until tab 3 7" recieved update for 4.2.2..
Click to expand...
Click to collapse
Don' work =/
I do not believe he will get more 4.2.2.
I think like other devices, it will jump to 4.4
Spatz said:
ok, now it works.
i have forgot to add the sign-process to the new .apk file.
now my tab 3 8.0 have the multi-user function, thank you!
Click to expand...
Click to collapse
Spatz-is there any chance you could post detailed instructions? Or can you post your framework res.apk file?
Sent from my SM-T310 using xda app-developers app
@chaz
I used your procedure to modify the framework-res.apk file and it doesn't work on my Galaxy Tab 3 10.1 (GT-P5210). It keeps boot-looping. I managed to put back the original framework-res.apk and it's working, so I didn't killed it completely!
I do it this way:
1. Use apktool to decompile the apk file (apktool.jar).
2. Modify the xml files with Notepad++.
3. Use apktool to recompile the apk file.
4. Sign the file with autosign tool found on XDA (signapk.jar).
5. Put the framework-res.apk file back using ADB in recovery mode and set the right permissions on the file.
What tools have you used? Did you do it differently than me?
Thank you.
i am curious about this, but i'd like to know how multi user works. How do I "log" in to the tab and use my gmail, etc? And then how would my wife log in and user her email and etc? Are there profiles or something similar?
thanks
EDIT
never mind
http://www.dummies.com/how-to/content/how-to-add-another-user-to-your-android-tablet.html
Hi. I see this method does not work very well. I recommend the app SwitchMe. It's much easier and just requires root permission which everyone should have. I can't post links because I'm a newbie, so just search for it on the Play Store. :good:
alfreddallaire said:
@chaz
I used your procedure to modify the framework-res.apk file and it doesn't work on my Galaxy Tab 3 10.1 (GT-P5210). It keeps boot-looping. I managed to put back the original framework-res.apk and it's working, so I didn't killed it completely!
I do it this way:
1. Use apktool to decompile the apk file (apktool.jar).
2. Modify the xml files with Notepad++.
3. Use apktool to recompile the apk file.
4. Sign the file with autosign tool found on XDA (signapk.jar).
5. Put the framework-res.apk file back using ADB in recovery mode and set the right permissions on the file.
What tools have you used? Did you do it differently than me?
Thank you.
Click to expand...
Click to collapse
As I mentionned some posts before, I did not use the signapk.jar but instead copied signed informations from my original framework-res.apk to the new one.
See my post http://forum.xda-developers.com/showpost.php?p=48429541&postcount=10 there.
I updated my tuto post to include this in the process (http://forum.xda-developers.com/showpost.php?p=48315919&postcount=4)
Regards,
Chaz

Cannot Extract APK

First ok all, Move if not in the correct spot (Or Delete if against TOS)!
Unsure if this is possible but I'm trying to extract an APK (Not sure if I should mention the App, I Did purchase the app) to make a small change to the code. I Can get to a certain point of extraction and then it stops. The files I need to edit are extracteded however so I can change what I need to, but as files are missing, when I recompile the app does not launch.
Any thoughts? Suggestions?
I've tried both APK Studio & APKTools

[Q] Instal 2 same apps on a single device

I want to install 2 Opera Mini or any other apps in a single device. I know there are may modded apps. But I want to learn it by myself..
So here are the stuffs that I did.
1. I modded the AndroidManifest.xml and changed package name i.e. "com.opera.android.mini"
2. I went to res/values/strings.xml and changed "app_name" string. i.e. "Opera Mini"
3. Signed the apk.
I can install the apk and run it flawlessly. But the problem is that whenever I install modded apk first then orginal apk and vice versa, It shows "Application not Installed" . Even when I install apk from Play Store, I get certificate error or something like that!
Can anyone guide me? Thanks for help!
This was how I modded apk: https://www.youtube.com/watch?v=GcsvNLoCUzQ

Decompiling and recompiling Maps APK

Hi,
I wanted to decompile, modify XMLs only of the Google Maps app and add one asset, and recompile the APK (only for personal use). I don't need to edit any of the source code. I already tried this process but the package will not install on my Galaxy S5. I just added an extra permission (may not be used since the code doesn't use it) and when I try to install the new APK it tells me that it requires the new permission (which is good), but when I click 'install' it tries to do it but ultimately says "app not installed."
Does anyone have any idea as to what is going on? I understand that once I sign the package with my own keystore, the Google API will stop working. I tried to create my own Google API key that is linked to my keystore, but that didn't seem to resolve the issue. I would appreciate any help from someone who has done this previously.
Thank you very much!
i'll do and tell you the results ...
Sent from my MI 4LTE using Tapatalk

Categories

Resources