yashsingh1/xdaforums huggingface dataset:
[Android Software Development] supercowz:
i see

but when i flash my rom with modified framework-res and setting.apk, i cant use mtalogs (not installed)

do you want log when my rom booted then flashed my modified apk ? but i dont see crash ....

i'm stuck ?

---------- Post added at 03:56 PM ---------- Previous post was at 02:58 PM ----------

i solved the problem ! now setting.apk is working

before i was opening System.apk with 7zip in dist folder then added orignal META-INF and AndroidManifest.xml from original folder ... then fail !! (most of apk a modify that way is working, only settings.apk .. gave me trouble)

but now

using this method : http://xdaforums.com/showpost.php?p=39444995&postcount=1617

another way.

in your apktool folder you'll have a folder called build, in your case, take the arsc from that folder, delete the arsc from the original apk,and replace with the arsc from the build folder. your only then having to replace the file you've modded.

and now setting.apk is working, i mean setupwizard is not freezing !
[Android Software Development] djdarkknight96:
Cool :svetius:
[Android Software Development] supercowz:
so what is the correct way in general for compiling apk ?

this way ?

in your apktool folder you'll have a folder called build, in your case, take the arsc from that folder, delete the arsc from the original apk,and replace with the arsc from the build folder. your only then having to replace the file you've modded.
[Android Software Development] djdarkknight96:
Yes, I usual with non system apps drop my edited files from build top untouched apk. You can also do apktool b -c blah.apk and it will keep original signature and manifest. Then you can use the dist apk instead of dropping in untouched.
[Android Software Development] dttung80:
Dear bro, I have same problem when Decomplie China package. Still now do you know how to fix? Thank in advance.
[Android Software Development] CrisBalGreece:
Hello. Thanks for this tip. Because I'm on developing on Letv Le1pro X800 US please clear to me the way doing this. I'm taking the original settings. apk and decompile it then I make the adds - changes on it I recompile it and zipalign and then take from build file the arsc and I replace in the original apk? And the moded res file? I drop it this to in original apk zip?

Or defore put the original apk for decompile it I put the arsc from build and put it inside original apk and then put the apk for editing? I'm just confused about this. Thanks in advance. :good:
[Android Software Development] supercowz:
compile your modified setting folder

then open your original settings.apk with 7zip and put on it (from build folder) resources.arsc and res folder

thats the only way i found to made it work
[Android Software Development] CrisBalGreece:
Thanks for your reply!;) I'l try it and report-post here!:D
[Android Software Development] CrisBalGreece:
Hello my friend. Not worked with this way (put the res file from build) because it's not including the the new languages. But worked with another way. I drop on original apk zip the arsc from build file and the res file from the moded apk zip. That's the way working with all inside modes and changes of MM and LL rom. :good:
[Android Software Development] StrangerWeather:
Hi guys, Is it possible to use the apktool.jar library inside an app, to decompile and recompile a phone's SystemUI.apk?

I have successfully imported the jar file into my Android Studio project, but I am not sure what happens from there. Any ideas?
[Android Software Development] Dethfull:
Imposible.

The maximum you can do is this:

http://xdaforums.com/showthread.php?t=2488697
[Android Software Development] Thebear j koss:
It can be imported, placed, added into any folder in android studio... It won't do anything though, as apktool and android studio are 2 different tools that do 2 different things. There will just be an apktool.jar in a folder in your android studio. It won't do anything...

Thebe?r'$ NeXu$
[Android Software Development] Frankbrazillian:
That's why you are missing an fundamental step! If you edit the AndroidManifest, the signature not longer will valid. You need to sign with another signature and disabled the signature verification on your ROM. You will find tutorial for both on xda... How to sign an apk and how to disable the signature verification. Hope this can help you.... :)
[Android Software Development] anees02:
What's the problem with twframework-res.apk?

I can decompile it, but can't recompile it.

Even if I didn't make any modification.

I have Galaxy Note 4,and working on apktool2.2.0.jar with MM 6.0.1
[Android Software Development] djdarkknight96:
Log?
[Android Software Development] anees02:
I use advanced apk tool with apktool2.2.0.jar

