yashsingh1/xdaforums huggingface dataset:
[Galaxy Y GT-S5360 General] TheFixItMan:
Just because the apk recompile doesn't mean the mod has been done correctly - it just means there are no syntax errors

For example

You can have a smali file with a value that points to 0x965236 in public.xml

But if this value is wrong or relates to something else than it will cause a bootloop either on startup or when that reference is activated eg a button press

Can't help you any other way - my guess is incorrect modification - logcat it & find out

And of course I'm assuming the rom is deodexed
[Galaxy Y GT-S5360 General] abhishekr700:
Sir u misunderstood me im getting these warning while recompile when i have not modded anything

Straight decompile then recompile

They come on rc3/4
[Galaxy Y GT-S5360 General] TheFixItMan:
Ignore it - they are beta versions anyway designed for KitKat/lollipop framework which you are not using - keep telling you this

You need to use version 1.5.2
[Galaxy Y GT-S5360 General] abhishekr700:
When i use it i get stuck in bootloop

How can i see what is causing this?
[Galaxy Y GT-S5360 General] TheFixItMan:
ADB logcat
[Galaxy Y GT-S5360 General] abhishekr700:
What command to use fir a better logcat
[Galaxy Y GT-S5360 General] abhishekr700:
Sir do u know how to changes the resolution of an app

Actually there is a launcher with its own lockscreen but the time gets half hidden due to nav bar button
[Galaxy Y GT-S5360 General] Charlypop:
Thanks.
[Galaxy Y GT-S5360 General] sukhraj.mahal:
Decompiling Arsc

Thanks for this!. Im trying to decompile a resources.arsc file from a system image so I have no framework etc. I know apktool does resources.arsc but I cannot figure out how to. I have searched google and XDA as much as I can. So if someone could direct me to link that doesnt talk about apks but arsc instead or help me out thanks
[Galaxy Y GT-S5360 General] srisurya95:
I get this error when I try to install framework

Exception in thread "main" brut.androlib.AndrolibException: Invalid value type:
0
at brut.androlib.res.data.value.ResValueFactory.factory(ResValueFactory.
java:64)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:242)

at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.ja
va:230)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:200)

at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:188
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:156)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:11
3)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:39)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:678)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:660)
at brut.androlib.Androlib.installFramework(Androlib.java:641)
at brut.apktool.Main.cmdInstallFramework(Main.java:240)
at brut.apktool.Main.main(Main.java:87)
[Galaxy Y GT-S5360 General] Skidiver:
I get a could not decode message. Can somebody help with this?

Thanks in advance!
[Galaxy Y GT-S5360 General] hawk1997:
I got These Error.

[IMG="Error Img"]http://s32.postimg.org/gfj9aixol/error_log_13385382852952.png[/IMG]
[Galaxy Y GT-S5360 General] paeffiong:
I had the same error as shown above
[Galaxy Y GT-S5360 General] b16h22:
Happens when you have a bad file in drawable-ldpi.So the id's after it goes wrong in public.xml.
[Galaxy Y GT-S5360 General] anasdcool71:
The three apks (framework-res, SystemUI, and twframework-res) should be of the same rom. Whether on stock or custom.

And how didn't you find any twframework-res.apk? It's on every Samsung mobile. Look closer in /system/framework. You will find it. If you don't, that means you are not using a Samsung phone.

For Samsung, it's twframework-res.apk.

For HTC, it's com.htc.resources.apk.
[Galaxy Y GT-S5360 General] RivaultUser:
I'm using Xperiaaaaa, so what's the name???
[Galaxy Y GT-S5360 General] anasdcool71:
Any other apk you find inside /system/framework, along with framework-res.apk is used for theming. Although, only framework-res.apk and SystemUI.apk can be enough.
[Galaxy Y GT-S5360 General] hell_lock:
How to decompile on phone??
[Galaxy Y GT-S5360 General] deathnotice01:
u need metamorph or ninjamorph
[Galaxy Y GT-S5360 General] RivaultUser:
another error -.-

When I tried to recompile textinput-tng.apk I got this error

What I've done :

1. I want to mod the textinput-tng for GB

2. So, I took a .png file from the textinput-tng.apk for the ICS and paste it to the textinput-tng for the GB

3. And When I want to recompile, All I get is this........

This is the log when I tried to decompile & recompile :

C:\APKTOOL>apktool d textinput-tng.apk
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\alex\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
Can't find framework resources for package of id: 2. You must install proper fra
mework files, see project website for more info.

