yashsingh1/xdaforums huggingface dataset:
[Android Software Development] iBotPeaches:
Thanks all. I currently own a Nexus 5, One+ One, Sony Xperia Z, Xiaomi MI2, Oppo Find 5 and Nexus S so my testing on LG and Samsung is pretty limited. For those who experience this issue, is this issue largely only Marshmallow Samsung related? So basically I just need to get Samsung device that has native Marshmallow? I see the Samsung S5 has Marshmallow and is pretty cheap on Swappa, so I'll use your very appreciated donations and pick up an SGS5 to investigate.
[Android Software Development] tamirda:
Hi mate, hope you are ok.

The thing with s5 is you need to use a ROM with s7 features that has s7 secsettings or systenui to get the issue.

S5 MM is like Lollipop with android version change in build.prop.

All those twframework res problems are because of the new UI that s6/s7 has. But it is fully working with any ROM in s5 and stable so you can buy it, root it abd flash custom rom to repeat the errors we get.

Sent from my SM-G900F boosted by PhoeniX ROM
[Android Software Development] iBotPeaches:
Thanks for the tip. I purchased a - Samsung Galaxy S5 (AT&T) [SM-G900A]. I'll try and get the S7 software stuff on it and start investigating those Samsung bugs.
[Android Software Development] tamirda:
Good luck mate let me know if you need some help

Sent from my SM-G900F boosted by PhoeniX ROM
[Android Software Development] DaOldMan:
Tamir is of course correct. [MENTION=2739548]tamirda[/MENTION] is your rom good place to start ? I would buy S6 not S5 for this, but you already bought it. The difference in roms and apktool problems between S5 to S6/S6 Edge/Note5/S7/S7 Edge is like day and night. S5 has the awful old rom that I wouldn't now use ever. Apktool works fine on S5 because it's more LL then MM :(. Terrible work from Samsung ....

Regards !
[Android Software Development] tamirda:
S6 is too expensive even a used one.. s5 could easily get a S7 based custom rom as mine... I am not sure my rom works on G900A, but he can ask in my thread if one of my users got it installed on G900A. If it is the same hardware then there shouldn't be any problem at all (only different modem and bootloader)

Sent from my SM-G900F boosted by PhoeniX ROM
[Android Software Development] folgore95:
If somebody is interested i have created a guide for using apktool on windows ( it's a very simple guide, everybody can follow it )

http://xdaforums.com/android/software-hacking/guide-apktool-windows-t3439816
[Android Software Development] crashpsycho:
I just installed apktool i have install at C:\Android\apktool when i try running the apktool command from CMD by pressing (Shift+open command window here)

it give me the error

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

I know my issue is (\\)apktool.jar the problem is i cant find a resolution and file structure is correct

any ideas?

I havent dont the enviorment path cuz i dont know how if someone could give me a tip on that also would be great.
[Android Software Development] Thebear j koss:
https://ibotpeaches.github.io/Apktool/install/

Thebe?r'$ NeXu$
[Android Software Development] crashpsycho:
those are the instructions i followed for the installation. unless you re directing for the enviorment path which is something that doesnt give enough detail for me to do

EDIT: RESOLVED
[Android Software Development] ale5000:
I have disassembled a multidex file, then changed the content of the first dex of the multidex.

When reassembling with apktool it say that it reach 64K Limit and so it is unable to reassemble.

There is a way to automatically move methods from one dex to another dex with apktool?
[Android Software Development] iBotPeaches:
There is not. Apktool's main purpose is to disassemble and reassemble applications. For it to handle method relocation, it would have to understand how many methods existed so a lot of work using dexlib2 would be required. At this point the purpose of the tool and added functionality would no longer be apktool, but a smart tool to work with disassembled source in order to properly preform all the messy logic required to move methods at the disassembled level.

So yes, not a feature.
[Android Software Development] ale5000:
Instead can be added an optional option in the reassembling phase that check if all methods whose main application depends upon are present?

It just have to say:

1) Dependences OK

2) Something missing

