question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decompile and recompile issue

See original GitHub issue

Apktool Latest OS is linux

Believe it or not , if i decompile an apk and try to recompile it again without any changes in code it fails .

I try using a twitter apk file . I will leave here the link : https://www.mediafire.com/file/82w10791m4xrjaf/Twitter.apk/file

You can decompile it , but you are unable to recompile it again even if no changes were made in the code . Update , forgot to write the logs , here they are :

The log :

----------------------------------Decompiling log--------------------------
I: Using Apktool 2.4.1 on twitter.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/.local/share/apktool/framework/1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=resource, value=0x7e010000
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling classes5.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
---------------------------------------------------------------------------
Recompiling log : 
I: Using Apktool 2.4.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes4 folder into classes4.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes5 folder into classes5.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /opt/testapk/twitter/AndroidManifest.xml:831: error: Error: No resource type specified (at 'resource' with value '@2113994752').
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_12790044432587942505.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 30, --version-code, 28820000, --version-name, 8.82.0-release.00, --no-version-vectors, -F, /tmp/APKTOOL4379167829085885196.tmp, -e, /tmp/APKTOOL8538338056184325237.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /opt/testapk/twitter/res, -M, /opt/testapk/twitter/AndroidManifest.xml]|

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
peterptcommented, Feb 26, 2021

Best way to check if any changes can be made in an apk is , decompile and try to recompile , if recompile fails without any changes in the code of apk then apktool will never be able to recompile that apk no matter what you do . I used in twitter.apk the 2.4.1 version but 2.5.0 was also giving the same issues , so the log is from 2.4.1 .

1reaction
harshitshah4commented, Mar 14, 2022

@iBotPeaches can we do something to help you on this issue ? Is it planned to be fixed in the next version or any upcoming versions ? Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Decompile JAR, Modify it, Recompile again? - Stack Overflow
Decompilation is often inaccurate. There is no guarantee that the Java code that it produces is a correct representation of the original class....
Read more >
Decompiling/Recompiling to fix a real issue – It's been a while!
The statement begins with a 'label' (starting with 'IL_' and ending with a colon); one golden rule to remember here is not to...
Read more >
What are the problems with a "recompiler", a program ... - Reddit
What are the problems with a "recompiler", a program that can decompile a binary and recompile it differently? ... I've asked a few...
Read more >
Why is it so hard to recompile decompiled code? - Quora
You loose any “named” reference, yes the name of a function, variable, class variable, class method, or whatever is lost, at compiler level...
Read more >
Decompile Your Microsoft Access Database to Improve ...
Open up any module. Compile it via Debug, Compile.., then File, Save. Go back to the database and Compact it. The location of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found