C:\APKTOOL>apktool b textinput-tng
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:182)
at brut.apktool.Main.main(Main.java:67)
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

C:\APKTOOL>

Please helppppp
[Galaxy Y GT-S5360 General] hell_lock:
load ur framework
[Galaxy Y GT-S5360 General] RivaultUser:
What do you mean by load?????

Install it again??

apktool if framework-res.apk ???
[Galaxy Y GT-S5360 General] anasdcool71:
Yes.

apktool if framework-res.apk

apktool if SystemUI.apk

Make sure they are of the same rom (whether stock or custom) from where you have taken out the apk.:)
[Galaxy Y GT-S5360 General] RivaultUser:
I'm using framework-res.apk & SytemUI.apk from a mod, which one to install??????

From the mod or ROM that I use now( Stock ROM) ?????

I've load it with the one from mod still have this error.........
[Galaxy Y GT-S5360 General] hell_lock:
Don't use the command line apktool because its for only advanced users. You should use apk manager/multitool cuz its noob friendly and consumes less time. Even I use it though I know command line also

---------- Post added at 09:14 PM ---------- Previous post was at 09:10 PM ----------

check PM
[Galaxy Y GT-S5360 General] rktcool:
Thanks a ton!

Thanks a lot for your useful thread...

Am sure it has helped a lot of newbies (like me)!

:)

---------- Post added at 12:09 PM ---------- Previous post was at 11:57 AM ----------

After reading your tutorial, i decompiled the Music.apk from my samsung GT-S6102.

I built it again successfully using apktool.

I got it signed as u said with SignAPK.

But when I try to install it using adb it says the file is already installed... I tried changing the name of the APK, but in vain...

D:\Program Files\Android\android-sdk\platform-tools>adb install G:/Music.apk
4706 KB/s (1055417 bytes in 0.219s)
pkg: /data/local/tmp/Music.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]

What am I doing wrong?

Additional info:

I removed this line from AndroidManifest.xml since it gave me an error

<meta-data android:name="android.app.searchable" android:resource="@xml/searchable" />

The error it showed before removing this line was

G:\Droid\APKTool\musicc\AndroidManifest.xml:132: error: Error: No resource found
that matches the given name (at 'resource' with value '@xml/searchable').
[Galaxy Y GT-S5360 General] anasdcool71:
^^^answer :-

First of all, don't ever sign system apps. I've said that in the first post too. Music.apk is a system app. Just compile it and shift it to /system/app.
[Galaxy Y GT-S5360 General] alkesh95:
I always sign framework-res.apk, systemui.apk, etc. Before pushing in system
[Galaxy Y GT-S5360 General] anasdcool71:
I don't think it'll matter if you're on a custom rom. Or if you have edited the AndroidManifest.xml.
[Galaxy Y GT-S5360 General] ANiK3T:
Buddy i've lost my andro fone so can u give me these

framework-res.apk (location : /system/framework)

SystemUI.apk (location : /system/app)

twframework-res.apk (location : /system/framework)

pls

it'll be greatful
[Galaxy Y GT-S5360 General] anasdcool71:
I currently don't have the stock framework, but a custom one.

There's a thread by CALIBAN666 in the Themes and Apps section where you can get those apks.

||I'm just a PM away for help||
[Galaxy Y GT-S5360 General] xmariox2:
Does anybody know what does it mean?
[Galaxy Y GT-S5360 General] ArxDroid:
Thanks :D

Very Usefull
[Galaxy Y GT-S5360 General] hacker0377:
Help me....

:crying:

When i type in follow.

C:/Windows/apktool/apktool

It show "java" is not recongnized as external or internal command.
[Galaxy Y GT-S5360 General] ic3141:
Thanks for the guide, only after following yours successfully i realized the mistake i made, so i will post it here for others to learn from my stupidity:

I've tried for long time to diff some ported roms but had troubles when trying to re-compile the framework.jar.out. The reason was every type typed only

">apktool b framework.jar.out" only without giving a name to new compiled .jar - as seen on other guides

If no name specified, it will look working ok but will not create the file!

When people die, they don't know are dead. Only the living ones know and are the one suffering.

For stupid people applies the same
[Galaxy Y GT-S5360 General] bumslayer:
Not true. It will create the jar file inside the dist folder.
[Galaxy Y GT-S5360 General] funnypharmacist:
Thank you so much!!

Great Job

Sent from a Device

