[Q] many errors on a decompiled android app - Java for Android App Development

Hi
I own maked an app with a gui android book designer and I decompiled this app with http://www.decompileandroid.com/ and when I opening the source project on Aide or eclipse
all two app give me about 70,000 errors on this decompiled source code!
why? what is the problem?
this is apk studio error when I want to decompile with it:
Code:
I: Using Apktool 2.0.0-Beta9 on attackclash.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:54)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:604)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
at brut.androlib.Androlib.getResTable(Androlib.java:49)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:93)
at brut.apktool.Main.cmdDecode(Main.java:169)
at brut.apktool.Main.main(Main.java:85)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:43)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:95)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
... 7 more
I give here apk file and source code if u need it
please help me I need it ...
sry 4 my bad english

Decompiled apk's into Java code should be used for reference and learning only - when you decompile an app, you are not getting 100% the original Java source code, hence the errors. It is impossible to get the complete original code via decompilation.

Related

[GUIDE]Porting ARMv7 roms to ARMv6 devices

I believe many people wanted to learn how to do this. Well I was one of them until a while ago..
First of all I want to Thank Lens_flare for his awesome MIUIv4 porting guide! I actually learned porting after following his guide..
Anyways,
WHAT YOU'LL NEED:
apktool
ddms for logcat(or adb, whichever you like. I prefer ddms as its more detailed and easy to understand)
File comparison and merging tool.
Araxis Merge(I've been using Araxis Merge during the time I was on Windows. Its a paid tool but its available for free for 30 days)
WinMerge(Windows)
Meld(if you are on linux. Its available on Ubuntu Software Center)
Alternatively, you can google for other file comparison tools; https://www.google.com/search?clien...e+comparison+and+merge+tool&ie=utf-8&oe=utf-8
LET'S BEGIN!
Now ,I don't want to write the instructions on how to make a basic port as rishabh has already written one over here(Don't forget to thank him!). My actual purpose was to make a support post in his thread as a further info on porting but the info which needed to be written was way too big so I decided to post a new thread.. Anyways, follow his guide to get over with the simple porting process .. I highly recommend you to use dsixda's Android Kitchen. It will help a lot in porting. (from deodexing to easily unpacking/re-building ROM zips, signing, zipaligning apks, etc. etc.)
dsixda's Kitchen
Guide for installing and using the Kitchen
The actual porting begins now!..
I assume you already got built your zip following the above given guide, now we can go on..
Firstly flash the zip you built. It will obviously not boot.. so called 'bootloop'... What we are going to do is to observe the logcat and find errors causing bootloop, and fix them..
COMPARING AND PATCHING/DIFFING
We are going to fix errors by finding the error causing .smali files by observing the log (There might of course be other factors for a bootloop, but that doesn't interest us yet. If in the porting process we get different kind of errors we are goin to look into them then..)
Please look below at "UNDESTANDING LOGS AND DEBUGGING" section for better understanding of logcat and what we are gonna do exactly!
Patching?? What's that?
Lens_flare said:
Patching (usually named diffing, diff that means "find differences and eliminate them") in our context is a process of comparing two files and adding contents of one of them to another and not replacing anything.
Click to expand...
Click to collapse
OK! Let's imagine logcat gave us this info;
Code:
E/dalvikvm( 8925): ERROR: couldn't find native method
E/dalvikvm( 8925): Requested: Landroid/content/res/AssetManager;.splitThemePackage:(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I
E/JNIHelp ( 8925): RegisterNatives failed for 'android/content/res/AssetManager', aborting
I'm pretty sure you can all see
Code:
android/content/res/AssetManager
and
Code:
ERROR: couldn't find native method
these show us that there is a missing native method in AssetManager.smali file under android/content/res of framework.jar
Now, I assume you already got apktool set up, we should decompile both base framework.jar(the one in the base rom, obviously) and port framework.jar(the one you are porting). Rename the base framework.jar file to "framework_base.jar" and leave the port stay "framework.jar" and put them in apktool directory..
Run a cmd, cd to the apktool directory and decompile the jars by typing
Code:
apktool d framework.jar
Code:
apktool d framework_base.jar
Once the de-compilation is finished you will get two folders in the apktool directory. One "framework.jar.out" and the other "framework_base.jar.out"
Navigate to "smali/android/content/res" in both the folders and find AssetManager.smali.
Get your comparison tool opened up and import the base AssetManager.smali to one side and the port to the other.
Now, you can start adding missing stuff.. NOTE: While patching AssetManager.smali, DO NOT REPLACE ANYTHING! JUST ADD MISSING LINES!!
Ok after you make sure you have added missing lines, save files and close the program.
Switch back to apktool and recompile the port framework.jar by typing the following command:
Code:
apktool b framework.jar.out
OK! you are good to go. Now either put this in a small flashable.zip for sake of time. or put it in your WORKING_FOLDER and rebuild the whole zip. Flash it and you shouldn't see the AssetManager.smali error any more.
But wait! You didn't think you would get you Port booting? did you? Well, if you did you were to be happy too fast! You are going to face this kind of errors again and again.. Then sometime you'll see you rom booting and will be the happiest guy
Anyways, when you see other similar errors just apply the same technique to them. The technique of "patching"!
Porting ARMv7 to v6 might throw up some other errors except smali files. If something happens and you can't fix feel free to post a log here I'll do my best to solve it. If I cant, then I hope some others, more experienced people can contribute..
UNDERSTANDING LOGS AND DEBUGGING
This section is a slightly modified version of the "understanding logs and debugging" section of Lens_flare's guide on MIUI porting(make sure you thank him too!) to better fit our purpose.. (I've got his permission)
I've put his word under this show/hide button for a cleaner thread
Most likely people are going to forum and just posting logcat (that might contain common error). My goal is show you - logcat is not you should fear to see!
First of all, let's assume something:
adb - powerful tool, in our case the must have thing to make a log. Article on android devs most likely describes all the moments about adb power: http://developer.android.com/tools/help/adb.html
logcat/log - one of the android advantages that allows you to debug what's going on with your system. by "make log" I will assume issuing
Code:
adb logcat >log.txt
command, last argument - log.txt is a text file with log system provided to you (you could use any name).
debug/debugging - process of analyzing code which helps to eliminate bugs (that's why de-bug)
You could also use ddms instead, it has a nice GUI. You can find the logcat at the right bottom of the ddms window..
Some people experiencing problems with log, most common are:
-no/corrupted/wrong usb drivers on PC
-Windows :crying: most likely is about new usb subsystems etc, so advice is the only one - try on ubuntu (not working without udev rules)
-somewhat corrupted/inconsistent usb port
Note: if your log only consists of:
Code:
link system/bin/sh failed: no such file or directory
or something like that, you should contact a CM dev, else, you are most likely know what happened ;]
Alright when we got a log, it consist of many many lines that are looping if your system not boots. That's why it is sometimes called bootloop. System may repeat a error eternal time it lives, so log might be huge.
To parse what's going on there are some advice:
keywords:
search in log you got some keywords, that might be useful on debugging boot issue;
most common keywords are:
"E/" - error
"E/dalvikvm" - possibly crucial system error
"No such file or directory" - says it all
"couldn't" - android likes that, mostly shows faulty things.
"fail"/"failed" - mostly crucial error
"W/"/"warning" - says it all, but not always warm could be a boot failure cause
"exception"(especially NullPointerException) - points you that something went wrong in framework or application work
I/ tags could be also useful at debugging, but most helpful are errors and warnings.
Most common constructs:
"couldn't find native method", the most common reason of a bootloop.
For instance:
Code:
E/dalvikvm( 100): ERROR: couldn't find native method
E/dalvikvm( 100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
E/JNIHelp ( 100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
Let's parse that construct to extract parts we will fix.
First of all. smali path might be extracted from that line:
Code:
E/JNIHelp ( 100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
->
Code:
android/view/GLES20Canvas
that's it, smali we are looking for is GLES20Canvas.smali. But.. android/view.. where it is? Answer comes from android source, it took some time to analyze frameworks.. Just let's assume: all that starting with "android" in path belongs to framework,jar.
What if path doesn't contain "android" at the beginning?
Again the answer is in source. Paths like"org/" are belong to framework.jar.
"com/android/server" - services.jar (there is the same folder at framework.jar but most likely you don't need to touch it).
another place we could be mixed up:
"com/android/internal" - framework.jar
"com/android/internal/policy/impl/" - android.policy.jar
for framework.jar path ends up on internal, which represents telephony folder. policy/impl is the only android.policy.jar folder.
Other frameworks are actually not used in port as they contain core android functionality which is common.
Note about smali you found:
it might be not smali you are looking for, most likely when code points you to android functionality and widgets (control elements) like combobox or listview, it's a sign to think twice what have you done on your system to port it
it might be tree of smali, to ease of use, always replace smali with its tree, and only if error becomes worse, think about single smali or about diff )
from
Code:
E/dalvikvm( 100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
we could extract a method which is missing - nStartTileRendering. In some cases only that method should be added and nothing more.
" Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)"
Hope all of you heared about C language. That error is a form of C "exceptional case"(in other words - exception).
You will see if it happen:
Code:
F/libc ( 2698): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
I/DEBUG ( 130): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 130): Build fingerprint: 'tmous/htc_doubleshot/doubleshot:4.0.3/IML
74K/275847.101:user/release-keys'
I/DEBUG ( 130): pid: 2698, tid: 2698 >>> zygote <<<
I/DEBUG ( 130): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaa
d
I/DEBUG ( 130): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000
I/DEBUG ( 130): r4 00000000 r5 00000027 r6 4086fbfd r7 00000036
I/DEBUG ( 130): r8 40253f04 r9 40233a7e 10 0000904c fp 00009062
I/DEBUG ( 130): ip 4028b240 sp befcfa60 lr 401043c1 pc 40100adc cpsr 600
00030
I/DEBUG ( 130): d0 2f64696f72646e61 d1 2f746e65746e6f63
I/DEBUG ( 130): d2 657373412f736572 d3 726567616e614d74
I/DEBUG ( 130): d4 0000d4cc0000d4b1 d5 0000d4e80000d4cd
yaa.. ENORMOUS code block, build fingerprint, fatal signal and stack trace.. welcome to hell
One little thing: error is right above that block, don't even try to parse its contents, ignore it.
"Unable to extract+optimize DEX from '/system/framework/framework.jar'" and other WTF cases
examples:
Code:
D/dalvikvm( 103): DexOpt: --- BEGIN 'framework.jar' (bootstrap=1) ---
E/dalvikvm( 172): Duplicate class definition: 'Landroid/media/MediaRecorder;'
E/dalvikvm( 172): Trouble with item 2900 @ offset 0x17a86c
E/dalvikvm( 172): Cross-item verify of section type 0006 failed
E/dalvikvm( 172): ERROR: Byte swap + verify failed
E/dalvikvm( 172): Optimization failed
W/dalvikvm( 103): DexOpt: --- END 'framework.jar' --- status=0xff00, process failed
E/dalvikvm( 103): Unable to extract+optimize DEX from '/system/framework/framework.jar'
D/dalvikvm( 103): Unable to process classpath element '/system/framework/framework.jar'
E/JNIHelp ( 103): Native registration unable to find class 'android/debug/JNITest', aborting
Code:
05-30 14:15:15.970: E/NetworkLocationRealOs(2304): no android ID; can't access encrypted cache
05-30 14:15:15.970: E/NetworkLocationRealOs(2304): java.io.IOException: no android ID; can't access encrypted cache
Code:
1012: 07-03 03:28:21.350: E/System(1538): ************ Failure starting core service
07-03 03:28:21.350: E/System(1538): java.lang.NullPointerException
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.grantPermissionsLPw(PackageManagerService.java:4299)
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.updatePermissionsLPw(PackageManagerService.java:4247)
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.<init>(PackageManagerService.java:1170)
07-03 03:28:21.350: E/System(1538): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:858)
07-03 03:28:21.350: E/System(1538): at com.android.server.ServerThread.run(SystemServer.java:167)
07-03 03:28:21.350: I/SystemServer(1538): Input Method Service
07-03 03:28:21.360: W/SystemServer(1538): ***********************************************
1021: 07-03 03:28:21.370: A/SystemServer(1538): BOOT FAILURE starting Input Manager Service
1022: 07-03 03:28:21.370: A/SystemServer(1538): java.lang.NullPointerException
1023: 07-03 03:28:21.370: A/SystemServer(1538): at android.app.PendingIntent.getBroadcast(PendingIntent.java:293)
1024: 07-03 03:28:21.370: A/SystemServer(1538): at com.android.server.InputMethodManagerService.<init>(InputMethodManagerService.java:548)
1025: 07-03 03:28:21.370: A/SystemServer(1538): at com.android.server.ServerThread.run(SystemServer.java:271)
1026: 07-03 03:28:21.400: E/AndroidRuntime(1538): Error reporting WTF
1027: 07-03 03:28:21.400: E/AndroidRuntime(1538): java.lang.NullPointerException
1028: 07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:345)
1029: 07-03 03:28:21.400: E/AndroidRuntime(1538): at android.util.Log$1.onTerribleFailure(Log.java:103)
1030: 07-03 03:28:21.400: E/AndroidRuntime(1538): at android.util.Log.wtf(Log.java:278)
1031: 07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.server.ServerThread.reportWtf(SystemServer.java:77)
1032: 07-03 03:28:21.400: E/AndroidRuntime(1538): at com.android.server.ServerThread.run(SystemServer.java:274)
mostly likely is about way assembling framework files. Also some of them might be just corrupted by accident. Sometimes these errors caused by wrong smali replacement or wrong diff methodology. Or it might be just banal reason - no place in system or cache partitions.
English []
Most log parts are in mere, not technician English,log might be read as little book with bright characters. Find what you are looking for and fix it..
Source code is your best friend in porting
I'd recommend to have an android source code [from internet or on your local PC] to port something that outstands of rules I listed. For example CM frameworks source could be found here: https://github.com/CyanogenMod/android_frameworks_base .
Any log line represents a line of code in source, that one could search and debug from there. Each smali represents a java source code or its part(- subclass which is signed by $), each java is in frameworks folder on source (mostly frameworks/base). Log line is a message, which formed with C rules about these rules, so you have to avoid ciphers or guess how could code represent that message. You may search guessed line in source to locate java file, or locate it manually according to smali location and my advice and search in it.
I WISH YOU A SUCCESSFUL AND HAPPY PORTING PROCESS!! :good:
wow,i've been looking for this for longtime..
gonna try it now..
Sent from my GT-S5660 using Tapatalk 2
AiphNday said:
wow,i've been looking for this for longtime..
gonna try it now..
Sent from my GT-S5660 using Tapatalk 2
Click to expand...
Click to collapse
Good Luck!
XiproX said:
Good Luck!
Click to expand...
Click to collapse
thanks..
you dont mind if i send you a PM to ask for help dont you??
Sent from my GT-S5660 using Tapatalk 2
AiphNday said:
thanks..
you dont mind if i send you a PM to ask for help dont you??
Sent from my GT-S5660 using Tapatalk 2
Click to expand...
Click to collapse
Well, its better to ask here. Some other people having the same issue might benefit from your question and its answer...
XiproX said:
Well, its better to ask here. Some other people having the same issue might benefit from your question and its answer...
Click to expand...
Click to collapse
sure,i'll do that..
Sent from my GT-S5660 using Tapatalk 2
Do not use dsixda's Kitchen to port. Use it for anything else except porting.
It's best to do your ports Manually, or make a tool yourself to do it automatically for you.
That way, you'll know what your doing and how to fix the upcoming errors.
Try not to use apktool to decompile JARs. Because inside JARs are classes.dex
You want to rename the classes.dex to anything you want, then decompile it using smali/baksmali:
Code:
java -jar baksmali-1.4.0.jar -a 10 classes.dex -o classes_output
The [highlight]-a[/highlight] switch determines the api level. See more here
Try not to refer the technique as "patching", instead, call it "diffing". It's just more common
P.S Nice job on the Guide. Could be a little more detailed..
Peteragent5 said:
Do not use dsixda's Kitchen to port. Use it for anything else except porting.
It's best to do your ports Manually, or make a tool yourself to do it automatically for you.
That way, you'll know what your doing and how to fix the upcoming errors.
Try not to use apktool to decompile JARs. Because inside JARs are classes.dex
You want to rename the classes.dex to anything you want, then decompile it using smali/baksmali:
Code:
java -jar baksmali-1.4.0.jar -a 10 classes.dex -o classes_output
The [highlight]-a[/highlight] switch determines the api level. See more here
Try not to refer the technique as "patching", instead, call it "diffing". It's just more common
P.S Nice job on the Guide. Could be a little more detailed..
Click to expand...
Click to collapse
wait,i dont get it..
classes.dex was inside the framework.jar right??
so i have to decompile the jar first to get the classes.dex,or just simply take the classes.dex inside the jar using 7zip then decompile the classes.dex with smali/baksmali??
Sent from my GT-S5660 using Tapatalk 2
AiphNday said:
wait,i dont get it..
classes.dex was inside the framework.jar right??
so i have to decompile the jar first to get the classes.dex,or just simply take the classes.dex inside the jar using 7zip then decompile the classes.dex with smali/baksmali??
Sent from my GT-S5660 using Tapatalk 2
Click to expand...
Click to collapse
classes.dex is what make the JAR file.
Do not decompile the JAR
Just simply extract the classes.dex inside the JAR with any Archiver, then decompile it using baksmali
After recompiling, you should sign the JAR file.
Peteragent5 said:
Do not use dsixda's Kitchen to port. Use it for anything else except porting.
It's best to do your ports Manually, or make a tool yourself to do it automatically for you.
That way, you'll know what your doing and how to fix the upcoming errors.
Try not to use apktool to decompile JARs. Because inside JARs are classes.dex
You want to rename the classes.dex to anything you want, then decompile it using smali/baksmali:
Code:
java -jar baksmali-1.4.0.jar -a 10 classes.dex -o classes_output
The [highlight]-a[/highlight] switch determines the api level. See more here
Try not to refer the technique as "patching", instead, call it "diffing". It's just more common
P.S Nice job on the Guide. Could be a little more detailed..
Click to expand...
Click to collapse
Well, thanks! I don't have a huge experience at porting. but you know many people want to know how to port ARMv7 -> v6.. and there wasnt any tutorial for it.. I decided to write this as a beginning. Im open to any kind improvements.
BTW, has anyone found a file comparison tool to exclude specific values like: .line foo
Please let me know! It'll help a lot in my porting, as well as with everyone else's
Peteragent5 said:
classes.dex is what make the JAR file.
Do not decompile the JAR
Just simply extract the classes.dex inside the JAR with any Archiver, then decompile it using baksmali
After recompiling, you should sign the JAR file.
Click to expand...
Click to collapse
so after i finished,compile with smali and put the classes.dex back inside the jar again right??
Peteragent5 said:
BTW, has anyone found a file comparison tool to exclude specific values like: .line foo
Please le me know! It'll help alot in my porting, as well as with everyone else's
Click to expand...
Click to collapse
did you try Araxis Merge its paid software, there is a 30 day trial version, and there are some alternative ways of getting the full version. You know... I used it for some time and it was great.. But Im not sure if it has that feature.. You can check if you want.
Peteragent5 said:
Do not use dsixda's Kitchen to port. Use it for anything else except porting.
It's best to do your ports Manually, or make a tool yourself to do it automatically for you.
That way, you'll know what your doing and how to fix the upcoming errors.
Click to expand...
Click to collapse
I don't really understand. I mean, the kitchen just does the extracting and rebuilding job. What could that cause?
AiphNday said:
so after i finished,compile with smali and put the classes.dex back inside the jar again right??
Click to expand...
Click to collapse
Yes.
To compile:
Code:
java -jar smali-1.4.0.jar classes_output -o classes.dex
Then make a zip file, place classes.dex into it (the name has to be classes.dex for any JAR).
Rename the zip to a JAR. Then sign it.
XiproX said:
did you try Araxis Merge its paid software, there is a 30 day trial version, and there are some alternative ways of getting the full version. You know... I used it for some time and it was great.. But Im not sure if it has that feature.. You can check if you want.
Click to expand...
Click to collapse
I'll check it out.
XiproX said:
I don't really understand. I mean, the kitchen just does the extracting and rebuilding job. What could that cause?
Click to expand...
Click to collapse
The kitchen does everything automatically, even up to modifying the kernel. That's good and all, but we all have different devices, and the kitchen is too General & Broad when it comes to its porting features. It could brick your device.
Peteragent5 said:
The kitchen does everything automatically, even up to modifying the kernel. That's good and all, but we all have different devices, and the kitchen is too General & Broad when it comes to its porting features. It could brick your device.
Click to expand...
Click to collapse
Well, yes, but Im not telling that we should use its porting tools. I too know that it wouldnt do much of a work even if it worked properly for every device and that the manual way is the best.. Im just talking about 4/5 main functions which are creating WORKING_FOLDER from rom/zip, de-odexing, signing, zipaligning, and finally building(creating zip from WORKING_FOLDER)
How could these features affect the porting process? I dont really think they could. Again Im talking about only these above written features..
XiproX said:
Well, yes, but Im not telling that we should use its porting tools. I too know that it wouldnt do much of a work even if it worked properly for every device and that the manual way is the best.. Im just talking about 4/5 main functions which are creating WORKING_FOLDER from rom/zip, de-odexing, signing, zipaligning, and finally building(creating zip from WORKING_FOLDER)
How could these features affect the porting process? I dont really think they could. Again Im talking about only these above written features..
Click to expand...
Click to collapse
Some of the features you shouldn't use from the kitchen are these:
Making an updater-script/update-binary
Create a working Folder, you can just extract your rom and rename it to WORKING_[highlight]ROM[/highlight]
and it's porting tools
these result to an unsuccessful port.
Peteragent5 said:
Some of the features you shouldn't use from the kitchen are these:
Making an updater-script/update-binary
Create a working Folder, you can just extract your rom and rename it to WORKING_[highlight]ROM[/highlight]
and it's porting tools
these result to an unsuccessful port.
Click to expand...
Click to collapse
"Making an updater-script/update-binary" I agree! I never was using it
"Create a working Folder" Weird. I ported MIUI ics and jellybean both by using this method and it all was fine. Anyways not so important. can live without it.
Peteragent5 said:
Yes.
To compile:
Code:
java -jar smali-1.4.0.jar classes_output -o classes.dex
Then make a zip file, place classes.dex into it (the name has to be classes.dex for any JAR).
Rename the zip to a JAR. Then sign it.
I'll check it out.
The kitchen does everything automatically, even up to modifying the kernel. That's good and all, but we all have different devices, and the kitchen is too General & Broad when it comes to its porting features. It could brick your device.
Click to expand...
Click to collapse
can you help me with this?? http://pastebin.com/7uMdU3EX
i was runout of idea.. :silly:
AiphNday said:
can you help me with this?? http://pastebin.com/7uMdU3EX
i was runout of idea.. :silly:
Click to expand...
Click to collapse
there is a problem with pastebin at the moment(for me). you could try to post the log as an attachment text file?

[Tool][UPDATED v3.5] x-TOOLS - set of GUI-based android engineering tool [12/12/12]

Hello peeps,
I found myself a li'l bit lazy to decompile/re-compile apk files through a command line window each and every time by instructing it
So I decided to build a GUI version of apktool that will help me, and ofcourse others, to decompile and re-build apk files in just a single click.
UPDATED v3.5 with signapk, dex2jar and smali tools.
What is x-TOOLS?
x-TOOLS (previously known as x-APKTool) is a set of GUI-based android engineering tools.
x-TOOLS lets you do forward/reverse engineering in an easy and more convenient way. :good:
Features:
• One-click decompile apk file.
• One-click compile/re-compile edited apk file.
• One-click sign apk and update.zip file.
• One-click conversion of .dex file to .jar file and vice versa.
• One-click conversion of smali files to human readable form and vice versa.
• Detailed logs of output and error (if found).
• Save detailed log in text file.
• Keep recent files record for fast access.
• One-click install framework-res.apk to decompile and recompile stock/custom rom’s dependent apk files.
• One-click install SemGenericUxpRes.apk or resources.apk file.
• Working to build more new features…
Minimum requirements of x-TOOLS:
1. .net framework 3.5 or higher. Download here (if you are on Windows 7 or higher you don’t need to install it.)
2. JRE 1.6 or higher. Download here
NOTE: There was an old problem with Samsung Smali codes that gave error in baksmali process. So if you want to decompile your apk (extracted from Samsung devices), you have to first remove classes.dex file from apk using 7-zip/Winrar and then tried decompiling the apk.
Tested and suggested by aadroid.dev at here
Screenshot:
Attached at bottom of OP.
Changelog:
V3.5:
1. x-APKTool is now formally known as x-TOOLS.
2. Added GUI-based dex2jar tool.
3. Added GUI-based smali tool.
4. Added GUI-based separate apk and update.zip signing tool.
5. Added an option to select,copy and save detailed log in text file. (right click on log window to get these options)
6. Icon improved
7. Added (minor) Google licence info.
8. Fixed some minor bugs.
v1.5:
1. Added automatically signing apk after compilation.
2. Added more info about processing apk file.
3. Added more info about processing apk file.
4. Fixed path name and file name related issues.
5. Fixed a major bug that occurred while forcely decompiling apk file.
6. Fixed some minor bugs.
v1.0:
1. Initial release
Click to expand...
Click to collapse
Download link: download here
Mirror: Download here
Report me for any bug/error. Request/suggestions are always welcome..
i am try.thanks.
error...
=======================================
Re-compiling com.aac.cachemate.apk...please wait...
=======================================
I: Smaling...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Dr\AppData\Local\Temp\APKTOOL635373159047239252.tmp, -I, C:\Users\Dr\apktool\framework\1.apk, -S, C:\Users\Dr\Desktop\com.aac.cachemate\res, -M, C:\Users\Dr\Desktop\com.aac.cachemate\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Dr\AppData\Local\Temp\APKTOOL635373159047239252.tmp, -I, C:\Users\Dr\apktool\framework\1.apk, -S, C:\Users\Dr\Desktop\com.aac.cachemate\res, -M, C:\Users\Dr\Desktop\com.aac.cachemate\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": CreateProcess error=2, Sistem belirtilen dosyay? bulam?yor
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: CreateProcess error=2, Sistem belirtilen dosyay? bulam?yor
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more
===========> Task terminated due to above error(s)! <===========
Are you using the same of apktool you used to decompile the file
Sent from my GT-N7000 using xda app-developers app
klem__ said:
Are you using the same of apktool you used to decompile the file
Sent from my GT-N7000 using xda app-developers app
Click to expand...
Click to collapse
+1
Guys dont be a fool he stole it from here http://forum.xda-developers.com/showthread.php?t=33815550
check his threads.. He is posting it in diffirent forum.
Report to your forum moderator..
m.h.mahadi said:
Guys dont be a fool he stole it from here http://forum.xda-developers.com/showthread.php?t=33815550
check his threads.. He is posting it in diffirent forum.
Report to your forum moderator..
Click to expand...
Click to collapse
Excuse me, before blaming me or spreading spam here and there I just want to ask one thing, did you check my and his tool??
Did you find GUI common?? Do you think that I stole his work?? If you think so then check his and mine work before blaming me
BTW dont spam here and and my other threads, just follow the rules
Apktool shows error while Compiling.
gagan.u20 said:
Excuse me, before blaming me or spreading spam here and there I just want to ask one thing, did you check my and his tool??
Did you find GUI common?? Do you think that I stole his work?? If you think so then check his and mine work before blaming me
BTW dont spam here and and my other threads, just follow the rules
Click to expand...
Click to collapse
Apktool shows error while compiling... please repair this problem....
vishav420 said:
Apktool shows error while compiling... please repair this problem....
Click to expand...
Click to collapse
post the error...
updated to v3.5
see OP.
thanks alot :good: :good: :good:
that's really a great tool
Looks good, I thought it will work but... Nope.
When I decompile a apk it says decompiled, I click on open decompiled folder and the folder is just empty =/
And if I decompile it using another tool, and try to recompile it using this tool it tells me that there's a system file missing (or something like that) and reinstalling x-TOOLS might fix it.
Tried reinstalling a lot but still same problems.
I already installed framework-res.apk and SemcGenericUxpRes.apk (I have Z1)
Regards,
~J2C

[HowTo]Decompile/Compile APKS on Windows

Hey Guys ,
I am writing this small guide for people who have just started off with Android Development recently..
as am not a great developer at my end so any corrections and suggestions are always welcome
Credits : To Vegeta1. He give me the idea and helped me patiently with every question i got to finish this!
To my great Omega Team Mates! You guys and girl know my feelings.
So here we gonna learn how to decompile/recompile/ sign Apks
Things needed :
1. jdk/java Get It from here--> http://www.java.com/en/
2. Apktool: Using any according to your liking is ok or you can get all the Stuff needed In this Link
http://forum.xda-developers.com/showthread.php?t=1755243
Thanks To iBotPeaches For The Superb Tool...
3. Notepad++ to make changes in Xmls
4: winrar/7zip
So first up we are gonna set up the Framework for the current Firmware we are using.
For that get framework-res.apk, twframework-res.apk from your rom. You can always find that in the root location
/system/framework/
So lets say you have placed your apktool in your C:\ drive
now open click on start > run > type cmd ( this is for command prompt )
for example you are on C:\>User. Click in the command line cd.. and hit enter.
You should see now C:\>, as next step you type cd apktool and click enter. Here you see how it should look:
C:\apktool>
Now first up installing framework-res.apk and twframework-res.apk.
Place both these Files in your apktool folder that you have placed in C Drive or any drive you are comfortable with.
Code for Installing frameworks :
C:\apktool>apktool if framework-res.apk
C:\apktool>apktool if twframework-res.apk
this will get both your frameworks installed .
Now decompiling the Apk ...
Lets say you want to decompile SecMms.apk / or any Apk you like
place the Apk in the apktool folder.
Code to decompile the apk:
C:\ apktool > apktool d SecMms.apk
If you done and set up things accordingly your Apks will be decompiled properly
in the apktool folder you have placed in C:\ apktool
you will get the decompiled SecMms folder... so you can now make changes to it
Now the Recompiling Part:
If you have made correct changes it won´t give you any issues :
To recompile the apk the code needed in the command prompt :
c:\ apktool>apktool b SecMms ( its the decompiled Folder , now the original apk )
when you are done with recompiling in the SecMms folder you will get these :
assets
build
dist
res
smali
AndroidManifest.xml
apktool.yml
Now again , if the changes you made are correct the recompiling wont give any issues
Now its still not over we need to sign the apk:
So in your apktool folder you have your Original SecMms.apk file open that with winrar/7zip
and extract
META-INF
AndroidManifest.xml
in the apktool folder and move them to
( Decompiled )SecMms > build > apk >
then again start cmd and again run the recompiling code again one more time
c:\ apktool > apktool b SecMms
this should sign your apk
and the final apk , you will find it in c:\apktool\SecMms\Dist\
.
So Guys that's about it , for decompiling/recompiling/signing your Apks , hope you have no issues and find my post helpful
Chris_84 said:
Hey Guys ,
I am writing this small guide for people who have just started off with Android Development recently..
as am not a great developer at my end so any corrections and suggestions are always welcome
Credits : To Vegeta1. He give me the idea and helped me patiently with every question i got to finish this!
To my great Omega Team Mates! You guys and girl know my feelings.
So here we gonna learn how to decompile/recompile/ sign Apks
Things needed :
1. jdk/java Get It from here--> http://www.java.com/en/
2. Apktool: Using any according to your liking is ok or you can get all the Stuff needed In this Link
http://forum.xda-developers.com/showthread.php?t=1755243
Thanks To iBotPeaches For The Superb Tool...
3. Notepad++ to make changes in Xmls
4: winrar/7zip
So first up we are gonna set up the Framework for the current Firmware we are using.
For that get framework-res.apk, twframework-res.apk from your rom. You can always find that in the root location
/system/framework/
So lets say you have placed your apktool in your C:\ drive
now open click on start > run > type cmd ( this is for command prompt )
for example you are on C:\>User. Click in the command line cd.. and hit enter.
You should see now C:\>, as next step you type cd apktool and click enter. Here you see how it should look:
C:\apktool>
Now first up installing framework-res.apk and twframework-res.apk.
Place both these Files in your apktool folder that you have placed in C Drive or any drive you are comfortable with.
Code for Installing frameworks :
C:\apktool>apktool if framework-res.apk
C:\apktool>apktool if twframework-res.apk
this will get both your frameworks installed .
Now decompiling the Apk ...
Lets say you want to decompile SecMms.apk / or any Apk you like
place the Apk in the apktool folder.
Code to decompile the apk:
C:\ apktool > apktool d SecMms.apk
If you done and set up things accordingly your Apks will be decompiled properly
in the apktool folder you have placed in C:\ apktool
you will get the decompiled SecMms folder... so you can now make changes to it
Now the Recompiling Part:
If you have made correct changes it won´t give you any issues :
To recompile the apk the code needed in the command prompt :
c:\ apktool>apktool b SecMms ( its the decompiled Folder , now the original apk )
when you are done with recompiling in the SecMms folder you will get these :
assets
build
dist
res
smali
AndroidManifest.xml
apktool.yml
Now again , if the changes you made are correct the recompiling wont give any issues
Now its still not over we need to sign the apk:
So in your apktool folder you have your Original SecMms.apk file open that with winrar/7zip
and extract
META-INF
AndroidManifest.xml
in the apktool folder and move them to
( Decompiled )SecMms > build > apk >
then again start cmd and again run the recompiling code again one more time
c:\ apktool > apktool b SecMms
this should sign your apk
and the final apk , you will find it in c:\apktool\SecMms\Dist\
.
So Guys that's about it , for decompiling/recompiling/signing your Apks , hope you have no issues and find my post helpful
Click to expand...
Click to collapse
Great guide Chris... I will try it tomorrow... Thanks for all you do for S3 and Omega community...
Ninolina said:
Great guide Chris... I will try it tomorrow... Thanks for all you do for S3 and Omega community...
Click to expand...
Click to collapse
Thanks Nina! If you got question you know where I am.
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Thanks Chris84. I need this. This guide its wery good. Regards.
Wysłane z mojego GT-I9300 za pomocą Tapatalk 2
wiecho65 said:
Thanks Chris84. I need this. This guide its wery good. Regards.
Wysłane z mojego GT-I9300 za pomocą Tapatalk 2
Click to expand...
Click to collapse
Glade you like it. If you got questions just ask.
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
nice one chris
bala_gamer said:
nice one chris
Click to expand...
Click to collapse
Thank you very much mate! You now it's a honor for me to get such a good feedback from you! Really appreciate that!
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Really glad to be a part of a great team and great team members ....
Good luck my friend
Sent from my GT-I9300 using Tapatalk 2
This is great, you are bringing noobs like me to the next level.
Sent from my GT-I9300 using Tapatalk 2
Chris_84 said:
Thanks Nina! If you got question you know where I am.
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Click to expand...
Click to collapse
I assume it works on Windows? Maybe it will be good to add that to the Title of the Tread. Just a suggestion...
Ninolina said:
I assume it works on Windows? Maybe it will be good to add that to the Title of the Tread. Just a suggestion...
Click to expand...
Click to collapse
Yes it does. Thanks Nina for your suggestion!
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Thnx.
Always welcome a HowTo of this kind...
Verzonden door mijn GT-I9300 met xda premium
vegeta1 said:
Really glad to be a part of a great team and great team members ....
Good luck my friend
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Without you my friend I never had come this far!
KeesStolk said:
This is great, you are bringing noobs like me to the next level.
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
So you're now a advanced noob.
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Hey Chris! Really nice guide you have here, quick & simple. Decompiling worked for me, however, when I try to compile back I get this:
D:\apktool1.5.0>java -jar apktool.jar d BW.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\MM\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-hdpi/forecast_fly_child_bg_pressed.
9.png". Renaming it to *.png.
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
D:\apktool1.5.0>java -jar apktool.jar b BW
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: D:\apktool1.5.0\BW\res/drawable-land-xhdpi
invalid resource directory name: D:\apktool1.5.0\BW\res/drawable-xhdpi
invalid resource directory name: D:\apktool1.5.0\BW\res/drawable-xhdpi-v11
invalid resource directory name: D:\apktool1.5.0\BW\res/drawable-xxhdpi
invalid resource directory name: D:\apktool1.5.0\BW\res/layout-xlarge
invalid resource directory name: D:\apktool1.5.0\BW\res/layout-xlarge-land
invalid resource directory name: D:\apktool1.5.0\BW\res/values-sw600dp
invalid resource directory name: D:\apktool1.5.0\BW\res/values-w360dp
invalid resource directory name: D:\apktool1.5.0\BW\res/values-w480dp
invalid resource directory name: D:\apktool1.5.0\BW\res/values-w500dp
invalid resource directory name: D:\apktool1.5.0\BW\res/values-w600dp
invalid resource directory name: D:\apktool1.5.0\BW\res/values-xlarge
invalid resource directory name: D:\apktool1.5.0\BW\res/values-xlarge-land
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, --min-sdk-version, 8, --target-sdk-vers
ion, 17, -F, C:\Users\MM\AppData\Local\Temp\APKTOOL3965827226790767193.tmp, -I,
C:\Users\MM\apktool\framework\1.apk, -S, D:\apktool1.5.0\BW\res, -M, D:\apktool1
.5.0\BW\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:255)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 8, --target-sdk-version, 17, -F, C:\Users\MM\AppData\Local\Temp\APKTO
OL3965827226790767193.tmp, -I, C:\Users\MM\apktool\framework\1.apk, -S, D:\apkto
ol1.5.0\BW\res, -M, D:\apktool1.5.0\BW\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:253)
... 6 more
Click to expand...
Click to collapse
I installed both frameworks & updated java, tried from both hdd partitions. Then I tried a different apktool version, happens again. Do you have any idea what could be the reason for this? Maybe the fact I have 2 java versions installed (v5.0 update 12 & v7 update 10).
MMWolverine said:
Hey Chris! Really nice guide you have here, quick & simple. Decompiling worked for me, however, when I try to compile back I get this:
I installed both frameworks & updated java, tried from both hdd partitions. Then I tried a different apktool version, happens again. Do you have any idea what could be the reason for this? Maybe the fact I have 2 java versions installed (v5.0 update 12 & v7 update 10).
Click to expand...
Click to collapse
I could only imagine that is not compatible this the framework you use. I get the same yesterday then I was trying recompile again Google plus. Decompile no problem but recompile give me error. Sounds a little bit crazy but what you can try is decompile with stock framework and recompile it with the one from omega or try it the other way decompile with omegas framework and recompile with stock framework. But between the steps you got install the framework new.
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Thanks, I'll test it & report back.
MMWolverine said:
Thanks, I'll test it & report back.
Click to expand...
Click to collapse
Your feedback is much appreciated! Thanks my friend!
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Ok, tried with XXELL5 stock framework and tested some others as well, but no luck I'm afraid. The app is BeautifulWidgets, which I'm trying to translate into Slovenian language. The problem is I cannot even recompile unchanged folders/files, let alone changing strings.xml. So the pursue for a solution continues.
MMWolverine said:
Ok, tried with XXELL5 stock framework and tested some others as well, but no luck I'm afraid. The app is BeautifulWidgets, which I'm trying to translate into Slovenian language. The problem is I cannot even recompile unchanged folders/files, let alone changing strings.xml. So the pursue for a solution continues.
Click to expand...
Click to collapse
That's very strange. I will take look at that cause I even turned on my laptop. Will keep you informed.
Edit: Mate I checked it. And I also fail. The strange thing is I got also an older apk from version 4 of beautiful widgets and had no problem with it. Then I checked the newer version 5 and then the failure set in. I tried to take the files like android manifest from the older apk but still fail.
Throwing out of the window from my flying Ferrari killer S3 driven by a proud omega team member
Guys can you post the apk here ?? Il try it out tomorrow... as im gonna fall asleep any moment...
Sent from my GT-I9300 using Tapatalk 2

