Obfuscated apk decompile/recompile toolThis tool is modified from "iBotPeaches/apktool" to handle resource obfuscated(by ResGuard or any) apps like Wechat, Tiktok, MT Manager ...
About
Renaming
Illegal name like "r/e/a_.xml" -> "res/layout/layout_01ab.xml"
Names containing non latin characters
For stripped file extension names, it guesses from file magic and data patterns
Ignores unique un-obfuscated names
Decompiling
Handles apktool known issues of "Invalid chunk type ***"
Merges splitted apk files
Compiling
The builtin aapt/aapt2 can handle "illegal java class names" (for linux only)
How to use
All commands are the same as apktool
For splitted apk files pass the directory path containing your apk files and rename the main apk to "base.apk"
example: java -jar kikfox.jar "d" "-p" "/home/user/framework" "-o" "/home/user/tiktok_decompiled" "/home/user/tiktok_splits"
Update 2.6.1
Handles multiple packages
Smart refactoring the obfuscated names will be renamed to more meaningful names like:
☆Color, Integer, Strings ... renaming is based on value e.g. #FFC0CB -> @ color/pink_ffc0 , 《No connection tap again to retry》-> @ string/no_connection_tap_again
☆ Layout & xml names is based on the root tag name e.g. if you have xml with <LinearLayout ...> then the resource name will be @ layout/linearLayout_12ab , or <paths ...> to @ xml/xml_paths_123
☆Other known variables from apk info, e.g. in AndroidManifest.xml android:icon is for app icon so the corresponding resource name will be @ drawable/app_icon
DownloadsV 2.4.0
Attachement
Github
Mega.nz
V 2.6.1
Github
UPDATE-1 (2.5.0-BETA)
I just released a new version on github
Whats new?
Smart refactoring *
works great. Do you plan an upgrade to 2.50 ?
[email protected] said:
works great. Do you plan an upgrade to 2.50 ?
Click to expand...
Click to collapse
As of today I didn't find out any problem with the current version , I decompiled as many obfuscated apks as i can and works for all. Currently I am working to combine features of Apktool+JADX+Smali/Baksmali to deobfuscate the java code.
If you find any bugs or apk which this tool fails to decompile, please share with me.
Thanks
Nice work!
Might sounds weird question, but do you plan to do pull requests on official apktool so iBotPeaches can handle updates with these features? maybe this will be huge benefit for everyone and iBotPeaches will be able to understand deobfuscation and merging apk a lot more, as it seems like he is struggling with it
evildog1 said:
Nice work!
Might sounds weird question, but do you plan to do pull requests on official apktool so iBotPeaches can handle updates with these features? maybe this will be huge benefit for everyone and iBotPeaches will be able to understand deobfuscation and merging apk a lot more, as it seems like he is struggling with it
Click to expand...
Click to collapse
I tried but seems like they are not interested in deobfuscation part (maybe they are working on "obfuscation" too ? ). Every apktool update is going away from handling obfuscated apk. I don't know why but a massive crowd want to silence the techniques of deobfuscation.
kikfox said:
I tried but seems like they are not interested in deobfuscation part (maybe they are working on "obfuscation" too ? ). Every apktool update is going away from handling obfuscated apk. I don't know why but a massive crowd want to silence the techniques of deobfuscation.
Click to expand...
Click to collapse
Oh i see.
Now I remember someone told me iBot work with AndResGuard which is why there is no fix to apktool, but i'm still not sure if he said was true.
I think Apktool is simply the ground work, from there you can take it where you want :')
News
New java based resource builder is coming.
☆ This tool is totally independent of aapt and aapt2.
☆ Can parse standard xml files under "res" directory and convert to binary "ARSC" file
Good job
A new java based ARSCTool is released.
Converts android resources.arsc to xml and build back to .arsc file
https://github.com/kikfox/ARSCTool
NEW version 2.6.2 released
https://github.com/kikfox/kikfox/releases/tag/v2.6.2
kikfox said:
NEW version 2.6.2 released
https://github.com/kikfox/kikfox/releases/tag/v2.6.2
Click to expand...
Click to collapse
kikfox-2.6.2.jar works fine on Macbook, but unable to decompile the r (resguard?) folder on Windows 10 PC.
Code:
I: Decoding resources ...
I: Decoding file-resources packages count=1 ....
I: Decoding file-resources PKG=com.xiaojie.tv
I: 1/548 'app.apk : r/k/da.9.png' -> 'drawable-xhdpi\abc_scrubber_primary_mtrl_alpha'
S: Could not decode file, replacing by FALSE value: r/k/da.9.png
S: Could not decode file, replacing by FALSE value: r/w/at.xml
S: Could not decode file, replacing by FALSE value: r/p/a.xml
S: Could not decode file, replacing by FALSE value: r/h/c7.xml
S: Could not decode file, replacing by FALSE value: r/k/ci.png
I: 548/548 'app.apk : r/p/a.xml' -> 'animator-v21\lb_onboarding_logo_enter'
S: Could not decode file, replacing by FALSE value: r/p/a.xml
I: Decoding values */* XMLs...
I: Decoding [59] value files from: com.xiaojie.tv
I: 1/59 values-v25\styles.xml
I: 59/59 values-v22\styles.xml
I: DONE decoding resources
a452388 said:
kikfox-2.6.2.jar works fine on Macbook, but unable to decompile the r (resguard?) folder on Windows 10 PC.
Code:
I: Decoding resources ...
I: Decoding file-resources packages count=1 ....
I: Decoding file-resources PKG=com.xiaojie.tv
I: 1/548 'app.apk : r/k/da.9.png' -> 'drawable-xhdpi\abc_scrubber_primary_mtrl_alpha'
S: Could not decode file, replacing by FALSE value: r/k/da.9.png
S: Could not decode file, replacing by FALSE value: r/w/at.xml
S: Could not decode file, replacing by FALSE value: r/p/a.xml
S: Could not decode file, replacing by FALSE value: r/h/c7.xml
S: Could not decode file, replacing by FALSE value: r/k/ci.png
I: 548/548 'app.apk : r/p/a.xml' -> 'animator-v21\lb_onboarding_logo_enter'
S: Could not decode file, replacing by FALSE value: r/p/a.xml
I: Decoding values */* XMLs...
I: Decoding [59] value files from: com.xiaojie.tv
I: 1/59 values-v25\styles.xml
I: 59/59 values-v22\styles.xml
I: DONE decoding resources
Click to expand...
Click to collapse
Hello,
I didn't test it on windows pc, if you are sure works on mac the problem could be some where in the code, mis using file separator character. For linux&mac '/' for windows '\'.
I will fix it on the next version
kikfox said:
Hello,
I didn't test it on windows pc, if you are sure works on mac the problem could be some where in the code, mis using file separator character. For linux&mac '/' for windows '\'.
I will fix it on the next version
Click to expand...
Click to collapse
FileDirectory.java, fix file separator and ensure parent dirs. Now it works.
Java:
protected OutputStream getFileOutputLocal(String name) throws DirectoryException {
try {
return new FileOutputStream(fileEnsuredDirs(generatePath(name)));
} catch (FileNotFoundException e) {
throw new DirectoryException(e);
}
}
private File fileEnsuredDirs(String path) {
File file = new File(path);
File parent = file.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
return file;
}
private String generatePath(String name) {
return getmDir().getPath() + File.separator + name;
}
a452388 said:
FileDirectory.java, fix file separator and ensure parent dirs. Now it works.
Java:
protected OutputStream getFileOutputLocal(String name) throws DirectoryException {
try {
return new FileOutputStream(fileEnsuredDirs(generatePath(name)));
} catch (FileNotFoundException e) {
throw new DirectoryException(e);
}
}
private File fileEnsuredDirs(String path) {
File file = new File(path);
File parent = file.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
return file;
}
private String generatePath(String name) {
return getmDir().getPath() + File.separator + name;
}
Click to expand...
Click to collapse
Exactly,
Glad to hear from someone with good understanding
Maybe you will be much interested in : github.com/REAndroid/ARSCLib
a452388 said:
FileDirectory.java, fix file separator and ensure parent dirs. Now it works.
Java:
protected OutputStream getFileOutputLocal(String name) throws DirectoryException {
try {
return new FileOutputStream(fileEnsuredDirs(generatePath(name)));
} catch (FileNotFoundException e) {
throw new DirectoryException(e);
}
}
private File fileEnsuredDirs(String path) {
File file = new File(path);
File parent = file.getParentFile();
if (!parent.exists()) {
parent.mkdirs();
}
return file;
}
private String generatePath(String name) {
return getmDir().getPath() + File.separator + name;
}
Click to expand...
Click to collapse
kikfox said:
Exactly,
Glad to hear from someone with good understanding
Maybe you will be much interested in : github.com/REAndroid/ARSCLib
Click to expand...
Click to collapse
And there's another bug, kikfox can not handle the '.jar' Android library. And the fix:
Code:
// ApkDecoder.java
// Do not do refactor if no resources
private void refactorResources() throws AndrolibException {
if (!this.mNoRefactor && (this.hasResources() || this.hasManifest())) {
ResTable resTable = this.getResTable();
ResRefactor resRefactor = new ResRefactor(this.mApkFileList, resTable, this.mRefactorFile);
resRefactor.refactorAll();
}
}
// Androlib.java
// resTable can be null
public void decodeUnknownFiles(ApkFile apkFile, File outDir, ResTable resTable) throws AndrolibException {
Set<ResResource> allFiles = resTable != null ? resTable.listSourceFiles(apkFile.getName()) : Collections.emptySet();
LOGGER.info("Copying unknown files '" + apkFile.getName() + "'");
File unknownOut = new File(outDir, "unknown");
...
}
// ApkFileList.java
// add '.jar' as ApkFile
private static boolean isApkFile(File file) {
if (file != null && file.isFile()) {
String name = file.getName();
name = name.toLowerCase();
return name.endsWith(".apk") || name.endsWith(".jar");
} else {
return false;
}
}
a452388 said:
And there's another bug, kikfox can not handle the '.jar' Android library. And the fix:
Code:
// ApkDecoder.java
// Do not do refactor if no resources
private void refactorResources() throws AndrolibException {
if (!this.mNoRefactor && (this.hasResources() || this.hasManifest())) {
ResTable resTable = this.getResTable();
ResRefactor resRefactor = new ResRefactor(this.mApkFileList, resTable, this.mRefactorFile);
resRefactor.refactorAll();
}
}
// Androlib.java
// resTable can be null
public void decodeUnknownFiles(ApkFile apkFile, File outDir, ResTable resTable) throws AndrolibException {
Set<ResResource> allFiles = resTable != null ? resTable.listSourceFiles(apkFile.getName()) : Collections.emptySet();
LOGGER.info("Copying unknown files '" + apkFile.getName() + "'");
File unknownOut = new File(outDir, "unknown");
...
}
// ApkFileList.java
// add '.jar' as ApkFile
private static boolean isApkFile(File file) {
if (file != null && file.isFile()) {
String name = file.getName();
name = name.toLowerCase();
return name.endsWith(".apk") || name.endsWith(".jar");
} else {
return false;
}
}
Click to expand...
Click to collapse
You are so good!
For
Code:
isApkFile
you are right it is a bug.
I am aware it will fail at no resource scenario, because my tool is aimed to handle "RESOURCE" obfuscated apks with some functionality which apktool lacks, NOT to replace apktool.
BTW:
I am going to abandon this tool working on a new tool :
1. Independent of apktool & aapt/aapt2
2. Integrated with smali/baksmali to refactor java classes
3. Proto <-> Binary resources (arsc)
Thank you again
GREAT
Related
hi,
i want to get data from a specified directory. how to write it???
PS: i use win32
Which File?
Use an opendialogbox to select it first, then ReadFile() to get the data.
Code:
// Variables required
OPENFILENAME ofn; // File dialog box structure
HANDLE hFile; // File Load/Save handle
TCHAR szFile[MAX_PATH] = TEXT("\0");
// Respond to your 'Open' menu item
case ID_MENU_OPEN: // Depends on the value the Menu creator has given it, or what you have changed it to.
memset(&(ofn), 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hWnd;
ofn.lpstrFile = szFile;
ofn.nMaxFileTitle = MAX_PATH;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrFilter = TEXT("Text Files\0*.TXT\0"); // Set filter here if required
ofn.lpstrTitle = TEXT("Open File");
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST;
if (GetOpenFileName(&ofn))
{
hFile=CreateFile(szFile,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,NULL);
if(hFile == INVALID_HANDLE_VALUE)
{
//Error!!!! Do something
}
else
{
// Use function ReadFile() here using file handle hFile to read your data.
// What you do here depends on the file structure.
// If it is binary data read a block/record at a time into a buffer/structure,
// If it is CR/LF delimited text read it a byte at a time and transfer it into another text buffer. Parse for the CR/LF end of line then do whatever with it.
CloseHandle(hFile);
}
Saving is the same as the above but instead use
Code:
ofn.Flags = OFN_EXPLORER | OFN_OVERWRITEPROMPT;
hFile=CreateFile(szFile,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
and WriteFile() to save the data.
While trying to find any hidden features Samsung may have kept hidden in the stock ROM for my Galaxy Ace II X (GT-S7560M), I found some smali code for the lockscreen options, that removed the option to toggle the ripple effect! If you don`t know what the ripple effect is, view this video. It replaces the stock Samsung slide unlock with what looks like a body of water. When you touch the screen, it makes a ripple in the water. Anyways, on to the mod.
I do not know if this mod will work on other Samsung ICS ROMs. All this mod does is make the option appear, by deleting a line of code (that makes the toggle not there). You can be on either an odexed or deodexed ROM, but the SecSettings.apk should be from a deodexed ROM, to make the process a lot easier. You can reodex the SecSettings.apk easily using this app. I`m assuming that you know the basics of decompiling and recompiling .apk files. I am in no way responsible for any damage done to your hardware. Let`s start:
--> Decompile SecSettings.apk (I use apktool)
--> Navigate to /smali/com/android/settings
--> Open LockScreenSettings.smali with your preferred text editor (I use Notepad++)
--> Search `mRippleEffect`, and search until you find the line with `mRippleEffect` that is above a line with the phrase `removePreference` in it.
--> Remove 4 lines - that `removePreference` line, and the 3 lines above it.
--> Save, recompile, push to /system/app/.
--> Decompile framework-res.apk
--> Navigate to /res/values
--> Open bools.xml
--> Search `config_isWaterRippleEnabled`
--> Change value from `false` to `true`
--> Save, recompile, push to /system/framework/
--> Change the permissions to 0644 (rw-r--r--)
--> Reboot, and enjoy!
An example of which lines to remove (taken from my SecSettings.apk, so code may differ slightly):
Code:
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v5
iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mRippleEffect:Landroid/preference/CheckBoxPreference;
invoke-virtual {v5, v8}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
You should find the option to toggle the ripple lockscreen under Security > Lock screen options. Make sure that swipe unlock is enabled so you can access the Lock screen options.
You can also enable some other hidden lockscreen settings (like the Information Ticker, Camera Quick Access, Wakeup Command which requires S Voice, et cetera depending on whether or not Samsung has chosen to include certain features in the ROM. I can`t guarantee that there`ll be no bugs if you`re trying to enable another hidden option) by following this general method (of deleting code that is telling the device to hide the option). If you have any problems, questions, or comments, post them here! If you choose to include this mod in your ROM, please give me some thanks!
Can u tell me what is size of apk u got after recompiling.I got both apk are less in size by 6 mb than stock one.thanks
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
25vikasp said:
Can u tell me what is size of apk u got after recompiling.I got both apk are less in size by 6 mb than stock one.thanks
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
Click to expand...
Click to collapse
There isn't a specific size, but it should be close to the size of the original apk. Have you used apktool before? You have to replace the AndroidManifest.xml and the META-INF folder with the ones from the original apk in this case. Make a backup of your stock ROM in case you get into a bootloop when you push the two modified apks to their respective locations. Set their permissions as rw-r-r (chmod 0644). If you still have problems afterwards, let me know and I'll willingly help you out.
Codename13 said:
There isn't a specific size, but it should be close to the size of the original apk. Have you used apktool before? You have to replace the AndroidManifest.xml and the META-INF folder with the ones from the original apk in this case. Make a backup of your stock ROM in case you get into a bootloop when you push the two modified apks to their respective locations. Set their permissions as rw-r-r (chmod 0644). If you still have problems afterwards, let me know and I'll willingly help you out.
Click to expand...
Click to collapse
I am new to apk tool but I read that tutorials and tried to do that.but I got error at the end when recompiling apk section.even I Got apk modded files then I placed those files to system and framework respectively.I got bootloop after that I recovered it by cwm package .ur codes are present in my smali files as u said so may be I can enable my ripple effects in my s duos.can u suggest any tutorial.I have Windows xp.thanks for ur reply mate
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
25vikasp said:
I am new to apk tool but I read that tutorials and tried to do that.but I got error at the end when recompiling apk section.even I Got apk modded files then I placed those files to system and framework respectively.I got bootloop after that I recovered it by cwm package .ur codes are present in my smali files as u said so may be I can enable my ripple effects in my s duos.can u suggest any tutorial.I have Windows xp.thanks for ur reply mate
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
Click to expand...
Click to collapse
The most important tool in Android development has by far got to be reading error messages/logcat. Paste the complete wall of text from when you recompile with apktool. Also, which apk is the one that're you're having issues with? framework-res.apk or SecSettings.apk? And before you decompile either, you have to "apktool if" (command to install a framework) framework-res.apk and twframework-res.apk (found under /system/framework/), with a path that directs apktool to the apk.
Codename13 said:
The most important tool in Android development has by far got to be reading error messages/logcat. Paste the complete wall of text from when you recompile with apktool. Also, which apk is the one that're you're having issues with? framework-res.apk or SecSettings.apk? And before you decompile either, you have to "apktool if" (command to install a framework) framework-res.apk and twframework-res.apk (found under /system/framework/), with a path that directs apktool to the apk.
Click to expand...
Click to collapse
Ok I will post logcat here thanks.I got problem in both related apk.thanks for reply
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
---------- Post added at 04:01 PM ---------- Previous post was at 03:42 PM ----------
see my logcat for secsettings
C:\Documents and Settings\vikas>apktool
Apktool v1.5.1PR2. - a tool for reengineering Android apk files
Copyright 2010 Ryszard Wi?niewski <[email protected]>
with smali v1.4.1, and baksmali v1.4.1
Updated by @iBotPeaches <[email protected]>
Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]
COMMANDs are:
d[ecode] [OPTS] <file.apk> [<dir>]
Decode <file.apk> to <dir>.
OPTS:
-s, --no-src
Do not decode sources.
-r, --no-res
Do not decode resources.
-d, --debug
Decode in debug mode. Check project page for more info.
-b, --no-debug-info
Baksmali -- don't write out debug info (.local, .param, .line, etc.)
-f, --force
Force delete destination directory.
-t <tag>, --frame-tag <tag>
Try to use framework files tagged by <tag>.
--framework <dir>
Use the specified directory for framework files --keep-broken
-res
Use if there was an error and some resources were dropped, e.g.:
"Invalid config flags detected. Dropping resources", but you
want to decode them anyway, even with errors. You will have to
fix them manually before building.
b[uild] [OPTS] [<app_path>] [<out_file>]
Build an apk from already decoded application located in <app_path>.
It will automatically detect, whether files was changed and perform
needed steps only.
If you omit <app_path> then current directory will be used.
If you omit <out_file> then <app_path>/dist/<name_of_original.apk>
will be used.
OPTS:
-f, --force-all
Skip changes detection and build all files.
-d, --debug
Build in debug mode. Check project page for more info.
if|install-framework <framework.apk> [<tag>]
Install framework file to your system.
For additional info, see: https://github.com/iBotPeaches/Apktool
For smali/baksmali info, see: http://code.google.com/p/smali/
C:\Documents and Settings\vikas>apktool if framework-res.apk
I: Framework installed to: C:\Documents and Settings\vikas\apktool\framework\1.a
pk
C:\Documents and Settings\vikas>apktool b secsettings.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:164)
at brut.androlib.Androlib.build(Androlib.java:181)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:214)
at brut.apktool.Main.main(Main.java:74)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:160)
... 4 more
C:\Documents and Settings\vikas>apktool d secsettings.apk
I: Baksmaling...
I: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Documents and Settings\vikas\apktool\fra
mework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
C:\Documents and Settings\vikas>apktool b secsettings
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'crypt_keeper_button_text' has no default translation in C
:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_component_title' has no default translation in C:\D
ocuments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_settings_summary' has no default translation in C:\
Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_settings_title' has no default translation in C:\Do
cuments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_test' has no default translation in C:\Documents an
d Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_timeout_summary' has no default translation in C:\D
ocuments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_timeout_title' has no default translation in C:\Doc
uments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_timeout_zero_summary' has no default translation in
C:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'system_tutorial_list_item_summary' has no default transla
tion in C:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'system_tutorial_list_item_title' has no default translati
on in C:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'vibrate_title' has no default translation in C:\Documents
and Settings\vikas\secsettings\res; found: es pt
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.an
droid.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas
.android.com/apk/res/android); using existing value in manifest.
I: Building apk file...
C:\Documents and Settings\vikas>
i am giving u links for my original files u can edit it and give me just a request ok mate.i will try until success.thanks
https://www.dropbox.com/s/8pv8wqp32eclebi/SecSettings.apk
https://www.dropbox.com/s/ig48getu8l8w8y3/framework-res.apk
25vikasp said:
Ok I will post logcat here thanks.I got problem in both related apk.thanks for reply
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
---------- Post added at 04:01 PM ---------- Previous post was at 03:42 PM ----------
see my logcat for secsettings
C:\Documents and Settings\vikas>apktool
Apktool v1.5.1PR2. - a tool for reengineering Android apk files
Copyright 2010 Ryszard Wi?niewski <[email protected]>
with smali v1.4.1, and baksmali v1.4.1
Updated by @iBotPeaches <[email protected]>
Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
Usage: apktool [-q|--quiet OR -v|--verbose] COMMAND [...]
COMMANDs are:
d[ecode] [OPTS] <file.apk> [<dir>]
Decode <file.apk> to <dir>.
OPTS:
-s, --no-src
Do not decode sources.
-r, --no-res
Do not decode resources.
-d, --debug
Decode in debug mode. Check project page for more info.
-b, --no-debug-info
Baksmali -- don't write out debug info (.local, .param, .line, etc.)
-f, --force
Force delete destination directory.
-t <tag>, --frame-tag <tag>
Try to use framework files tagged by <tag>.
--framework <dir>
Use the specified directory for framework files --keep-broken
-res
Use if there was an error and some resources were dropped, e.g.:
"Invalid config flags detected. Dropping resources", but you
want to decode them anyway, even with errors. You will have to
fix them manually before building.
b[uild] [OPTS] [<app_path>] [<out_file>]
Build an apk from already decoded application located in <app_path>.
It will automatically detect, whether files was changed and perform
needed steps only.
If you omit <app_path> then current directory will be used.
If you omit <out_file> then <app_path>/dist/<name_of_original.apk>
will be used.
OPTS:
-f, --force-all
Skip changes detection and build all files.
-d, --debug
Build in debug mode. Check project page for more info.
if|install-framework <framework.apk> [<tag>]
Install framework file to your system.
For additional info, see: https://github.com/iBotPeaches/Apktool
For smali/baksmali info, see: http://code.google.com/p/smali/
C:\Documents and Settings\vikas>apktool if framework-res.apk
I: Framework installed to: C:\Documents and Settings\vikas\apktool\framework\1.a
pk
C:\Documents and Settings\vikas>apktool b secsettings.apk
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:164)
at brut.androlib.Androlib.build(Androlib.java:181)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:214)
at brut.apktool.Main.main(Main.java:74)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:160)
... 4 more
C:\Documents and Settings\vikas>apktool d secsettings.apk
I: Baksmaling...
I: Loading resource table...
W: Skipping "android" package group
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Documents and Settings\vikas\apktool\fra
mework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
C:\Documents and Settings\vikas>apktool b secsettings
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'crypt_keeper_button_text' has no default translation in C
:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_component_title' has no default translation in C:\D
ocuments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_settings_summary' has no default translation in C:\
Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_settings_title' has no default translation in C:\Do
cuments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_test' has no default translation in C:\Documents an
d Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_timeout_summary' has no default translation in C:\D
ocuments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_timeout_title' has no default translation in C:\Doc
uments and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'dream_timeout_zero_summary' has no default translation in
C:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'system_tutorial_list_item_summary' has no default transla
tion in C:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'system_tutorial_list_item_title' has no default translati
on in C:\Documents and Settings\vikas\secsettings\res; found: es pt
aapt: warning: string 'vibrate_title' has no default translation in C:\Documents
and Settings\vikas\secsettings\res; found: es pt
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.an
droid.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas
.android.com/apk/res/android); using existing value in manifest.
I: Building apk file...
C:\Documents and Settings\vikas>
i am giving u links for my original files u can edit it and give me just a request ok mate.i will try until success.thanks
https://www.dropbox.com/s/8pv8wqp32eclebi/SecSettings.apk
https://www.dropbox.com/s/ig48getu8l8w8y3/framework-res.apk
Click to expand...
Click to collapse
your problem is your not directing apktool to the settings folder.. use my QuickMod tool to decompile/compile it..
ricky310711 said:
your problem is your not directing apktool to the settings folder.. use my QuickMod tool to decompile/compile it..
Click to expand...
Click to collapse
Oh I would love to try.thanks.any link for that
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
25vikasp said:
Oh I would love to try.thanks.any link for that
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
Click to expand...
Click to collapse
click on my profile and view my threads to find quickmod tool
Hey mate I am using crt effects on off mod by xposed tweaking it is great.is there any way to make it default without xposed framework by modifying apks.
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
ricky310711 said:
click on my profile and view my threads to find quickmod tool
Click to expand...
Click to collapse
25vikasp said:
Oh I would love to try.thanks.any link for that
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
Click to expand...
Click to collapse
Niiiiiiiiiiiiiiiiiiiiiiice got it working on my GT-S7562 :good:
Thank you @ricky310711 for your great tool!! just had to edit two lines of the .bat to get it to sign the compiled apks (/%apk%/)
Thank you @Codename13 for this awesome idea
KlinkOnE said:
Niiiiiiiiiiiiiiiiiiiiiiice got it working on my GT-S7562 :good:
Thank you @ricky310711 for your great tool!! just had to edit two lines of the .bat to get it to sign the compiled apks (/%apk%/)
Thank you @Codename13 for this awesome idea
Click to expand...
Click to collapse
Oh worked.I am very thankful if u post step by step process in short here
Sent from my GT-S7562 modded ics 1.2 ghz using Tapatalk 2
followed instructions given
you got to edit the .bat of modtool to get the apks signed
it is explained in a post in the modtool thread search for /%apk%/
as i am lazy i put the signed apks in the zip of pmp_u_5.7.4 update package (replaced them)
installed through cwm et voila now it ripples
can explain more when back home
Sent from my GT-S7562 using xda app-developers app
works with galaxy s duos.thanks for quicktool
Sir if i permission Framework is dangerous because its going to bootloop my celpphone can u help me how to do that to avoid bootloop why changed permission the framework.
marvin14 said:
Sir if i permission Framework is dangerous because its going to bootloop my celpphone can u help me how to do that to avoid bootloop why changed permission the framework.
Click to expand...
Click to collapse
While changing bools nothing will happen to bootloop the device incase backup the Rom or make a flashable original framework
Sent from my GT-S7562 using xda app-developers app
A bit help........
Hey, trying hard to port CM 11 to Galaxy S Duos. Just need the Network working and dual-SIM... Further details are HERE. JUST take a look
@Codename13 So I'm trying to re-enable it with a GT S7560M like you have, however, when opening LockScreenSettings.smali, there are no instances of mRippleEffect in the file. I'm using this method of extracting the files from the APK, what am I doing wrong?
Team Fail said:
@Codename13 So I'm trying to re-enable it with a GT S7560M like you have, however, when opening LockScreenSettings.smali, there are no instances of mRippleEffect in the file. I'm using this method of extracting the files from the APK, what am I doing wrong?
Click to expand...
Click to collapse
A. Where'd you get the files from? Mod Pack II X has this already, so if the files are from there then that's why you can't find mRippleEffect instances.
B. Did you properly import the framework-res and the twframework-res with the decompiler tool?
Codename13 said:
A. Where'd you get the files from? Mod Pack II X has this already, so if the files are from there then that's why you can't find mRippleEffect instances.
B. Did you properly import the framework-res and the twframework-res with the decompiler tool?
Click to expand...
Click to collapse
A. I took the files directly from my phone. I'm on stock, without Mod Pack II X installed.
B. The instructions there said the TW framework to import was "framework_Res.apk", however it's different on my device (framework-res.apk) so I didn't. I'll try importing that one and re-decompile it and see how it goes.
I will just leave this here. :good:
Python:
Code:
#!/usr/bin/env python
""" decrypt12.py: Decrypts WhatsApp msgstore.db.crypt12 files. """
""" Requires pycrypto and pycryptodome packages. """
__author__ = 'TripCode'
__copyright__ = 'Copyright (C) 2016'
__license__ = 'GPLv3'
__status__ = 'Production'
__version__ = '1.0'
from Crypto.Cipher import AES
import os
import sys
import zlib
def keyfile(kf):
global t1, key
if os.path.isfile(kf) == False:
quit('The specified input key file does not exist.')
elif os.path.getsize(kf) != 158:
quit('The specified input key file is invalid.')
with open(kf, 'rb') as keyfile:
keyfile.seek(30)
t1 = keyfile.read(32)
keyfile.seek(126)
key = keyfile.read(32)
return True
def decrypt12(cf, of):
global t2, iv
if os.path.isfile(cf) == False:
quit('The specified input crypt12 file does not exist.')
tf = cf+'.tmp'
with open(cf, 'rb') as crypt12:
crypt12.seek(3)
t2 = crypt12.read(32)
if t1 != t2:
quit('Key file mismatch or crypt12 file is corrupt.')
crypt12.seek(51)
iv = crypt12.read(16)
crypt12.seek(67)
primer(tf, crypt12, 20)
cipher = AES.new(key, AES.MODE_GCM, iv)
sqlite = zlib.decompress(cipher.decrypt(open(tf, 'rb').read()))
with open(of, 'wb') as msgstore:
msgstore.write(sqlite)
msgstore.close()
os.remove(tf)
return True
def primer(tf, crypt12, sb):
with open(tf, 'wb') as header:
header.write(crypt12.read())
header.close()
with open(tf, 'rb+') as footer:
footer.seek(-sb, os.SEEK_END)
footer.truncate()
footer.close()
def validate(ms):
with open(ms, 'rb') as msgstore:
if msgstore.read(6).decode('ascii').lower() != 'sqlite':
os.remove(ms)
msg = 'Decryption of crypt12 file has failed.'
else:
msg = 'Decryption of crypt12 file was successful.'
msgstore.close()
quit(msg)
def main():
if len(sys.argv) > 2 and len(sys.argv) < 5:
if len(sys.argv) == 3:
outfile = 'msgstore.db'
else:
outfile = sys.argv[3]
if keyfile(sys.argv[1]) and decrypt12(sys.argv[2], outfile):
validate(outfile)
else:
print('\nWhatsApp Crypt12 Database Decrypter '+__version__+' '+__copyright__+' by '+__author__+'\n')
print('\tUsage: python '+str(sys.argv[0])+' key msgstore.db.crypt12 msgstore.db\n')
if __name__ == "__main__":
main()
Code:
Usage: python decrypt12.py key msgstore.db.crypt12 msgstore.db
Java:
Code:
package decrypt12;
/*
*
*** decrypt12.jar: Decrypts WhatsApp msgstore.db.crypt12 files. ***
*
* Author : TripCode
* Copyright : Copyright (C) 2016
* License : GPLv3
* Status : Production
* Version : 1.0
*
*/
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.security.Security;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
// import org.spongycastle.jce.provider.BouncyCastleProvider; // Android
public class decrypt12 {
static {
Security.insertProviderAt(new org.bouncycastle.jce.provider.BouncyCastleProvider(), 1);
// Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1); // Android
}
public static void decrypt(String KeyFile, String C12File, String SQLFile) throws Exception {
final File tempFile = new File(System.getProperty("java.io.tmpdir") + "/"
+ (int) (System.currentTimeMillis() / 1000L) + "-msgstore.enc");
if (!new File(KeyFile).isFile())
quit("The specified input key file does not exist.");
else if (new File(KeyFile).length() != 158)
quit("The specified input key file is invalid.");
else if (!new File(C12File).isFile())
quit("The specified input crypt12 file does not exist.");
InputStream KeyIn = new FileInputStream(KeyFile);
InputStream WdbIn = new BufferedInputStream(new FileInputStream(C12File));
byte[] KeyData = new byte[158];
KeyIn.read(KeyData);
byte[] T1 = new byte[32];
System.arraycopy(KeyData, 30, T1, 0, 32);
byte[] KEY = new byte[32];
System.arraycopy(KeyData, 126, KEY, 0, 32);
KeyIn.close();
byte[] C12Data = new byte[67];
WdbIn.read(C12Data);
byte[] T2 = new byte[32];
System.arraycopy(C12Data, 3, T2, 0, 32);
byte[] IV = new byte[16];
System.arraycopy(C12Data, 51, IV, 0, 16);
if (!new String(T1, 0, T1.length, "ASCII").equals(new String(T2, 0, T2.length, "ASCII")))
quit("Key file mismatch or crypt12 file is corrupt.");
int InputLength = WdbIn.available();
RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
byte[] tempBuffer = new byte[1024];
int I;
while ((I = WdbIn.read(tempBuffer)) != -1)
raf.write(tempBuffer, 0, I);
raf.setLength(InputLength - 20);
raf.close();
WdbIn.close();
InputStream PdbSt = new BufferedInputStream(new FileInputStream(tempFile));
Cipher cipher;
Security.addProvider(new BouncyCastleProvider());
cipher = Cipher.getInstance("AES/GCM/NoPadding", "BC"); // BouncyCastle
// cipher = Cipher.getInstance("AES/GCM/NoPadding", "SC"); // SpongyCastle (Android)
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
CipherInputStream CipherStream = new CipherInputStream(PdbSt, cipher);
InflaterInputStream CryptOutput = new InflaterInputStream(CipherStream, new Inflater(false));
try {
FileOutputStream InflateBuffer = new FileOutputStream(SQLFile);
int N = 0;
byte[] CryptBuffer = new byte[8192];
while ((N = CryptOutput.read(CryptBuffer)) != -1) {
InflateBuffer.write(CryptBuffer, 0, N);
}
InflateBuffer.close();
} catch (IOException ex) {
quit("Fatal error:" + ex);
}
CipherStream.close();
tempFile.delete();
InputStream SqlDB = new FileInputStream(SQLFile);
byte[] SqlData = new byte[6];
SqlDB.read(SqlData);
byte[] MS = new byte[6];
System.arraycopy(SqlData, 0, MS, 0, 6);
SqlDB.close();
if (!new String(MS, 0, MS.length, "ASCII").toLowerCase().equals("sqlite")) {
new File(SQLFile).delete();
quit("Decryption of crypt12 file has failed.");
}
else
quit("Decryption of crypt12 file was successful.");
}
private static void quit(String Msg) {
System.out.println(Msg);
System.exit(0);
}
public static void main(String[] args) throws Exception {
String outFile;
if (args.length > 1 && args.length < 4) {
if (args.length == 3)
outFile = args[2];
else
outFile = "msgstore.db";
decrypt(args[0], args[1], outFile);
} else {
System.out.println("\nWhatsApp Crypt12 Database Decrypter 1.0 Copyright (C) 2016 by TripCode");
System.out.println("\tUsage: java -jar decrypt12.jar key msgstore.db.crypt12 msgstore.db\n");
}
}
}
Code:
Usage: java -jar decrypt12.jar key msgstore.db.crypt12 msgstore.db
GitHub Repository: WhatsApp-Crypt12-Decrypter
Just a quick question: My phone was swapped by a repair shop and the other person who got my phone didn't realize this at first. She did a factory reset, and probably installed Whatsapp with her SIM card before I got my phone back. I'm so angry right now...
I guess my key file is gone - either deleted by the factory reset or overwritten with her Whatsapp's key file. I have several backups of the Whatsapp directory and still the same Google account, IMEI and phone number. Can I restore my messages or are any attempts futile?
(I see that the code asks for a key file, so if I cannot get it/extract it somewhere, there is probably no chance anymore?)
hi, realy great tool
with that i could open the msgstore.db and see my chats
but is it possible to convert this file into a .db.crypt12 file or something like that, so i can open it with whatsapp an have my chats back?
or are there other ways, i can use this msgstore.db + wa.db to recover the chats?
Hi!
I have a crypt12 database but no key...is there anyone out there able to decrypt it?
How much will it cost to me to do this? Can anyone do it for me?
Is the code written here above working in decrypting a crypt12 database?
I don't want to root or install any spyware, just trying to decrypt the file.
anyone interested in trying?
Please write dawn here if you're interested and we'll get in contact...
ettorebonfanti said:
Hi!
I have a crypt12 database but no key...is there anyone out there able to decrypt it?
How much will it cost to me to do this? Can anyone do it for me?
Is the code written here above working in decrypting a crypt12 database?
I don't want to root or install any spyware, just trying to decrypt the file.
anyone interested in trying?
Please write dawn here if you're interested and we'll get in contact...
Click to expand...
Click to collapse
There is a program out there which claims to obtain the key file without root. If it's still working today, I don't know. Here: https://forum.xda-developers.com/showthread.php?t=2770982
If you want the key file, it's better to root your phone and get it. It's not that hard. You can even unroot your phone after catching the key.
And no, someone can't just decrypt the database, because the key is there for a reason, and this reason is security.
Excellent! Just used this to fix a Whatapp DB.
---------- Post added at 10:57 AM ---------- Previous post was at 10:50 AM ----------
This is great thanks! How do I encrypt the database again with crypt12?
I have both, the DB and the key.
TripCode said:
I will just leave this here. :good:
Python:
Code:
#!/usr/bin/env python
""" decrypt12.py: Decrypts WhatsApp msgstore.db.crypt12 files. """
""" Requires pycrypto and pycryptodome packages. """
__author__ = 'TripCode'
__copyright__ = 'Copyright (C) 2016'
__license__ = 'GPLv3'
__status__ = 'Production'
__version__ = '1.0'
from Crypto.Cipher import AES
import os
import sys
import zlib
def keyfile(kf):
global t1, key
if os.path.isfile(kf) == False:
quit('The specified input key file does not exist.')
elif os.path.getsize(kf) != 158:
quit('The specified input key file is invalid.')
with open(kf, 'rb') as keyfile:
keyfile.seek(30)
t1 = keyfile.read(32)
keyfile.seek(126)
key = keyfile.read(32)
return True
def decrypt12(cf, of):
global t2, iv
if os.path.isfile(cf) == False:
quit('The specified input crypt12 file does not exist.')
tf = cf+'.tmp'
with open(cf, 'rb') as crypt12:
crypt12.seek(3)
t2 = crypt12.read(32)
if t1 != t2:
quit('Key file mismatch or crypt12 file is corrupt.')
crypt12.seek(51)
iv = crypt12.read(16)
crypt12.seek(67)
primer(tf, crypt12, 20)
cipher = AES.new(key, AES.MODE_GCM, iv)
sqlite = zlib.decompress(cipher.decrypt(open(tf, 'rb').read()))
with open(of, 'wb') as msgstore:
msgstore.write(sqlite)
msgstore.close()
os.remove(tf)
return True
def primer(tf, crypt12, sb):
with open(tf, 'wb') as header:
header.write(crypt12.read())
header.close()
with open(tf, 'rb+') as footer:
footer.seek(-sb, os.SEEK_END)
footer.truncate()
footer.close()
def validate(ms):
with open(ms, 'rb') as msgstore:
if msgstore.read(6).decode('ascii').lower() != 'sqlite':
os.remove(ms)
msg = 'Decryption of crypt12 file has failed.'
else:
msg = 'Decryption of crypt12 file was successful.'
msgstore.close()
quit(msg)
def main():
if len(sys.argv) > 2 and len(sys.argv) < 5:
if len(sys.argv) == 3:
outfile = 'msgstore.db'
else:
outfile = sys.argv[3]
if keyfile(sys.argv[1]) and decrypt12(sys.argv[2], outfile):
validate(outfile)
else:
print('\nWhatsApp Crypt12 Database Decrypter '+__version__+' '+__copyright__+' by '+__author__+'\n')
print('\tUsage: python '+str(sys.argv[0])+' key msgstore.db.crypt12 msgstore.db\n')
if __name__ == "__main__":
main()
Code:
Usage: python decrypt12.py key msgstore.db.crypt12 msgstore.db
Java:
Code:
package decrypt12;
/*
*
*** decrypt12.jar: Decrypts WhatsApp msgstore.db.crypt12 files. ***
*
* Author : TripCode
* Copyright : Copyright (C) 2016
* License : GPLv3
* Status : Production
* Version : 1.0
*
*/
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.security.Security;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
// import org.spongycastle.jce.provider.BouncyCastleProvider; // Android
public class decrypt12 {
static {
Security.insertProviderAt(new org.bouncycastle.jce.provider.BouncyCastleProvider(), 1);
// Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1); // Android
}
public static void decrypt(String KeyFile, String C12File, String SQLFile) throws Exception {
final File tempFile = new File(System.getProperty("java.io.tmpdir") + "/"
+ (int) (System.currentTimeMillis() / 1000L) + "-msgstore.enc");
if (!new File(KeyFile).isFile())
quit("The specified input key file does not exist.");
else if (new File(KeyFile).length() != 158)
quit("The specified input key file is invalid.");
else if (!new File(C12File).isFile())
quit("The specified input crypt12 file does not exist.");
InputStream KeyIn = new FileInputStream(KeyFile);
InputStream WdbIn = new BufferedInputStream(new FileInputStream(C12File));
byte[] KeyData = new byte[158];
KeyIn.read(KeyData);
byte[] T1 = new byte[32];
System.arraycopy(KeyData, 30, T1, 0, 32);
byte[] KEY = new byte[32];
System.arraycopy(KeyData, 126, KEY, 0, 32);
KeyIn.close();
byte[] C12Data = new byte[67];
WdbIn.read(C12Data);
byte[] T2 = new byte[32];
System.arraycopy(C12Data, 3, T2, 0, 32);
byte[] IV = new byte[16];
System.arraycopy(C12Data, 51, IV, 0, 16);
if (!new String(T1, 0, T1.length, "ASCII").equals(new String(T2, 0, T2.length, "ASCII")))
quit("Key file mismatch or crypt12 file is corrupt.");
int InputLength = WdbIn.available();
RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
byte[] tempBuffer = new byte[1024];
int I;
while ((I = WdbIn.read(tempBuffer)) != -1)
raf.write(tempBuffer, 0, I);
raf.setLength(InputLength - 20);
raf.close();
WdbIn.close();
InputStream PdbSt = new BufferedInputStream(new FileInputStream(tempFile));
Cipher cipher;
Security.addProvider(new BouncyCastleProvider());
cipher = Cipher.getInstance("AES/GCM/NoPadding", "BC"); // BouncyCastle
// cipher = Cipher.getInstance("AES/GCM/NoPadding", "SC"); // SpongyCastle (Android)
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(KEY, "AES"), new IvParameterSpec(IV));
CipherInputStream CipherStream = new CipherInputStream(PdbSt, cipher);
InflaterInputStream CryptOutput = new InflaterInputStream(CipherStream, new Inflater(false));
try {
FileOutputStream InflateBuffer = new FileOutputStream(SQLFile);
int N = 0;
byte[] CryptBuffer = new byte[8192];
while ((N = CryptOutput.read(CryptBuffer)) != -1) {
InflateBuffer.write(CryptBuffer, 0, N);
}
InflateBuffer.close();
} catch (IOException ex) {
quit("Fatal error:" + ex);
}
CipherStream.close();
tempFile.delete();
InputStream SqlDB = new FileInputStream(SQLFile);
byte[] SqlData = new byte[6];
SqlDB.read(SqlData);
byte[] MS = new byte[6];
System.arraycopy(SqlData, 0, MS, 0, 6);
SqlDB.close();
if (!new String(MS, 0, MS.length, "ASCII").toLowerCase().equals("sqlite")) {
new File(SQLFile).delete();
quit("Decryption of crypt12 file has failed.");
}
else
quit("Decryption of crypt12 file was successful.");
}
private static void quit(String Msg) {
System.out.println(Msg);
System.exit(0);
}
public static void main(String[] args) throws Exception {
String outFile;
if (args.length > 1 && args.length < 4) {
if (args.length == 3)
outFile = args[2];
else
outFile = "msgstore.db";
decrypt(args[0], args[1], outFile);
} else {
System.out.println("\nWhatsApp Crypt12 Database Decrypter 1.0 Copyright (C) 2016 by TripCode");
System.out.println("\tUsage: java -jar decrypt12.jar key msgstore.db.crypt12 msgstore.db\n");
}
}
}
Code:
Usage: java -jar decrypt12.jar key msgstore.db.crypt12 msgstore.db
GitHub Repository: WhatsApp-Crypt12-Decrypter
Click to expand...
Click to collapse
error message..line 84..intended error
hi tripcode...i used the python script in python3.6...it showed an intended error..error line 84...can u please help me in this issue..or can u guid me to decrypt the file..am not having that key file..thats y..mobile lost..i retrieved the files from drive..so plz help me in this issue..
error the key file not found
hi it was fine till it shows the key file is not found...plz help me in this issues
GURUMOORTHI said:
hi it was fine till it shows the key file is not found...plz help me in this issues
Click to expand...
Click to collapse
w/o key file ...there is no way to brake the crytp12...
mmmm but i don`t know if there is any chace using brute force to brake the encrytion
Can someone share pycrypto also pycryptodome? or java for Android thanks
gbwhatsapp
Fusseldieb said:
There is a program out there which claims to obtain the key file without root. If it's still working today, I don't know. Here: https://forum.xda-developers.com/showthread.php?t=2770982
If you want the key file, it's better to root your phone and get it. It's not that hard. You can even unroot your phone after catching the key.
And no, someone can't just decrypt the database, because the key is there for a reason, and this reason is security.
Click to expand...
Click to collapse
You can try:
a tutorial from Ik Teach:
https://www.youtube.com/watch?v=4b1f2iTnoO8
link to the file gbwhatsapp:
https://idescargar.com/gbwhatsapp/descargar/
It give you de key file whithout root. It worked for me. But it is a little tricky. and you end up with this modded whatsapp.
Cheers!
hii tripcode
I am not having that key file..
i lost my mobile....i retrieved the files from drive..so plz help me to decrypt my database.
shanya_creation said:
hii tripcode
I am not having that key file..
i lost my mobile....i retrieved the files from drive..so plz help me to decrypt my database.
Click to expand...
Click to collapse
You need to re-download WhatsApp in another phone and use your old number. (Yes, you'll need to recover your phone number before recovering your chats). Once you have WhatsApp installed you can take out the Key file from /data/data/com.whatsapp/files
To do that stuff i recommend to use a old phone that can be easily rooted or one that has already rooted.
Good luck :good:
Hello,
Does anyone know if by any chance KEY file gets deleted on old phone when whatsapp is activated on a new phone and old phone whatsapp gets locked asking for conf code by SMS?
I rooted android 4.x.x
I then searched using ez file manager in root and in data/data /com.whatsapp but i do not see a KEY file.
download WhatsApp Plus8.30 it will work for you
https://goapk.org/whatsapp-plus/
Need Help!
I have whatsapp db.crypt12 file. I am novice in Mobile. Can anybody make that file readable professionally for me? I am ready to pay for this.
HI,
I have extracted the key by the procedure of "WhatsApp Key/DB Extractor 4.7 Enhanced 1.0" (https://forum.xda-developers.com/showthread.php?t=2770982&page=55), but eventually your JAVA code failed with message:
Key file mismatch or crypt12 file is corrupt.
Why is that?
Somewhere (guess at Elcomsoft Explorer) I have read, that the key can only decrypt backups taken from a previous time. This should true in my case, isnt?
1) Is the key somehow related to the phone device itself? (I have used a spare phone for this analysis, so not the original WA was regularly running on.)
Since end of August (when an Upgrade of WA has destroyed my chat history database) I have tried several attempts to restore it by downgrading WA to 2.20.64 and 2.20.89, so the key I have now is not the original of what the crypted backup was created with.
Moreover, due to a database schema error my chat history can only be loaded with WA version previous to 2.20.89 (this is why: https://medium.com/@leonardocezaryc...hatsapp-windows-phone-to-android-6b225918af55)
My experiments now led to the situation, that I not any more can register any pre-2.20.89 version by the SMS verification process, even though I dated my phone back to mid of August.
Thus I currently have no working installation with all my chat history where I could extract a crypto key from.
2) Any ideas how i can bypass Whatsapp to complain about its expired versions and register by SMS again?
3) Is it a hard-coded deadline in the binaries of the app?
4) Does the crypt key change between installations and become incompatible? I wonder, how to restore any old backup then...
Thanks!
samruthstom said:
Hello,
Does anyone know if by any chance KEY file gets deleted on old phone when whatsapp is activated on a new phone and old phone whatsapp gets locked asking for conf code by SMS?
I rooted android 4.x.x
I then searched using ez file manager in root and in data/data /com.whatsapp but i do not see a KEY file.
Click to expand...
Click to collapse
Yes - upon inactivation WA 2.20.89+ destroys the "key" file and instead creates a "backup_token" file.
It is recoverable by activating it via SMS code.
---------- Post added at 07:40 PM ---------- Previous post was at 07:26 PM ----------
heyvijay said:
I have whatsapp db.crypt12 file. I am novice in Mobile. Can anybody make that file readable professionally for me? I am ready to pay for this.
Click to expand...
Click to collapse
What kind of problem can't you solve so far?
There is a commercial solution called "Elcomsoft eXplorer for WhatsApp ".
I also would like and am about to try it out, if you are interested, we can share the costs of it.
After years of successfully using this to access MY chat data, this week it stopped working :-(
WhatsApp on my phone looks to have updated to v2.21.8.17 and is now generating local backups with a .crypt14 extension instead of .crypt12.
Unsurprisingly, this chokes on this with the error Key file mismatch or crypt12 file is corrupt.
However, armed with hexdump and a bit cunning, I've worked out how to tweak the python so that it successfully decodes .crypt14 files.
in a .crypt14 file ... [.py hacks in decrypt12 function shown below in square brackets]
... t2 is at offset 14 [so change to crypt12.seek(14) t2 = crypt12.read(32)]
... iv is at offset 66 [change to crypt12.seek(66) iv = crypt12.read(16)]
... encrypted content starts at offset 99, (I haven't yet worked out the correct amount of footer to remove, but removing 0 seems to result in a successful decryption so far) [change to crypt12.seek(99) primer(tf, crypt12, 0)]
I've also noticed that the 16 bytes at offset 62 to 77 in the key file also appear in the .cryptX file, just like the t bytes at offset 30 to 61 do.
In a .crypt12 file they are at offset 35 to 50.
In a .crypt14 file they are at offset 48 to 63.
In my code I've called these x1 and x2 and do the same equality check as happens for t1 and t2.
In addition, in the .crypt14 file, bytes at 86 to 94 look to contain the WA version number, so in my case 2.21.8.17 - presumably the version that wrote the .crypt14 file. I suspect that when the version number rolls over to more digits (e.g. 2.21.10.10) then the offset to the start of the encrypted content (currently 99 in my backup files) might well change?
adflyer said:
After years of successfully using this to access MY chat data, this week it stopped working :-(
WhatsApp on my phone looks to have updated to v2.21.8.17 and is now generating local backups with a .crypt14 extension instead of .crypt12.
Unsurprisingly, this chokes on this with the error Key file mismatch or crypt12 file is corrupt.
However, armed with hexdump and a bit cunning, I've worked out how to tweak the python so that it successfully decodes .crypt14 files.
in a .crypt14 file ... [.py hacks in decrypt12 function shown below in square brackets]
... t2 is at offset 14 [so change to crypt12.seek(14) t2 = crypt12.read(32)]
... iv is at offset 66 [change to crypt12.seek(66) iv = crypt12.read(16)]
... encrypted content starts at offset 99, (I haven't yet worked out the correct amount of footer to remove, but removing 0 seems to result in a successful decryption so far) [change to crypt12.seek(99) primer(tf, crypt12, 0)]
I've also noticed that the 16 bytes at offset 62 to 77 in the key file also appear in the .cryptX file, just like the t bytes at offset 30 to 61 do.
In a .crypt12 file they are at offset 35 to 50.
In a .crypt14 file they are at offset 48 to 63.
In my code I've called these x1 and x2 and do the same equality check as happens for t1 and t2.
In addition, in the .crypt14 file, bytes at 86 to 94 look to contain the WA version number, so in my case 2.21.8.17 - presumably the version that wrote the .crypt14 file. I suspect that when the version number rolls over to more digits (e.g. 2.21.10.10) then the offset to the start of the encrypted content (currently 99 in my backup files) might well change?
Click to expand...
Click to collapse
It's not working for me for some reason. I don't know what I am missing here. Can you provide the modified code itself?
As I'm no longer modding, this thread will not be updated anymore. Please refer to apktool issues https://github.com/iBotPeaches/Apktool/issues?q=is:issue++ and discussions https://github.com/iBotPeaches/Apktool/discussions for latest infomation
Since many got apktool.jar errors and don't know how to search or solve themself, I decided to explain and provide solutions here with links to Github. I have a friend who sometime can help me with this.
I will do my best to get much info. Feel free to post your thoughts
Know your error:
There’s a wide range of error messages you may encounter when decompiling and compiling your app. Depending on the kind of error you encounter, apktool.jar will always display the error message. Spotting error messages is easy
For example this log:
Code:
I: Using Apktool 2.4.1
I: Smaling smali folder into classes.dex...
I: Smaling smali_classes2 folder into classes2.dex...
I: Building resources...
W: D:\xxx\AndroidManifest.xml:15: Tag <uses-permission> attribute name has invalid character ' '.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\evildog1\AppData\Local\Temp\brut_util_Jar_2200487015856364895.tmp, p, --forced-package-id, 127, --min-sdk-version, 19, --target-sdk-version, 28, --version-code, 19227, --version-name, 4.1.1, --no-version-vectors, -F, C:\Users\evildog1\AppData\Local\Temp\APKTOOL3877124333918122178.tmp, -e, C:\Users\evildog1\AppData\Local\Temp\APKTOOL2736431752124554942.tmp, -0, arsc, -I, C:\Users\evildog1\AppData\Local\apktool\framework\1.apk, -S, D:\xxx\res, -M, D:\xxx\AndroidManifest.xml]
If you think could not exec is your error, it's actually not, the real error is actually a 'warning'
Code:
W: D:\APK Easy Tool\1-Decompiled APKs\xxx\AndroidManifest.xml:15: Tag <uses-permission> attribute name has invalid character ' '
The good thing it tells you which line it occured AndroidManifest.xml:15:. it's line 15 in AndroidManifest.xml
This was caused by a space in a permission tag. Removing it will fix the compiling error
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
It's not always a simple fix. This always depending
Check the APK file:
Sometimes APK is obfuscated in many ways.
Open the APK using 7-zip and WinRar and see if the first classes.dex is smaller than 500 KB or way bigger than 10 MB. If so, it a sign it's encrypted. Decompiling and compiling the big dex file will result in a smaller size and it will fail to decrypt due to missing encrypted block
Decompile and check if smali files and codes are obfuscated. This is an example of Netflix app that is obfuscated
Don't ask me how to break protected APK, I'm not a reverser so I can't help you with it.
Troubleshooting:
Sometime those troubleshooting tricks helps fixing errors. Please try one or more of the following below
- If you are using any 3rd party GUI tools, please try the actual apktool.jar with CMD first
- Use latest version of apktool.jar: https://ibotpeaches.github.io/Apktool/ and test
- If you are using latest version, try use older version of apktool.jar. Sometimes it can mitigate the issue
- Clear framework apktool empty-framework-dir --force and decompile the APK again.
- Decompile APK with --only-main-classes (Only disasemble dex classes in root (classes[0-9].dex). Prevents disasemble dex from assets folder) (apktool 2.4.1 and up only)
- Decompile APK with --no-res if you are only editing Java (smali) (--no-res will prevent the decompile of resources. This keeps the resources.arsc intact without any decode.)
- Decompile APK with --no-src if you are only editing the resources (xml) (--no-src will prevent the disassembly of the dex file(s). This keeps the apk dex file(s) and simply moves it during build.)
- Compile with --use-aapt2 (Use the aapt2 binary instead of appt)
Errors list:
Tip: Press CTRL + F and find the words
If there is no error you are looking for, search it on following Github issue pages
Apktool: https://github.com/iBotPeaches/Apktool/issues
Baksmali/smali: https://github.com/JesusFreke/smali/issues
Deompile errors:
* Exception in thread "main" java.lang.NullPointerException (XML related)
This is an issue with apktool 2.4.1. Downgrade to 2.4.0 or below (2.3.4 is better)
* Exception in thread "main" org.jf.dexlib2.dexbacked.DexBackedDexFile$NotADexFile: Not a valid dex magic value: (xx xx xx xx xx xx xx xx)
Rare issue, it usally caused if it tries to decompile encrypted dex from assets folder
Decompile APK with --only-main-classes
* Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: res
This is a trick to prevent decompiling on Windows. Open the APK file using 7zip or Winrar and delete the unnamed file from res folder
Or use Mac/Linux until then
See: https://github.com/iBotPeaches/Apktool/issues/1460
* Invalid debug offset
These are legitimate warnings about inconsistencies in the dex file. The invalid debug offset is otherwise ignored and the classes are successfully disassembled.
Compile errors:
* brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = -1073741515)
This was an issue with Java 8 32-bit on Apktool 2.4.0. Install 64-bit of Java or switch to other version
See: https://github.com/iBotPeaches/Apktool/issues/2141
* Cant find 9patch chunk in file: (...). Renaming it to *.png.
APK is Obfuscated
See: https://forum.xda-developers.com/showpost.php?p=81088145&postcount=619
* Cannot run program "aapt": CreateProcess error=2, The system cannot find the file specified
Not a bug. This means the default application that is copied to tmp and executed, could not be done. Therefore it relied on the aapt binary being accessible in the $PATH variable.
* Class (...) has already been interned
Decompile APK with --only-main-classes (apktool 2.4.1 and up only)
* Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
apktool.yml does not exist, because APK did not decompiled completely. Decompile again
* Float types not allowed
Remove the decimal from version number maybe?
Reported issue: https://forum.xda-developers.com/showpost.php?p=82840671&postcount=699
* Invalid resource directory name
Currently unknown. Try clear framework if you don't work with system apps
* Invalid file name: must contain only (...). Ignoring...
See: https://github.com/iBotPeaches/Apktool/issues/2282
* JAXP 1.5 Support is required to validate XML
Update apktool.jar to the latest version
* No resource identifier found for attribute 'isSplitRequired' in package 'android'
Split APK is not supported yet. See https://github.com/iBotPeaches/Apktool/issues/2218
If you are following some tutorials how to merge split apks into one, then remove the attribute android:isSplitRequired="true" from AndroidManifest.xml, save and compile again
* No resource identifier found for attribute (...) in package (...)
There are many reasons why. Please refer to these issues for more infomation: https://github.com/iBotPeaches/Apktool/issues?q=No+resource+identifier+found+for+attribute+
Try clear framework if you don't work with system apps
Sometimes, removing the attribute will fix the error and the app would run fine without it. Always test if the app is working fine or not
* No resource found that matches the given name
There are many reasons why. This is not always easy to fix
See issues
https://github.com/iBotPeaches/Apktool/issues/2365
https://github.com/iBotPeaches/Apktool/issues/2362
https://github.com/iBotPeaches/Apktool/issues/2339
https://github.com/iBotPeaches/Apktool/issues/2422
Try clear framework if you don't work with system apps
If you are working with system apps, you may need framework installed.
* Tag (...) missing required attribute name.
Not an easy fix, but you can try --use-aapt2 or don't decode resources (-r, --no-res) if you don't need
https://github.com/iBotPeaches/Apktool/issues/1880
Tag <uses-permission> attribute name has invalid character ' '
This was caused by a space in an attribute name. Removing it will fix the compiling error
Example, change:
Code:
<uses-permission android:name="com.google.android.finsky.permission.CHECK_LICENSE "/>
to
Code:
<uses-permission android:name="com.google.android.finsky.permission.CHECK_LICENSE"/>
* Unsupported res type name for bags
See: https://github.com/iBotPeaches/Apktool/issues/1719
* Unsigned short value out of range: 65536
You have too many methods. The method index can't fit into an unsigned 16-bit value each dex
Simply move your codes to smali_classes(X) or create new one. For example if smali_classes2 is the latest, move code to smali_classes3
Full error log:
Code:
Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Lcom/mintegral/msdk/thrid/okhttp/internal/publicsuffix/PublicSuffixDatabase;->findMatchingRule([Ljava/lang/String;)[Ljava/lang/String;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1046)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:345)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:300)
at org.jf.smali.Smali.assemble(Smali.java:131)
at org.jf.smali.AssembleCommand.run(AssembleCommand.java:96)
at org.jf.smali.Main.main(Main.java:100)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x52
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1319)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1042)
... 5 more
Caused by: 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:356)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1279)
... 6 more
* warning: found plain 'id' attribute; did you mean the new 'android:id' name?
See: https://github.com/iBotPeaches/Apktool/issues/2188
* warning: string (...) has no default translation.
Those are warnings, they are fine.
* WARNING: Could not write to (C:\Users\(username)\AppData\Local\apktool\framework), using C:\Users\(username)\AppData\Local\Temp\ instead...
Use the --frame-path [folder] parameter and describing the folder you want the framework resources to reside.
This warning can be ignored if you don't use framework
Others:
* 'java' is not recognized as an internal or external command
Install/Re-install latest version of Java 8 https://java.com/en/download/ or set the enviorment path manually
* APKTOOL_DUMMY
If you get APKTOOL_DUMMY that's generally because apktool can't decode some of the information in the original APK and creates a 'dummy' value instead. Because there's no things called APKTOOL_DUMMY in public.xml, the APK can't be recompiled. It's likely because you try to compile splitted APK with some missing infomation
* Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Increase the java heap size like:
java -Xmx4096m -jar apktool.jar
java -Xmx4g -jar apktool.jar
If your system is Windows and is 64-bit, please uninstall 32-bit version and install 64-bit version (Windows Offline (64-bit)) https://java.com/en/download/manual.jsp
* Unsupported major.minor version (...)
Upgrade java to the latest version https://java.com/en/download/
ppst reserved 2
Updated. If you found more errors, please let me know
i have res relative problem, can anyone solve this
evildog1 said:
Updated. If you found more errors, please let me know
Click to expand...
Click to collapse
why I get this type of error
lokesh.Dewangan said:
why I get this type of error
Click to expand...
Click to collapse
Try
Code:
--use-aapt2
i get this error when decompile classes.dex :
Lcom/ano/gshell/AnoApplication;-><clinit>()V: Invalid debug offset
Lcom/ano/gshell/AnoApplication;-><init>()V: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->dec(Ljava/lang/String;)Ljava/lang/String;: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->dec(Ljava/lang/String;)Ljava/lang/String;: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->attachBaseContext(Landroid/content/Context;)V: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->attachBaseContext(Landroid/content/Context;)V: Invalid debug offset
and then after recompile the app and install the app works then exit in lobby
but when i use --no-src the app work without crash but i cant edit smali like that.
this is the app link try decompile and recompile dex file.
Download
I have a little problem described here, would you look at it?
Thx
Hello, when I try to compile I get an error, could you please help me.
Thank you
Code:
Checking for update...
Compiling APK file... (Press ESC to cancel)
Executing command: java.exe -jar "C:\Users\José Andrés\Desktop\PÒRTABLE EASY\Apktool\apktool_2.5.0.jar" b -d -f --use-aapt2 -o "C:\Users\José Andrés\Desktop\PÒRTABLE EASY\2-Recompiled APKs\Teba_19.3.apk" "C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3"
I: Using Apktool 2.5.0
I: Smaling smali folder into classes.dex...
I: Building resources...
I: Using aapt2 - setting 'debuggable' attribute to 'true' in AndroidManifest.xml
W: C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3\res: error: failed to open directory: El sistema no puede encontrar el archivo especificado. (2).
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\JOSAND~1\AppData\Local\Temp\brut_util_Jar_131902690237150689966905402769991619447.tmp, compile, --dir, C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3\res, --legacy, -o, C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3\build\resources.zip]
Compile failed. Please read the log
When you write:
"Sometimes, removing the attribute will fix the error and the app would run fine without it. Always test if the app is working fine or not"
where i can do it, removing the attribute ?
My error is:
W: C:\Users\Marco\Documents\APK Easy Tool\1-Decompiled APKs\XRecorder_v2.1.1.1__Arm7_Pro__UserUpload.Net\res\layout\a0.xml:2: error: No resource identifier found for attribute 'paddingBottomNoButtons' in package 'videoeditor.videorecorder.screenrecorder'
etc...
Thank
Hispa
Sorry for very late reply guys
tahooo said:
i get this error when decompile classes.dex :
Lcom/ano/gshell/AnoApplication;-><clinit>()V: Invalid debug offset
Lcom/ano/gshell/AnoApplication;-><init>()V: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->dec(Ljava/lang/String;)Ljava/lang/String;: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->dec(Ljava/lang/String;)Ljava/lang/String;: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->attachBaseContext(Landroid/content/Context;)V: Invalid debug offset
Lcom/ano/gshell/AnoApplication;->attachBaseContext(Landroid/content/Context;)V: Invalid debug offset
and then after recompile the app and install the app works then exit in lobby
but when i use --no-src the app work without crash but i cant edit smali like that.
this is the app link try decompile and recompile dex file.
Download
Click to expand...
Click to collapse
Sounds like the app has a protection against tampering. I cannot help with that
gidano said:
I have a little problem described here, would you look at it?
Thx
Click to expand...
Click to collapse
I believe it has been fixed https://github.com/iBotPeaches/Apktool/pull/2650
Try using latest commit of apktool.jar (Requires Github account to download) https://github.com/iBotPeaches/Apktool/actions/runs/1712896706
Jaloga said:
Hello, when I try to compile I get an error, could you please help me.
Thank you
Code:
Checking for update...
Compiling APK file... (Press ESC to cancel)
Executing command: java.exe -jar "C:\Users\José Andrés\Desktop\PÒRTABLE EASY\Apktool\apktool_2.5.0.jar" b -d -f --use-aapt2 -o "C:\Users\José Andrés\Desktop\PÒRTABLE EASY\2-Recompiled APKs\Teba_19.3.apk" "C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3"
I: Using Apktool 2.5.0
I: Smaling smali folder into classes.dex...
I: Building resources...
I: Using aapt2 - setting 'debuggable' attribute to 'true' in AndroidManifest.xml
W: C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3\res: error: failed to open directory: El sistema no puede encontrar el archivo especificado. (2).
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\JOSAND~1\AppData\Local\Temp\brut_util_Jar_131902690237150689966905402769991619447.tmp, compile, --dir, C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3\res, --legacy, -o, C:\Users\José Andrés\Desktop\PÒRTABLE EASY\1-Decompiled APKs\Teba_19.3\build\resources.zip]
Compile failed. Please read the log
Click to expand...
Click to collapse
Try enable aapt2
hispanico957 said:
When you write:
"Sometimes, removing the attribute will fix the error and the app would run fine without it. Always test if the app is working fine or not"
where i can do it, removing the attribute ?
My error is:
W: C:\Users\Marco\Documents\APK Easy Tool\1-Decompiled APKs\XRecorder_v2.1.1.1__Arm7_Pro__UserUpload.Net\res\layout\a0.xml:2: error: No resource identifier found for attribute 'paddingBottomNoButtons' in package 'videoeditor.videorecorder.screenrecorder'
etc...
Thank
Hispa
Click to expand...
Click to collapse
By editing the xml if you know how. I won't cover it here
Otherwise report issue to https://github.com/iBotPeaches/Apktool/issues
How to prevent apktool from merging res folders?
Example:
color
color-v11
get merged into
color
gcrutchr said:
How to prevent apktool from merging res folders?
Example:
color
color-v11
get merged into
color
Click to expand...
Click to collapse
Sorry, didn't saw this post. I think this is a feature. You should contact iBotPeaches
evildog1 said:
Sorry, didn't saw this post. I think this is a feature. You should contact iBotPeaches
Click to expand...
Click to collapse
It can't be a feature. SystemUI.apk won't work without res/**.xml-v??
When I change the Minimum SDK Version using ApkTool. The apk it's Crashing.
Just a heads-up.
If you like modifying Android core files (like framework.jar) on Android 10 or greater (API 29+) using apktool 2.6.1 it's not going to work so nicely even if it doesn't bomb on an error.
Code:
Error occurred while disassembling class Landroid.util.proto.HapiProto; - skipping class
java.lang.ArrayIndexOutOfBoundsException: 6
at org.jf.dexlib2.HiddenApiRestriction.getAllFlags(HiddenApiRestriction.java:108)
It will make a mish-mash of the new hidden API modifiers (whitelist, greylist, greylist-max-o...)
@iBotPeaches has this already in sight and is trying to resolve it.
https://github.com/iBotPeaches/Apktool/issues/2918
On a bit of a tangent, in the interim I tried the "nuclear option".
I was working on a framework.jar and couldn't "round-trip" it, so I edited out all the hidden API modifiers.
It builds fine, but the logcat was a train wreck.
Anybody know why?
Edit: I gave up on nuking all hidden API modifiers.
apktool d works fine so I can disassemble at least, but I don't think there are any options to show the file addresses of the instructions.
So I wrote a work-in-progress to disassemble with file addresses:
Code:
C:\>dexdump classes.dex /cKeyboardEntryMap /mgenerateMap
KeyboardEntryMap
002eebec generateMap
002eebfc const-string/jumbo
002eec02 invoke-static
002eec08 move-result-object
...
002eec62 invoke-interface
002eec68 goto
002eec6a return-void
Then I just need some judicious hex editing to nops or return-void.
Exception in thread "main" java.lang.ClassCastException: class brut.androlib.res.data.value.ResStringValue cannot be cast to class brut.androlib.res.data.value.ResIntValue (brut.
androlib.res.data.value.ResStringValue and brut.androlib.res.data.value.ResIntValue are in unnamed module of loader 'app')
Anyone know anything about this?
Perhaps it's the time of year for elves, but this one is giving me fits. Building Evolution X and can't get past this issue during the build process. ANyone seen this one before or know what I'm doing wrong??
/home/erik/snow/out/target/product/pdx203/system/system_ext/bin/dpmd: error: found ELF prebuilt in PRODUCT_COPY_FILES, us
e cc_prebuilt_binary / cc_prebuilt_library_shared instead.
/home/erik/snow/out/target/product/pdx203/system/system_ext/bin/dpmd: error: found ELF file: vendor/sony/pdx203/proprieta
ry/system_ext/bin/dpmd
19:19:54 ninja failed with: exit status 1
#### failed to build some targets (03:43 (mm:ss)) ####
To answer my own question since there's literally zero info on this out on the internet, here's the fix.
Open your device's boardconfig.mk file and paste in the following text:
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true
Re-run make, and you're all set to start working on the next error.
hi!
I got the same error.
yes, we can add this flag to BoardConfig.mk, but it is not a clean solution since Google encourages the use of Android.bp files instead of Makefiles. Thant's what the soong suggested the use of these modules (cc_prebuilt_binary / cc_prebuilt_library_shared). in my case, solved this problem by creating Android.bp file in the repo where I put my prebuilt libraries, then I added them as product packages in the product mk file. this is an example :
Android.bp :
cc_prebuilt_library {
name: "product_package_name_in_MK_file",
relative_install_path: "sub_lib/sub_sub_lib",
stem: "output_file_name", // .so will be added automatically to out file name.
compile_multilib: "both",
multilib: {
lib32: {
srcs: ["path for src 32bit lib"],
},
lib64: {
srcs: ["path for src 64bit lib"],
},
},
strip: {
none:true,
},
allow_undefined_symbols: true,
check_elf_files: false,
vendor: true,
enabled: true,
}
product_mk file :
...
PRODUCT_PACKAGES += product_package_name_in_MK_file
...