|Unable to figure out which one it is|
[Galaxy Y GT-S5360 General] Shane:
P-O-S-T D-E-L-E-T-E-D B-Y S-O-M-E R-E-A-S-O-N-S

bY

------------------------------------------------------SOMKLL--------------------------------------------------------------------
[Galaxy Y GT-S5360 General] anasdcool71:
APK Manager is just like apktool, but designed as a user-friendly feature. It dosen't really require a guide. Like in Windows, you can click on the Computer icon and see the drives but in DOS, you got to type the actual commands.
[Galaxy Y GT-S5360 General] dinesam:
thanks

really awesome tutorial....
[Galaxy Y GT-S5360 General] Fujikid:
Thanks and a few questions

Thank you for this anasdcool71.

As we have a problem that requires modifying an existing apk I've been looking around for this information and this looks by far the most comprehensive and useful information.

I'm fairly new to Android development and this forum. I have a couple of questions that I'm sure will only highlight our inexperience. We've done all our work through Eclipse and the Android SDK so far.

The references to framework-res.apk, systemUI.apk and twframework-res.apk?

Where do we get these files? They don't seem to be in the Android SDK. Can they be built with the SDK somehow?

Our app currently supports Android 2.3.x - 4.x. If we get the framework files for say 4.1 and can make the changes, will it work for 2.3.x and 3.x etc?

As background. Our app has been provided in one country for free to the end user but paid for by an OEM customer as a promotion. Unfortunately it was far too popular and our customer has backed out of the deal claiming they had not budgeted for the sort of numbers that have been downloaded. They have the source code on their servers so legal proceedings will be following to get it back with compensation but those could take forever.

For now we simply (hopefully) need to hack the apk so we can change the package name and upload the app separately ourselves on a global basis. Is this possible to do with this method?
[Galaxy Y GT-S5360 General] Toni5830:
My pc has 32 bit os.. Does JRE require at least 64bit??

sorry for being noob :(

And I have this:

C:\Windows>apktool if e:\systemui.apk
'java' is not recognized as an internal or external command,
operable program or batch file.
[Galaxy Y GT-S5360 General] anasdcool71:
If you open the XML files of the apks framework-res.apk, SystemUI.apk and twframework-res.apk, you'll find some Views which are not there in Eclipse while using Android SDK. So I also doubt these apks being built from Android SDK in Eclipse.

You can port a 4.1 apk to support a 2.3 or any below version by removing the newly added features. Everytime the SDK gets updated, some new classes, enums, interfaces or whole new packages are added. These can't work with the lower version of SDK.

The 3rd answer, yes, you can change the package name by the decompiling the apk file. The package name will be in every smali file. You'll have to rename the folders inside the smali folder as well. And, you'll also have to edit the manifest.

My PC is also 32-bit OS, and JRE works just fine.:)

About your second problem, make sure you have JRE installed and you're in the correct directory.
[Galaxy Y GT-S5360 General] Toni5830:
JRE is not installed because when i double click on the .exe file I downloaded from the link in the op it tells me something like "this is a 64x program version, this PC runs 32 bit os"

Tapatalk 2
[Galaxy Y GT-S5360 General] Fujikid:
Hi Toni, You just need to download the x86 version of the JRE for Windows.

You can get it from Oracle. Sorry can't post a link I'm a noob too.

Not the one that says online

.
[Galaxy Y GT-S5360 General] Fujikid:
Thanks anasdcool71.

If we can't build or get these system apk files fro the SDK where can we get the files from?

(None of our devices are rooted)

Situation:

I can decompile our apk with apktool 1.5 with no errors without the files but:

- when I try to recompile the project that's been decompiled (even without changing) the new apk ends up less than half the size of the original.

- None of the smali files contain the package name as you suggest. (I presume this is a problem if you say they all should)

I guess this is all because I haven't got the framework loaded?

Does anyone have any recommendations on this? Our application has built in support for Android from 2.3.x to 4.x.

- Will it not work on 2.3.x if I use the 4.x framework for the decompile/rebuild?

- Will the more advanced features not work on 4.1 if I use the 2.3.x framework for the decompile/rebuild?

Obviously I can try this out myself if only I can find out where to get the various vanilla frameworks.

BTW: I just notice this is in a device specific thread. I trust all this will work for any device or is modding an apk like this device specific?
[Galaxy Y GT-S5360 General] Toni5830:
Need help..again..