[TUT]Series of guides to become a PRO DEV!!!!!!

[Hey guys Aditya here. After a month or so i'm posting tutorial and basic decompiling compiling using adb command!
THINGS YOU WILL NEED​
ON WINDOWS PC
1) Winrar
2) 7zip
3) Java
4) Apktool and adb tools!!!!! (Many tools are available download anyone of them)
5) notepad+ AWESOME THING
ON UBUNTU
1) Java
2) Android SDK
3) APKTOOL ofcourse
Let's get started! I asume you using a Windows PC
First of all download and install JAVA
From here
Download Latest Apktool, extract to :
Windows XP : C:\Document and setting\folder your computer name
Windows 7 : C:\user\folder your computer name
copy your apk & framework-res.apk/SemcGenericUxpRes.apk/framework 2 to same folder with apktool
Now you can start Editing apk
Example Editing Walkman
Open Command Prompt (CMD)
TO DECOMPILE
Code:
java -jar apktool.jar if framework-res.apk
java -jar apktool.jar d semcmusic.apk ( can be whatever name you give to your apk )
Some apks need dependies like tw-framework.apk
Code:
java -jar apktool.jar if framework-res.apk
java -jar apktool.jar if semcgenericuxpres.apk
java -jar apktool.jar d your.apk ( can be whatever name you give to your apk )
Now you can edit what you like to. E.g. Res layout etc!
(For more detalis refer Post #3)
TO COMPILE
To compile back the edited apk
Code:
java -jar apktool.jar yourapkname.apk
For signing apk just drop the android manifest and meta inf of older apk or original apk!!!!!!
F.A.Q
A.I'm getting error while compiling apk??
Check if you have installed framework-res.apk most of compiling errors are becoz of this
B.Can apktool batch decompile and recompile apk's??
Yes,many of modded apk manegers or tools can batch decompile and recompile apk's!!
C.Can i MOD any system app using apk tool?
Yes it can mod all types of apk's just make sure you have correctly installed framework and all other dependices!!!!
D.My modded apk is not working! What should i do???
This question is mostly asked to me! Firstly check weather you have put the Meta-Inf from original APK as this folder contain signatures required for apk to get install.Secondly if you have modded some xml check its correct or some code or values are wrong.If any values or wrong code can lead us to FC or Bootloop..!!!
Using ADB and taking logcat!!!!!
USING ADB AND TAKING LOGCAT
What ia adb??
adb stands for Android Debugging Bridge
For what it is used for
adb is commonly used to pull,push,taking system dumpFOR TAKING LOGCAT
What you will need
On windows
1) Java (Hmmm not needed but u should have. )
2) adb tools by me http://d-h.st/vHJ
Now to make it easy first of all check you have enabled USB Debugging in phone its in Developer Options.
PROCDURE
Make a new folder in C Drive
Extract these tools into it (Asume you folder name is adb)
Now open cmd
Code:
type cd..
cd.. again
cd adb
adb
Now you have installed adb on your PC!
TAKING LOGCAT
Code:
adb logcat>logcat.txt
For only redio related log type
Code:
adb -r logcat>logcatr.txt
For only errors type
Code:
adb -v logcat>logcate.txt
Push and pulling apps from system!
Pushing Apps
Pushing app is installing app on its intenrnal memory!Its simple and doesn't need extra powers!
Code:
adb push yourappname.apk /system/app or /system/framework
Place the app in the adb folder
Pulling Apps
Pulling app is to take out your system apps or frameworks etc!
Code:
adb pull /system/app or /framework yourapp.apk
By this method you can take a system dump
Code:
adb pull /system
Understanding Logcats!!!!!
Some keyword's that represent's error'
Code:
"E/" - error
"E/dalvikvm" - possibly crucial system error
"No such file or directory" - says it all
"couldn't" - android likes that, mostly shows faulty things.
"fail"/"failed" - mostly crucial error
"W/"/"warning" - says it all, but not always warn could be a boot failure cause
"exception"(especially NullPointerException) - points you that something went wrong in framework or application work
These type of errors help us understand the error's and we can easily call out from these bugs or errors!!!
Most common errors occuring in an logcat!
"couldn't find native method", the most common reason of a bootloop.
This error causes most of bootloop problems!!!
For example
Code:
E/dalvikvm( 100): ERROR: couldn't find native method
E/dalvikvm( 100): Requested: Landroid/view/GLES20Canvas;.nStartTileRendering:(IIIII)V
E/JNIHelp ( 100): RegisterNatives failed for 'android/view/GLES20Canvas', aborting
As you can see! The main reson for this error is smali present in android/view of framework.jar called GLES20Canvas.smali
This happens while you are trying to port ROMS!!!!
Now if you are having bugs in other apkor jars how can u find ahem! i.e logcat gives us only the location of smali files and not the name of apk or jar! For that you have to study hole android code sources! Some common folders i have posted here!!
Code:
"com/android/server" - services.jar (there is the same folder at framework.jar but most likely you don't need to touch it).
another place we could be mixed up:
"com/android/internal" - framework.jar
"com/android/internal/policy/impl/" - android.policy.jar
for framework.jar path ends up on internal, which represents telephony folder. policy/impl is the only android.policy.jar folder.
Other frameworks are actually not used in port as they contain core android functionality which is common.
Simple MOD's
Now you guy's have idea about how to take a Logcat,use adb,use apktool.
NOW SOME REAL STUFF
MOD's Related to SystemUI.apk
We will start with simple MOD's! Like replacing icons and to some extend changing layout!
Now we will start will replacing icons inside the SystemUI.apk
First of all pull app from /system/app using adb Refer #2
Then copy that app to apktool folder! Type this cmd
Code:
java -jar apktool.jar d SystemUI.apk
Now go to out folder of SystemUI.apk!
Will find META-INF! RES! ANDROID.manifest
Now Navigate to res/drawable-hdpi as our device uses HPDI
You will find many icons now be carefull here! If youare expert n photoshop or any bitmap editor eit these icons! Or search it! Google it you will find many!
Replace these default icons by ur edited once or downloaded once!!
XML EDITING
Some XML's are not so complicated as other once! Some xml's have just true or false! Example
Code:
<bool name="config_hardwareAccelerated">true</bool>
This tells me that Hardware Acceleration is enabled you can disable it by replacing true by false! You just need to experiment around!
Smali Editing!
Coming soon!
Patching!
Coming soon :d
Changelog
CHANGELOG
1 July Monday 6.04pm -- Inital Editing
Old info but very usefull for noobs. Keep it up
:thumbup:
Hit thanks if you think I helped you.
Sent from LG Nexus 4
Thats really awesome keep it coming am a noob and I rly want to learn n b a part of z dev team
Sent from my GT-I9082 using xda app-developers app
For apk editing there are many 3rd party softwares which doesn't requires one to write such huge codes for signing and etc .
Kinda old method
Make.Believe
Razor! said:
For apk editing there are many 3rd party softwares which doesn't requires one to write such huge codes for signing and etc .
Kinda old method
Make.Believe
Click to expand...
Click to collapse
Yup . Like chotu tools
Sent from my GT-I9082 using xda premium

Preshared library loading error

Hi all,
i am kinda new here, so this might not be the best section to post such topic, so if there is more appropriate section would be good if moderators would move it there.
Now lets go to the problem:
I have downloades master revision of AOSP from git. Compiled all OS source in linux. After that compiled native/cmds/screenshot source with mmm command, just before compiling changed so that it would produce me shared library with .so extension instead of executable.
This way I got predefined shared library which I attached to hello-jni sample app from android-ndk-r10.
Everything compiled and built in eclipse without any errors, and I install that app on physical device (tried on samsung galaxy s2 with android 4.1.2 and samsung galaxy s5 with android version 4.4) Everything here is still ok, but if i try opening that app i am getting such error:
Code:
08-08 15:32:33.832: E/AndroidRuntime(12001): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]: 1694 cannot locate '__strrchr_chk'...
and this happens when i try loading that screenshot library with such code:
Code:
static {
System.loadLibrary("screenshot");
}
If anyone has had similar problems or have any ideas what might be wrong, I am happy to hear it.

Categories

Resources