Tuesday, 18 November 2014

Extract source code (Java and XML) from Android APK File


Not getting any idea how to make good layout in Android activity or not getting how any application doing that things which you want in your project but you don’t know how to implement it in your APK File. So, I came here with new technology & new thinking which can make you crazy in android world.

Now time for backtracking…start your time to do hacking. Do you know you can get source code of Android APK file? Time to break the code..Let’s learn step by step.

In this tutorial we will learn how to convert android APK file into source code. Android .apk file is a compressed form of a file which contains Java classes (in .dex form), XML files and all necessary files. So first we will learn how to get Java source File from android apk using dex2jar and Java decompiler tools and then we will learn how to get XML source file using apktool and apkinstall tools.

To get the source code from APK file, we will need these tools:

1. dex2jar
2. java decompiler
3. apktool
4. apkinstall

Steps to get source:- 

Get Java files from APK:-

1. Rename the .apk file into .zip file (example SharedPr.apk into SharedPr.zip).
2. Extract SharedPr.zip file and copy classes.dex file from extracted folder.
3. Extract dex2jar.zip and paste classes.dex into dex2jar folder.
3. Open command prompt and change directory to the dex2jar folder. Then write dex2jar classes.dex and press enter. Now you will get classes.dex.dex2jar file in the same folder.

How To Get JAVA Code And XML Code From APK
Convert classes.dex to classes.dex.dex2jar
4. Now double click on jd-gui(Java decompiler) and click on open file. Then open classes.dex.dex2jar file from that folder. Now you will get class files and save all these class files (click on file then click “save all sources” in jd-gui) by src name.

How To Get JAVA Code And XML Code From APK
classes.dex.dex2jar will be in dex2jar folder


How To Get JAVA Code And XML Code From APK
Save All Java Files

Get XML files from APK:-

1. Extract apktool and apkinstall in a folder(Example : New Folder).
2. Put SharedPr.apk(your apk file) in same folder(i.e New Folder).

How To Get JAVA Code And XML Code From APK
Keep Android Apk File with apktool and apkinstall

3. Open the command prompt and go to the root directory(i.e New Folder).
4. Type command on command prompt: apktool d SharedPr.apk

How To Get JAVA Code And XML Code From APK
Get All XML Files In Resource Folder

5. This will generate a folder of name SharePr in current directory (here New Folder) and all XML files will be in res->layout folder.

How To Get JAVA Code And XML Code From APK
See All XML Files in new created Folder

Now you have source code. If you have any doubts please comment. Share and help others.

Saturday, 15 November 2014

how to set ten digit Seecrate code in c#

 private void seeCode()
        {
            label1.Text = "";
            DateTime dAdt = DateTime.Parse(dateTimePicker1.Text);
            Int32 fdd = dAdt.Day;//.ToString();
            Int32 fmm = dAdt.Month;//.ToString();
            int adm1 = Convert.ToInt32(fmm);
            Int32 fyyyy = dAdt.Year;//.ToString();
            string adm = fdd .ToString ()+ adm1.ToString() + fyyyy.ToString();

            MessageBox.Show(adm.ToString());
            textBox1.Text = adm.ToString();
            char[] chararray = this.textBox1.Text.ToCharArray();
            Array.Reverse(chararray);
            textBox2.Text = "";
            for (int i = 0; i <= chararray.Length - 1; i++)
            {
                textBox2.Text += chararray.GetValue(i);
            }
           // textBox2.Text = "";

            string sam = textBox2.Text;
           

            int num =Convert .ToInt32 (sam); //Convert.ToInt32(Math.Truncate(sma));//Convert.ToInt32(sma);
           
            string code;

            while (num != 0)
            {
                int r = num % 10;


                switch (r)
                {
                    case 1:
                        code = "One";
                        break;
                    case 2:
                        code = "Two";
                        break;
                    case 3:
                        code = "Three";
                        break;
                    case 4:
                        code = "Four";
                        break;
                    case 5:
                        code = "Five";
                        break;
                    case 6:
                        code = "Six";
                        break;
                    case 7:
                        code = "Seven";
                        break;
                    case 8:
                        code = "Eight";
                        break;
                    case 9:
                        code = "Nine";
                        break;
                 
                    default:
                        code = "Zero";
                        break;

                }

               
                label1.Text = label1.Text + code;
                int q = num / 10;

                num = q;

               
            }

        }

how to set back color in web form using c#.net windows applications

you can write this code on example.cs

initialize component

 Color color = ColorTranslator.FromHtml("#CFE0F7");
            this.BackColor = color;