C:\Windows>apktool if D:\phone.apk
Exception in thread "main" brut.androlib.AndrolibException: Arsc file contains z
ero or multiple packages
at brut.androlib.res.decoder.ARSCDecoder$ARSCData.getOnePackage(ARSCDeco
der.java:431)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:558)
at brut.androlib.Androlib.installFramework(Androlib.java:497)
at brut.apktool.Main.cmdInstallFramework(Main.java:228)
at brut.apktool.Main.main(Main.java:76)

SOLVED, sorry
[Galaxy Y GT-S5360 General] anasdcool71:
Answer to first Q -

We can get the files from any Android phone on which the particular app can run on. And obviously, for this, you HAVE to root the phone.

I have no idea how you decompiled your app without a framework, so maybe if you decompile it using the framework and then recompile, maybe the size will end up being similar.

And maybe you need to load the framework to view the package name also. In Eclipse, every class in src folder contains the package, so every smali (that represents the class) also contains it. For eg.

In JAVA :-

package com.xda.anasdcool71;
import ....;
public class MainActivity extends Activity{}

In Smali :-

.class public Lcom/xda/anasdcool71/MainActivity;

Answer to 2nd Q -

- I doubt if it'll work on 2.3.x if you use a 4.x framework for decompile/rebuild. Like, for making an app compatible with 2.3.x - 4.x, you have to use the 2.3.x version's SDK instead of the 4.x version's.

- Again, no. For the more advanced features, you gotta build the app with a higher version of framework instead of 2.3.

Even if this is a device-specific thread, this same procedure is to be applied for modding any apk file. There's just a slight difference :-

The framework-res.apk and SystemUI.apk are there in all phones (actually SystemUI.apk is only in 2.3.x and afterwards).

But the third apk varies with the manufacturer.

For Samsung phones, it's twframework-res.apk

For HTC phones, it's com.htc.resources.apk and so on. Basically, this third apk isn't that important in decompiling or recompiling.
[Galaxy Y GT-S5360 General] Abo7amed:
thank you , i'm looking for this topic for along time

but i've some problems

1. how can i open system folder ?

2. I brought those files from rom files from rom files

framework-res.apk (location : /system/framework)

SystemUI.apk (location : /system/app)

twframework-res.apk (location : /system/framework)

3. i've this error message

Error: Unable to access jarfile C:\WINDOWS\\apktool.jar

please help me

I want to apply this topic http://xdaforums.com/showthread.php?t=1980530

thx
[Galaxy Y GT-S5360 General] Madaditya:
You suppose to paste the three files of apktool in c:/windows right?

So in cmd type

Cd c:\ windows

After that itll enter the windows folder and thus use your apktool jar file

After that apktook if....and further instructions

Or else need to paste proper files in windows

Hit :thumbup: if this helps:p
[Galaxy Y GT-S5360 General] akikhia:
oops neverming
[Galaxy Y GT-S5360 General] Abo7amed:
store2.up-00 .com/Nov12/ovu81425.jpg

no thing changed ::!!
[Galaxy Y GT-S5360 General] QuickInfo:
After I put the command: apktool if c:\android-sdk\framework-res.apk

I get this error:

'apktool' is not recognized as an internal or external command, operable program or batch file.

Any way to fix this?
[Galaxy Y GT-S5360 General] Themimitoof:
There is a version to decompile a apk from Eclipse?
[Galaxy Y GT-S5360 General] Yogesh1969:
Be clear

You are mixing up ..Write slowly. Or it appears gibberish.
[Galaxy Y GT-S5360 General] anasdcool71:
Please first make sure you're in the right destination, like C:\Windows or wherever you've put the two apktool files.

No, you CANNOT decompile an apk from Eclipse. Trust me, I've tried it many times. Although there are softwares developed by some XDA devs which make the source code of an apk visible in Java (but you still have to make changes in smali). That's the most you can get.:)
[Galaxy Y GT-S5360 General] QuickInfo:
I was in the right destination. I even Shift+Right clicked and open command windows there and the same error comes up :/
[Galaxy Y GT-S5360 General] PuRE IVIonztah:
From the first error you got it sounds like you don't even have the apktool.jar

Sent from my EVO using Xparent ICS Tapatalk 2
[Galaxy Y GT-S5360 General] ub3rprogmr:
thanks
[Galaxy Y GT-S5360 General] ankitgarg1000:
thanks :D
[Galaxy Y GT-S5360 General] Roooty:
jellybean