And the log is attached with this reply
[Android Software Development] mirhl:
Is Java 1.7 the minimum version, or the required one?

It's not really clear in install instructions.
[Android Software Development] djdarkknight96:
All resource errors, did you install both framework? TouchWiz and normal? Saying you have a ton missing that's why I'm asking.
[Android Software Development] CrisBalGreece:
Hello. First of all go to searche >windows bar> and type %appdata% go to local >temp> go inside and clear all files in it.

2 transfer all apk tool files in C:/ drive

3. Put the framework (s) on input file and install them

4. When decompile it go to output folder framework-res. apk and find the (if I remember right) yml.html go inside and delete everything below text.. - rscs

4. Make your changes

5. Recompile & zipalign

6.Done
[Android Software Development] TONY6669:
I had to use an older version of apktool to do tw framework

Sent from Gurple Tapatalk
[Android Software Development] anees02:
[MENTION=2126467]djdarkknight96[/MENTION]

Yes I did,as I said I decompile it correctly (So frameworks already installed )

[MENTION=7565215]CrisBalGreece[/MENTION]

I did what you said but with no success.

I get the same result.

[MENTION=4595448]TONY6669[/MENTION]

I tried 4 versions of apktool with no success.
[Android Software Development] thereassaad:
[MENTION=1556859]anees02[/MENTION] , try look here for correct apktool version that's can decompile correctly the twframework-res.apk

http://xdaforums.com/showthread.php?t=2799050
[Android Software Development] djdarkknight96:
Just because it decompiled doesn't mean it will compile with correct resources. I get round Icon errors on builds because it's s missing resource in my fw but it decompiled fine no errors.

You could delete those resources then use the build folder to move your edits to fresh apk. Unless those resources are what you're editing they will be in the stock apk still but you'll remove to successfully build it only.
[Android Software Development] TONY6669:
2.0.0 works on my LP tw framework

Sent from Gurple Tapatalk
[Android Software Development] ahdnoman:
Why???

Why when I use Apktool to decompile systemUI.APK samsung d710

it give me in CMD ??:confused::confused:

Exception in thread "main" brut.androlib.AndrolibException: java.io.FileNotFound
Exception: if (■■و╩┌╨╤ ┌طه ╟طغ┘╟ع ╟ط┌╦µ╤ ┌طه ╟طعط▌ ╟طع═╧╧)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:650)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:595)
at brut.androlib.Androlib.installFramework(Androlib.java:679)
at brut.apktool.Main.cmdInstallFramework(Main.java:239)
at brut.apktool.Main.main(Main.java:87)
Caused by: java.io.FileNotFoundException: if (■■و╩┌╨╤ ┌طه ╟طغ┘╟ع ╟ط┌╦µ╤ ┌طه ╟طعط
▌ ╟طع═╧╧)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:603)
... 4 more

C:\Users\ALFAISSAL\Desktop\apktool>apktool if systemui.apk
Exception in thread "main" brut.androlib.AndrolibException: java.util.zip.ZipExc
eption: error in opening zip file
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:650)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:595)
at brut.androlib.Androlib.installFramework(Androlib.java:679)
at brut.apktool.Main.cmdInstallFramework(Main.java:239)
at brut.apktool.Main.main(Main.java:87)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:603)
... 4 more
[Android Software Development] anees02:
Almost all apps decompiled and recompiled successfully but maybe 4 or 5 apps I couldn't recompile

S-voice_android_phone.apk and twframework-res.apk are among of I couldn't recompile.

S-voice doesn't matter so much but twframework-res.apk so important.

And I always don't make many modifications except inserting new values folders to make apps support international languages.

If I insert these values to the odex app I think it will not work correctly.

I will try deodex the app and insert the values using 7zip without decompile the app and recompile it.

I hope it will make sense.

If there is any suggestion to me I appreciate it.
[Android Software Development] djdarkknight96:
Well since your only adding translations delete the errors but only move built resources.arsc to fresh apk once built. Should be fine if you can get it build. If the errors are within values then it's not going to work.
[Android Software Development] anees02:
I noticed new things.

