Tuesday, September 9, 2014

Extract Source Code from Android APK file

Procedure for decoding .apk files, step-by-step method:
Step 1:
Make a new folder and put .apk file in it (which you want to decode). Now rename the extension of this .apk file to .zip (eg.: rename from filename.apk to filename.zip) and save it. Now you get classes.dex files, etc. At this stage you are able to see drawable but not xml and java files, so continue.
Step 2:
Now extract this zip apk file in the same folder (or NEW FOLDER). Now download dex2jar from this linkhttp://code.google.com/p/dex2jar/ and extract it to the same folder (or NEW FOLDER). Move the classes.dex file into the dex2jar folder. Now open command prompt and change directory to that folder (or NEW FOLDER). Then write dex2jar classes.dex and press enter. Now you get classes.dex.dex2jar file in the same folder. Then download java decompiler from http://jd.benow.ca/ and now double click on jd-gui and click on open file. Then open classes.dex.dex2jar file from that folder. Now you get class files and save all these class files (click on file then click "save all sources" in jd-gui) by src name. At this stage you get java source but the xml files are still unreadable, so continue.
Step 3:
Now open another new folder and put these files
1.      put .apk file which you want to decode
2.      download apktool v1.x AND apktool install window (both can be downloaded at the same location) and put in the same folder
3.      download framework-res.apk file and put in the same folder (Not all apk file need framework-res.apk file)
4.      Open a command window
5.      Navigate to the root directory of APKtool and type the following command: apktool if framework-res.apk (Try below trobleshooting if not working)
6.      apktool d "fname".apk ("fname" denotes filename which you want to decode)
now you get a file folder in that folder and now you can easily read xml files also.
Step 4:
It's not any step just copy contents of both folder(in this case both new folder)to the single one
and now enjoy with source code...


Troubleshooting:
1. From Step 3-->point 5 --> apktool is not recognize as an internal command.
Solution: This may be a PATH problem,do this:
PATH=%PATH%;ApkToolPath
ApkToolPath is the directory where apktool is.
BTW, u need to download 2 files: apktool-install-windows-r05-ibot.tar.bz2 and apktool1.5.2.tar.bz2. extract both and put aapt.exe apktoo.bat apktool.jar together.

Wednesday, December 11, 2013

Thursday, April 18, 2013

Implement Auto Suggestions in iOS/iPhone/iPad


A tutorial to implement auto suggestion while typing in iPhone. Below is the link to download a source code. Let me know for any query.



Download Source Code : AutoSuggestion_iOS

Monday, March 4, 2013

Core Data Simple Tutorial (Step-wise)

Conquer/Control over the greatest enemy of iOS developer- app crash on iPhone


Thousands discover and download the iPhone application; very few know how to develop these logical software programs.  While trying to develop a mobile engagement platform, for the iPhone; the application crashed several times not just on the device but also on the simulator.  If reports of each crash were to be reported, around 3 pages of crash logs could be traced within a week’s effort. An application crash is the most common issue for any developer; however every developer needs to sail through it to gain control over the software development process. This article will provide a checklist and some suggestions that could help you survive any iPhone crash! How did one find that the application has stopped working? Mostly, it is the tester or the user who complains about the app not running in their iPhone X version. Here’s what a developer must do to initiate instant recovery. A complete checklist that helps every iPhone developer to recover from an application crash has been listed below:


  • Reactions that cause an application to crash- trace back program files and logs.
  • Unlike other smartphones, iPhone needs the application binary and source code execution list to trace the program logs.
  • Keep a record of every crash filed appropriately for future reference.
  • Refer search engines for past experiences of similar crashes
 Most of the time the application is inoperable due to some actions performed within the codes written for the iPhone. Though client side crashes are also not so rare. Every time the iPhone is deployed on the client platform, it runs into numerous issues. However; same application might work perfectly on iOS simulator/testing device. One could find many blogs/sites who elaborate the problems and solutions. Nevertheless, when it occurs at a remotely distant user ased location, the pros and cons are indeed a heavy expenditure. It affects product sales and thereby creates more headaches for developers. There is no perfect solution yet, certain methods enumerated below could help one avoid these types of problems using try-catch block.


This is common practice among other platform developers to use try catch block while programming but for the ios developer there is nowhere written example found on world wide web or if found then the(they) do not suggest to use this, I don’t know why!!!!!

I am using try catch blocks while programming and it is working great, if application somewhere going to crash then catch block will be called and no affect in User interface and the developer can generate/throw message to user there is some error and try again later. So iOS developers now can smile to know that there app will not crash anymore <but> they want that errors should be solved with another version release. To track those errors, we have lots of option: 


  1. when compiler goes to catch block, you can hit API or URL and can send error description and method name/class name to log on server or you can use PL crash reporter. 
Integrate crash reporter in one single line
Tutorial: http://www.youtube.com/watch?v=vf-u9U61WkI


  1. You can open mail composer on iOS app when error occurs and user will press send mail to you.
Many….many….many alternatives. Sky is the limit

Wednesday, December 12, 2012

Self-care is the secret to performing at the highest level.

Here are the six simple rituals he uses to perform at his highest, which you too can begin implementing right away:

1. Drink a glass of water when you wake up. Your body loses water while you sleep, so you’re naturally dehydrated in the morning. A glass of water when you wake helps start your day fresh. When do you drink your first glass of water each day?
2. Define your top 3. Every morning Mike asks himself, “What are the top three most important tasks that I will complete today?” He prioritizes his day accordingly and doesn’t sleep until the Top 3 are complete. What’s your "Top 3" today?
3. The 50/10 Rule. Solo-task and do more faster by working in 50/10 increments. Use a timer to work for 50 minutes on only one important task with 10 minute breaks in between. Mike spends his 10 minutes getting away from his desk, going outside, calling friends, meditating, or grabbing a glass of water. What’s your most important task for the next 50 minutes?
4. Move and sweat daily. Regular movement keeps us healthy and alert. It boosts energy and mood, and relieves stress. Most mornings you’ll find Mike in a CrossFit or a yoga class. How will you sweat today?
5. Express gratitude. Gratitude fosters happiness, which is why Mike keeps a gratitude journal. Every morning, he writes out at least five things he’s thankful for. In times of stress, he’ll pause and reflect on 10 things he’s grateful for. What are you grateful for today?
6. Reflect daily. Bring closure to your day through 10 minutes of reflection. Mike asks himself, “What went well?” and “What needs improvement?” So... what went well today? How can you do more of it?
Courtesy: Fast Company (Click here for complete article)