ok I understand the concept but im running jellybean and i do not have the twframework-res.apk file only the other two....any suggestions?
[Galaxy Y GT-S5360 General] geokirby:
Thanks for the guide! It helped me a lot with figuring out how to edit my system clock app in order to put more city options in the world clock :D
[Galaxy Y GT-S5360 General] rajani.dhawan:
didn't find twframework-res.apk on "/system/framework"

i undrstnd the process, but can we get the ".java" file also by using "apktool" as we get the "smali files" and not the .java files.

also would u pls explain the need of both below files :

SystemUI.apk (location : /system/app)

twframework-res.apk (location : /system/framework)

also I hv android os "4.0.4" so it dont hv "twframework-res.apk" on location "/system/framework".

thnks
[Galaxy Y GT-S5360 General] raj.parekh07:
Do you have galaxy y?

NOTHING TO SEE HERE
[Galaxy Y GT-S5360 General] anasdcool71:
The smali files are itself the java code, just in a different language. However, search in XDA, I'm sure I saw a thread by an xda member broodplank. He had designed a software, with which we could see the source code in smali as well as in java. It's just that you cannot recompile back from the java code after editing, you can only learn from it, and make the corresponding edits in smali and recompile.

SystemUI.apk consists mainly of the status bar and the interface seen by you. twframework-res.apk is mainly concerned by the particular framework given by your manufacturer, in this case, TouchWiz given by Samsung. You'll understand when you decompile them. twframework-res.apk isn't as much important. Things would be normal even without it. :)

Most probably he dosen't.:p
[Galaxy Y GT-S5360 General] sid448:
Great thread...:thumbup:

Thanks.. but can you also add link to apktool thread? Not that its hard to search.. but a link would have been nice in op post..
[Galaxy Y GT-S5360 General] mjz2cool:
i too have a question, what exactly does apktool do with installed framework files? and why does SystemUI.apk need to be installed as framework?
[Galaxy Y GT-S5360 General] kataly56:
I can't recompiling :crying:
[Galaxy Y GT-S5360 General] apurvapatel:
Like me, you too probably didnt install the framework.

You need to copy the "framework-res.apk" "twframework.apk" "SystemUI.apk" from you rooted phone.

The two framework files would be in the /system/framework folder on your rooted phone.

The SystemUI.apk would be in /system/app folder on your rooted phone.

You can pull the files using "adb pull" command, but probably the easiest way would be to run a root browser on your phone and copy the three files to your external sd-card, connect the phone to your PC as a USB device and copy the three apk files to your computer anywhere.... say for example, c:\apk

Once you have the files on your PC you need to install the frameworks for apktool to use. To install the frameworks, you would have to run the following command at the command prompt on your PC:

apktool if "c:\apk\framework-res.apk"

apktool if "c:\apk\twframework-res.apk"

apktool if "c:\apk\SystemUI.apk"

the output of the commands would be in the following order respectively:

I: Framework installed to: C:\Users\...\apktool\framework\1.apk

I: Framework installed to: C:\Users\...\apktool\framework\2.apk

I: Framework installed to: C:\Users\...\apktool\framework\127.apk

Done.

Your apktool is ready for use.

You can decompile and recompile the apk as per the OP.

Happy modding. :)
[Galaxy Y GT-S5360 General] amit34521:
thanks

thanks for adding this tut.
[Galaxy Y GT-S5360 General] Androlover98:
Actually i am a noob.

when I input farmewinstallation commands it says that java is an unrecog. command.

I have installed jre too.

Pls help:confused::(
[Galaxy Y GT-S5360 General] pattriccio:
i always get an error in recompiling apk's any solution
[Galaxy Y GT-S5360 General] Alex.87:
Hello everyone, I'm trying to learn how to use apkmanager / apktool; operations that I have performed are:-start dependencies systemui and framework-res twframework-res decompiled-deleted-file-classes recompiled and put the phone in the system ui but there must be some problem because it crashes, let's talk about smali file where I had to change the wording onlongclick because I wanted the settings in the statusbar be opened with a single tap unlike the simplistic v10 where is held down, you have info about it?

sorry for google translator :)
[Galaxy Y GT-S5360 General] :
Bro i will disturb you again and again becoz i am super noob and only u can help me out.........aftwr watching almost 6 videos on youtube, i am still not able to get it.....but our thread is for newbies and its quite easy and reliable......plz watch the photo and reply to the question
[Galaxy Y GT-S5360 General] :
good tutorial

thank you for this :)