I don't even need to know what is missing, I just need to know if my changes have broke something.
[Android Software Development] dewettie:
Is there a way to decompile SystemUI can keep the message id number strings after the text strings in the /res/values/*.xml files?

I want to eg. add extra translations.

Because I can't use the recompiled SystemUI.apk in firmwares as it is missing the message ID's next to the strings in Android Lollipop.

The Settings.apk can work without the message ID next to the strings in xml files and be recompiled but not the SystemUI.apk file.
[Android Software Development] iBotPeaches:
Going to need an example. I'm not quite following. Are you saying an attribute added on <string> elements aren't found in the decoded and thus re-assembled file?
[Android Software Development] dewettie:
Hi

Eg. here is an extract from the German language (SystemUI/res/values-de/strings.xml) source code file

xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<string name="app_label" msgid="7164937344850004466">"System-UI"</string>

<string name="status_bar_clear_all_button" msgid="7774721344716731603">"LÃ¶schen"</string>

<string name="status_bar_recent_remove_item_title" msgid="6026395868129852968">"Aus Liste entfernen"</string>

<string name="status_bar_recent_inspect_item_title" msgid="7793624864528818569">"App-Info"</string>

----------------------------------------------------------------------------------------------------------------------

English source code file(SystemUI/res/values/strings.xml)

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

<!-- Name of the status bar as seen in the applications info settings page. [CHAR LIMIT=12] -->

<string name="app_label">System UI</string>

<!-- The text for the button in the notification window-shade that clears

all of the currently visible notifications. [CHAR LIMIT=10]-->

<string name="status_bar_clear_all_button">Clear</string>

<!-- Title shown in recents popup for removing an application from the list -->

<string name="status_bar_recent_remove_item_title">Remove from list</string>

<!-- Title shown in recents popup for inspecting an application's properties -->

<string name="status_bar_recent_inspect_item_title">App info</string>

----------------------------------------------------------------------------------------------------------------------

When I take the compiled SystemUI.apk file and decompile it, the German and all other language files except English(values/strings.xml)

display as

<string name="app_label">"System-UI"</string> instead of

<string name="app_label" msgid="7164937344850004466">"System-UI"</string>

the msgid= part is missing.

In all Android firmwares, the Settings.apk and SystemUI.apk have these extra 'msgid=' strings in non English languages and disappear when being decompiled with apktool.

I will upload such an apk file and it's original source code also to see the difference.

The problem is if you use a modified non English language strings.xml translated file without the 'msgid=' strings included, the original app fails to recompile when you build whole Android firmware from source code with this file.
[Android Software Development] saulin78:
I'm getting a lot of errors like this with the latest DirecTV App

S: Could not decode file, replacing by FALSE value: layout/smartsearchitem.xml

Lots of them.
[Android Software Development] Thebear j koss:
Post the log. Are they errors or warnings? If it's errors, it probably needs to fix 1 thing and the rest would go away.... If warnings, just ignore.

Thebe?r'$ NeXu$
[Android Software Development] saulin78:
Here is the log showing the errors

I: Using Apktool 2.2.0 on temp.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Vero\AppData\Local\apktool\framewo
rk\1.apk
I: Regular manifest package...
I: Decoding file-resources...
S: Could not decode file, replacing by FALSE value: layout/you_might_like_endcar
d_row_item.xml
S: Could not decode file, replacing by FALSE value: layout/horz_scroll_gallery.x
ml
S: Could not decode file, replacing by FALSE value: anim/zoom_out.xml
S: Could not decode file, replacing by FALSE value: layout/ciorderconfirmppv0.xm
l
S: Could not decode file, replacing by FALSE value: layout/cifree_dtvcinema_filt
er.xml
S: Could not decode file, replacing by FALSE value: layout/wizard_screen_item.xm
l
S: Could not decode file, replacing by FALSE value: layout/ooh_playlist_when_gg_
not_registered.xml
S: Could not decode file, replacing by FALSE value: layout/capture.xml
S: Could not decode file, replacing by FALSE value: layout/smartsearchitem.xml
S: Could not decode file, replacing by FALSE value: layout/rectangle_black_bg_gr
ay_border.xml
S: Could not decode file, replacing by FALSE value: layout/horz_scroll_widget.xm
l
S: Could not decode file, replacing by FALSE value: layout/simplelistitem.xml
S: Could not decode file, replacing by FALSE value: anim/zoom_in.xml
S: Could not decode file, replacing by FALSE value: layout/recenthistorytable.xm
l
S: Could not decode file, replacing by FALSE value: layout/workspace_screen.xml
S: Could not decode file, replacing by FALSE value: layout/lookback_alert_dialog
.xml
S: Could not decode file, replacing by FALSE value: layout/similarshowtable.xml
S: Could not decode file, replacing by FALSE value: layout/tier1_row_grid.xml
S: Could not decode file, replacing by FALSE value: layout/home.xml
S: Could not decode file, replacing by FALSE value: layout/horz_scroll_header_1.
xml
S: Could not decode file, replacing by FALSE value: layout/pginfo.xml
S: Could not decode file, replacing by FALSE value: layout/horizontal_gallery_li
st_item.xml
S: Could not decode file, replacing by FALSE value: layout/home_geniego_watch_of
fline.xml
S: Could not decode file, replacing by FALSE value: xml/backup.xml
S: Could not decode file, replacing by FALSE value: layout/tier2_row_list.xml
S: Could not decode file, replacing by FALSE value: layout/pgibrief.xml
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
[Android Software Development] Thebear j koss:
There isn't any errors. It would say error. It just couldn't decode those entries. On some apps like samsung apps, it adds a dummy file for stuff it can't decode. Did the app decompile? Can you view the folder and it's contents apktool created or is nothing in it? If there is, can you recompile without error?

Thebe?r'$ NeXu$
[Android Software Development] saulin78:
Thanks. Yes it compiled it's the DirecTV app, I wasn't sure if this would cause issues compiling after. I'm trying to defeat the root and HDMI detection and I think I got the root detection figured out but I get a spinning wheel when trying to stream. Looks like I need to find the other protection that most likely detects the HDMI connection.

Thanks a lot!
[Android Software Development] Thebear j koss:
A bit out of my range of knowledge, but are you building with original signatures or signing and install? Sometimes not keeping original signatures breaks critical app functions.

Thebe?r'$ NeXu$
[Android Software Development] fadedout:
It's not possible to build a modified app with original signatures, is it? That would either be a valuable, closely held secret or widely known (e.g. the master key vulnerability).

There's some discussion of it https://ibotpeaches.github.io/Apktool/documentation/#rebuild and https://github.com/iBotPeaches/Apktool/issues/1271. Apparently the `-c / --copy-original` option to copy the original signature only worked with API 18 and lower and only if AndroidManifest.xml was not modified.
[Android Software Development] iBotPeaches:
Especially with Android Nougat and App Signature v2, it definitely does not work. I will mark it as deprecated and stage it for removal. Sorry all.
[Android Software Development] Ticklefish:
I've been using the '-c' option successfully on API 19 to 23 for ages without any problem... :confused:
[Android Software Development] Thebear j koss:
I don't know exactly how things will be working as Connor stated it will be deprecated, but after building apk you can use 7 zip or winrar to drag original meta inf and whatever else from original to new, or drag changes from modified app into the old overwriting the old. (this is what used to be done). Then need to flash new apk with original signature into system. See Ticklefish's signature or mine for his great modifying tool that does just about everything automated. Uses apktool(built right in), can pull or push files using adb, create zips, deodex, etc....

Edit- check this thread- http://xdaforums.com/showthread.php?t=1633333

Thebe?r'$ NeXu$
[Android Software Development] _alex74_:
hey mate ;)

here system apps(S7 MM 6.0.1) needs to be signed only if u do changes in Android Manifest, not need to be flashed, pushed is enough(frame apk must always be flashed)

Data app must be only signed, except one or two last that even not appear in system(parsing error) due to be builded in studio with new protection)

except few cases above, always all working here without need to be signed(apps store only ;) )
[Android Software Development] :
Ough so this means if we use old signature and not modifying manifest it'll still be broken?
[Android Software Development] iBotPeaches:
Before I do any knee-jerk deprecation(s), I will double check everything. I'm under the impression "App Signature v2" is a full application signature, so injecting modified files into the original application will no longer work.
[Android Software Development] :
Oh yeah I read about that. It's good but bad :/
[Android Software Development] DaOldMan:
Looks you are 100% right:

https://source.android.com/security/apksigning/index.html
[Android Software Development] Ticklefish:
I know the OP doesn't like discussion of tools that use apktool here (since an error could be the fault of the tool, not apktool) but I definitely appreciate the shout-out! :good:

So the signature is based on the contents of the APK? Doesn't that mean that any changes will invalidate the signature? That'll mean we can't mod any Nougat system apps at all...:eek:

I hope I've read that wrong.
[Android Software Development] DaOldMan:
No mate. It means every rom will have to disable signature checking. We will need to resign all modded apps. No more transfering resources to original apps....

Phronesis team member
[Android Software Development] :
So even resigning the original apps will be broken :o that sounds bad :/
[Android Software Development] DaOldMan:
Don't think so. As signing is backward compatible we can resign with V1 tools. Rom will accept the apk as valid because we will remod the framework to stop checking for signatures. Should work fine :).
[Android Software Development] Ticklefish:
Google say that signing with the traditional keys will still work, so apps don't have to be updated to work on Nougat.

Although that doesn't help, thinking about it. You'd stoll have to resign practically the whole system folder, which would be really tedious.

I'm not a big fan of removing signature checking but it does seem to be the best option. Hopefully that's simple enough to do.
[Android Software Development] Thebear j koss:
Someone will find a work around. Just takes a little time. Android N isn't even officially released yet, but someone will work something out. [MENTION=4315551]Ticklefish[/MENTION] I wasn't really meaning to promote your tool, although it is what I use, but for lack of knowing any other tool threads or developers that create their own tools and frequent this thread like you do, it was more of just a nod into something to look at to see if your tool could help make life easier. Besides, you are always helping out here and answering questions whenever possible and always thank Connor and give him total credit which seems to be a rarity these days in the android world.

Thebe?r'$ NeXu$
[Android Software Development] DaOldMan:
Android N is official released. As I said removing signature check will work. No need to resign whole folder, 80% can use old signature and modded ones will use ours in V1. Problem solved ;). The mod for signature check was easy until now, lets hope Google will not complicate it too much.
[Android Software Development] Thebear j koss:
I understood you, and when did N officially drop? I just got an update from Google 3 days ago and it was still MM. I know N is close, but i haven't seen anything official released yet anywhere. Last I saw there were only preview builds available... I know signature verification is a workaround, but ATM resigning certain apps particularly google apps breaks them, and apps that use location services break as well. I haven't been as involved as i once was, but as far as I know most have been keeping original signatures in the apps they have modified. I rarely see any signed apps anymore...

Thebe?r'$ NeXu$
[Android Software Development] :
You missed that xperia M got a build from source too I guess.

It was out officially like 5 days ago I assume.
[Android Software Development] Ticklefish:
That's my hope... :eek:

I was thinking about this while driving to work this morning (and while watching the road...honest!). The new signature is based on the contents of the APK. So, if the APK is modded, the signature won't match and the app won't install. Presumably then the signature is unique to every APK file. I'm guessing we should be able to just re-sign an APK file the new way and it should install.

Previously, in v1, the signature had to be the same on all system apps. So...maybe we won't need to remove the signature check after all?

I'm guessing here. I haven't got a Nougat rom to play with and this is a bit out of my skillset..;(
[Android Software Development] iBotPeaches:
Yes, since it is a full contents signature any modification and/or additional will invalidate the hash. The signature will be unique, but will be block based vs jar based, so you might think you could simply remove the v2 signature block (In order to default it back to v1), but that will not work via the quote below.

You can see from the image (Source: https://source.android.com/security/apksigning/index.html) and more docs (https://source.android.com/security/apksigning/v2.html#verification) that this will mainly only be efficient on Nougat forward, but seems to be strong at what it does.
[Android Software Development] piquadrat:
Hello,

I can't build gmail app (starting with 6.7.xx version) with latest apktool. Decoding works ok (well... at least no errors reported) but building results with a bunch of errors:

AndroidManifest.xml:50: error: No resource identifier found for attribute 'networkSecurityConfig' in package 'android'
AndroidManifest.xml:50: error: No resource identifier found for attribute 'resizeableActivity' in package 'android'

and then a few errors caused by above I suppose:

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1):

I'm not an expert in this tool by any means. Use it sometime to lessen some security around gmail for working correctly with 3rd party widgets. As far as I can understand this there is a problem with framework. I've always used a build in framework with gmail without any problems. Apparently not anymore. Any help would be appreciated.
[Android Software Development] Ticklefish:
Presumably we can't v2 sign a file ourselves? That would make things a lot simpler but life is never that fair...

Have you installed any framework files before you decompiled?
[Android Software Development] piquadrat:
No I haven't. Is it required for gmail (not firmware- or device-specific app)? Are you able to replicate this problem?

Just decompile and recompile the app without any changes. The problem should manifest itself.
[Android Software Development] Thebear j koss:
Gmail can't be modified. Nor google plus, play music, google messenger, etc. Most goggle apps either don't recompile or break afterwards...

Thebe?r'$ NeXu$
[Android Software Development] piquadrat:
Certainly it was possible to modify gmail as I've done this many many times. I was using apktool for de- and recompiling and then I was manually inserting keys to allow gmail to run (the whole procedure I described here). apktool worked ok until ver. 6.6.126913422. All above gives me aforementioned problems.

It looks like some framework insufficiency so I wrote here to much more experienced users.
[Android Software Development] Thebear j koss:
Sorry, yes you ate correct. It is if you change anything in resources that it breaks... Other modifjcations that don't touch resources i guess work fine. Hasn't been a themed Gmail in probably 2 years now...

Thebe?r'$ NeXu$
[Android Software Development] Phone_Guru:
I've themed every gmail version without problems. You simply need to remove that error line from the manifest.
[Android Software Development] Thebear j koss:
Last working themed gmail i have seen is 4.5.2, no 1 has released a themed gmail since. If you have a workaround there are plenty of people i know that would love to know your secret...

Thebe?r'$ NeXu$
[Android Software Development] Phone_Guru:
I'd you look at my theme thread you'll see my themed gmail, it's red and black
[Android Software Development] Thebear j koss:
By your theme, you are not theming gmail as a standalone app, you are theming it through theme engine or substratum? Completely different than theming GMail and installing or flashing it.

Thebe?r'$ NeXu$
[Android Software Development] llohcyoing:
sorry...i know...im stupid....

i'm here http://code.google.com/p/android-apktool/

i've dowloaded apktool install for linux

inside there are 2 file

-apktool

-aapt

i've delete aapt

i've move apktool in usr/local/bin

i've d/l apktool 1.5.0.jar (renamed in apktool.jar)

i've d/l aapt from op

i've move these 2 file to usr/local/bin

reboot PC

apktool if framework-res.apk

apktool d framework-res.apk (work)

apktool b framework-res (error)

what im wrong?
[Android Software Development] cowsquad:
What ROM are you using?
[Android Software Development] iBotPeaches:
Run these commands EXACT, and post the outputs.

cd ~

aapt v

apktool

Post all of that output. It should be near 100 lines. Post it into pastebin please. Off to class. I'll be back in a few hours.