When I use third party app for decompiling ,I noticed after I decompile twframework-res.apk the app says that decompile process completed successfully but when I go to decompiled folder the folder /twframework-res.apk/build/app

Is empty folder.

I copy the res (folder)+AndroidManifest.xml+resource.arsec to the build folder but with no success with third party app.

So I decided to use apktool.jar directly without any third party app.

By copying res (folder)+AndroidManifest.xml+resource.arsec to the build folder the app now can recompile correctly.
[Android Software Development] Ticklefish:
That depends on the third party app you're using. They all use apktool but some of them work in different ways.
[Android Software Development] djdarkknight96:
Ah yes, use commands not those UI apps.
[Android Software Development] iBotPeaches:
A new version has been released!

v2.2.1 (Released October 18, 2016)

Download: https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.2.1.jar

Details of Release: https://connortumbleson.com/2016/10/18/apktool-v2-2-1-released/
[Android Software Development] DaOldMan:
Thanks a lot as always. Did you fix also the problems with samsung apks ?
[Android Software Development] djdarkknight96:
I don't see it on change log, I'm sure you could just test and find out much faster then asking.
[Android Software Development] DaOldMan:
Yes and I could also read the commits in his repo. But I am always afraid I missed something. I am also quite sure it was not fixed, otherwise it would be in the changelog.

No harm done, right ?
[Android Software Development] Ticklefish:
There's been some discussion about how to recompile v2 app's on a thread I run.

It looks like v2 signed apps on Nougat need to have the SEC-INF folder deleted and a new META-INF folder inserted (by signing with testsign or a similar program). Signature verification needs to be disabled on the phone/tablet for the file to install.

V2 signed apps on Marshmallow and below need to have the modified files dragged and dropped, using 7z or similar, into the original APK or JAR. Just like we used to do with apktool 1.5.2.

Thanks for all your hard work with this tool. Without it, modding would be a hell of a lot harder!
[Android Software Development] djdarkknight96:
No none, I'm more worried about your time waiting for something you can find out much faster by trying it. Your time is the issue here lol
[Android Software Development] fhem:
Thank you sir -- you are truly one of the best.
[Android Software Development] ANDROIDXFOREVER:
work great tnx
[Android Software Development] anees02:
What about MM system apps for galaxy devices...do I need to sign the system apps after deodexing and inserting new languages values?

I tried recompile system apps and zip-aligned them only without signing but after flashing, the phone freezes on Samsung logo.
[Android Software Development] Frankbrazillian:
Recompile tw mm

Follow this step's and you should have no problem....

Note, if you edit the AndroidManifest, you need to delete the SecInf folder(in case your firmware have), sign with another signature and disable the signature verification on your ROM.

http://xdaforums.com/showpost.php?p=68958899&postcount=5630

Hope this can help you!
[Android Software Development] anees02:
Thank you.

But I want to understand why you decompile then edit then recombile,after that you drag and drop the res (folder) as I understood to the original apk using 7zip.

Why you don't drag the (res folder) from the decompiled apk after editing it or inserting new values?

Is it any difference between (res folder) in decompiled apk and recompiled one?

Thank you again.
[Android Software Development] Thebear j koss:
Yes. Big difference. Can't use decompiled resources in a compiled apk.

Only 1 day left to show your support for Team Blackout and show your Darkside pride- https://teespring.com/team-blackout-android#pid=2&cid=2397&sid=back
[Android Software Development] Frankbrazillian:
Recompile tw mm

You already got an answer! :)
[Android Software Development] DroidFreak32:
Hello guys. I'm getting this error on recompiling framework.jar:

>apktool b framework.jar.out
I: Using Apktool 2.2.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
Exception in thread "main" org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65536
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:329)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1027)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:803)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:252)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:230)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:53)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:400)
at brut.androlib.Androlib.buildSources(Androlib.java:331)
at brut.androlib.Androlib.build(Androlib.java:287)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)

I am following this tutorial for adding gesture anywhere.

It's the 1st time i'm using it so any help will be appreciated.

Ive attached a file which is causing this error when i copy it to framework.jar.out\smali\android\annotation folder

https://drive.google.com/open?id=0Bw7a7tPGXfmPRTNLR2FnUVZpbWM

EDIT:

I'm assuming that the error is because the file is >8KB ? (65536 b = 8KB thats y?)
[Android Software Development] moluntic:
Hi guys,can anyone help me with this??

i wanna add some tweaks in secsetting2.apk of A7 2016 Rom,but this Warnings happend and the out apk is same as default one with no changes at all.

same happend with some other apk from this rom too,but in my old rom it works great
[Android Software Development] Thebear j koss:
What are you changing? Warnings can usually be ignored but haven't any clue what you changed or how you recompiled.

Only 1 day left to show your support for Team Blackout and show your Darkside pride- https://teespring.com/team-blackout-android#pid=2&cid=2397&sid=back
[Android Software Development] djdarkknight96:
Ignore them, it's just saying these don't have default translations.
[Android Software Development] Ticklefish:
You can ignore the translation warnings. They won't stop the app from working.

The bits I'd be concerned about would be these:

W: E/ResourceType( 8116): Failed resolving ResTable_map name at 3048 with ident 0x02040076
...
W: warning: Package not found for resource #02010052

If your app still runs without any problems, you can probably ignore these too. But personally I'd want to find out what that resource was that apktool couldn't handle. Have a look through public.xml and your smali and see if it's something that could cause an issue. If it's an issue that's not being used, you don't need to worry about it.
[Android Software Development] moluntic:
thanks for answering but yes i can ignore,app recompile successfully and works great but no changes at all,the recompiled app is as same as default one with no changes
[Android Software Development] Ticklefish:
And what changes are you making? If the recompiled app isn't showing those changes, either you haven't changed the right things or you need to look at how you're getting the APK back on your phone.
[Android Software Development] moluntic:
i know what i did,i just wanted to add rom name ver and etc to secsetting but nothing changed,i decompiled the final apk but it was the default one when i checked
[Android Software Development] Ticklefish:
If your new APK is exactly the same as the original, it's worth checking that it's recompiling correctly.

I'd suggest adding an image file to your decompiled APK, recompiling and checking that it's still in the new file. As far as I know, apktool hasn't the capacity to replace modded xml files with the original.

I could be wrong, of course, but that's the first thing I'd check. If the image file isnt there, the APK didn't recompile. If it is, then something else is going on..
[Android Software Development] ANDROIDXFOREVER:
Good evening I have decompiled my systemUI marshmallow to add a folder, then when I recompiled in systemUI the folder was not there, was cme if he copied the systemUI source and recompiled the modified
[Android Software Development] moluntic:
bro i did what u said,i added a pic to drawable,but after recompiling its gone
[Android Software Development] Ticklefish:
Sadly I'm not near a PC to try this out myself yet. Guys, is your file/folder in the build folder?
[Android Software Development] ANDROIDXFOREVER:
yes ....I do not understand that by using the same version of apk 2.2.1 tool with advanced apk tool recompilation and perfect
[Android Software Development] edzamber:
Hi,

Warnings since recompilation are not important, it will not break Settings.apk.

Try your recompiled Settings. If it FC, replace drawable-xxxhdpi-v4/tw_ab_transparent_light.holo.9.qmg from original Settings into recompiled one by drag and drop with 7zip.
[Android Software Development] anees02:
Thank you.

No I approximately finished the translation but I have some problems

1)Contacts (SecContacts) missing from drawer

2)screen write (flashanotate.apk) and (flashanotateSvc.apk) force closed.

Any ideas?

My ROM still stock odexed.
[Android Software Development] edzamber:
You need to deodex first...
[Android Software Development] aydin.gsm1:
hi,

I am trying to decompile and build a system apk,

that built successfully but I get error "unfortunately stopped" on the device after replace apk.

apktool version =2.2.1

phone android version = 5.1.1

apk = SecSettings2.apk

apktool.yml:

!!brut.androlib.meta.MetaInfo

apkFileName: SecSettings2.apk

compressionType: false

doNotCompress:

- arsc

- pio

- qmg

isFrameworkApk: false

packageInfo:

forcedPackageId: '127'

renameManifestPackage: null

sdkInfo:

minSdkVersion: '22'

targetSdkVersion: '22'

sharedLibrary: false

unknownFiles: {}

usesFramework:

ids:

- 1

tag: null

version: 2.2.0

versionInfo:

versionCode: '22'

versionName: 5.1.1-G6000ZCU2APA1

apktool log:

C:\Users\AydinGSM\Desktop\0set>apktool b SecSettings2

I: Using Apktool 2.2.1

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

W: warning: string 'app_notification_row_banned1' has no default translation.

W: warning: string 'auto_calibration_fail' has no default translation.

W: warning: string 'auto_calibration_success' has no default translation.

W: warning: string 'auto_update_summary_chn' has no default translation.

W: warning: string 'giga_lte_samrtbonding_mobile' has no default translation.

W: warning: string 'giga_lte_samrtbonding_wifi' has no default translation.

W: warning: string 'manage_notification' has no default translation.

W: warning: string 'manage_notification_allow_notification' has no default translation.

W: warning: string 'manage_notification_allow_notification_desc' has no default translation.

W: warning: string 'manage_notification_banners' has no default translation.

W: warning: string 'manage_notification_banners_desc' has no default translation.

W: warning: string 'manage_notification_banners_summary' has no default translation.

W: warning: string 'manage_notification_block_notification_method' has no default translation.

W: warning: string 'manage_notification_lock_screen' has no default translation.

W: warning: string 'manage_notification_lock_screen_desc' has no default translation.

W: warning: string 'manage_notification_set_priority_and_sensitivity' has no default translation.

W: warning: string 'manage_notification_status_bar' has no default translation.

W: warning: string 'manage_notification_status_bar_desc' has no default translation.

W: warning: string 'manage_notification_status_bar_summary' has no default translation.

W: warning: string 'package_choose' has no default translation.

W: warning: string 'package_choose_title' has no default translation.

W: warning: string 'xcover_key_title' has no default translation.

I: Building apk file...

I: Copying unknown files/dir...
[Android Software Development] Ticklefish:
How are you replacing the APK? What are you doing after it's recompiled?
[Android Software Development] aydin.gsm1:
replace it whit flashing modified rom, no problem to do this process!
[Android Software Development] anees02:
After I get a translated and odexed rom I can boot my rom.

But if I deodex it I get bootloop

Odexed ROM=can boot successfully with some apps FC's.

Deodexed ROM except (services.jar)=gets bootloop .

What's the problem with deodexed rom.

And should I delete boot.art and boot.oat files under framework folder?
[Android Software Development] aydin.gsm1:
[IMG="Screenshot.png"]http://xdaforums.com/attachment.php?attachmentid=3919338&stc=1&d=1477736684[/IMG]
[Android Software Development] Ticklefish:
Are you signing it? Or are you using the same signature as before?
[Android Software Development] aydin.gsm1:
yes, I copied META-INF& AndroidManifest.xml manually

also used this command

apktool b -c SecSettings2

also used this method

kellinwood.zipsigner2.apk
[Android Software Development] anees02:
I want to know if I have any system apk file and I want to extract the lib directory from inside apk to outside, how to link this lib again with the new location to its apk?

Because I noticed that many apps force closes occur with some apps which have lib inside the apk package.
[Android Software Development] L4zyD0g:
How to sign with this apktool ? [MENTION=3924617]iBotPeaches[/MENTION]

---------- Post added at 11:06 PM ---------- Previous post was at 11:05 PM ----------

How to sign apk using this apktool ?
[Android Software Development] Ticklefish:
Don't use apktool v2.0.2, use the latest instead. That's v2.2.1.

If you want to keep the original signature, you'll need to use 7zip to copy your modified files into the original APK. If you want to use a new signature, you'll need a signing tool. Apktool doesn't sign files itself.
[Android Software Development] djdarkknight96:
System/libs or on lp+ system files have their own folder and libs are inside. See screenshot.
[Android Software Development] aydin.gsm1:
please answer me bro

tnx
[Android Software Development] L4zyD0g:
Im using latest apktool, and I also modify androidmanifest.xml so I need to sign the apk. How to sign it ? or could you recommend me a signing app?