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;

Monday, 29 September 2014

Create a Windows Project in VS2008


Create a new project from File | New | Project. Provide a name instead of the default name (WindowsApplicaiton1). This is changed to ReportDesign for this tutorial as shown in the next figure. VS 2008 supports multi-version targeting. In the top right of the New Project window you can see that this report is targeted for the NET 2.0 Framework Version and can be published to a Net 2.0 web site.
Creating a Simple Report with Visual Studio 2008
Slightly enlarge the Form1. Drag and drop the Microsoft Report Viewer control shown in the next figure on to the form from the Toolbox.
Creating a Simple Report with Visual Studio 2008
This has the same functionality as the ReportViewer control in VS 2005 as shown in the next figure.
Creating a Simple Report with Visual Studio 2008
The control will be housed on the form as shown in the next figure. You can display the tasks needed to configure the Report Viewer by clicking on the Smart Task as shown in the same figure. The report will have all the functionalities like print, save to different formats, navigating through pages, etc.
Creating a Simple Report with Visual Studio 2008

Working with the Report Wizard

Now click on the Design a new report task. The opens the Report Wizard window as shown in the figure.
Creating a Simple Report with Visual Studio 2008
Read the instructions on this page carefully. Click on the Next Button. This displays the Data Source Configuration Wizard shown in the next figure.
Creating a Simple Report with Visual Studio 2008

Choosing a Data Source

The application can obtain data from these different resources. Click on the Database icon and then click on the Next button.
This displays the window where you need to select a connection to the data source. If there are existing connections you should be able to see them in the drop-down list box.
Creating a Simple Report with Visual Studio 2008

Making a Connection to Get Data

Click on the New Connection button. This brings up the Add Connection window showing a default connection to a Microsoft SQL Server Compact 3.5.NET Framework Data Provider. It also shows the location to be My Computer.
Creating a Simple Report with Visual Studio 2008
This source can be changed by clicking on the Change... button. This will bring up the Change Data Source window where you can choose.
Creating a Simple Report with Visual Studio 2008
As found in this version you have the following options:
  • Microsoft SQL Server option lets you connect to SQL 2000 or 2005 using the .NET Framework Data Provider for SQL Server.
  • Microsoft SQL Server Compact 3.5 lets you connect to a database file.
  • Microsoft SQL Server Database File lets you connect to a Local Microsoft SQL Server Instance including a SQL Express. Although it is not explicitly stated what these versions are.
For this tutorial the Compact 3.5 will be used (also uses a .NET Framework Data Provider of Compact 3.5).
Click on the OK button in the Change Data Source window.
VS 2008 installation also installs a database file on the computer for the SQL Server Compact 3.5.
Click on Browse button (you could also create one if you like, herein it will be browsed). This brings up theSelect SQL Server Compact 3.5 Database File window with the default location where the database file is parked as shown in the next figure.
Creating a Simple Report with Visual Studio 2008
Click on the Northwind icon in the window and click on the Open button. This updates the Add Connection window with this information as shown in the next figure.
You may test the connection by hitting the Test Connection button which should display a successful outcome as shown in the next figure. There is no need for a password as you are the owner.
Creating a Simple Report with Visual Studio 2008
Click OK twice and this will take you back to the Data Source Configuration Wizard updating the connection information which you may review as shown in the next figure.
Creating a Simple Report with Visual Studio 2008
Click on the Next button. This brings up the Microsoft Visual Studio message window giving you the option to bring this data source to your project.
Creating a Simple Report with Visual Studio 2008



(For more resources on Microsoft, see here.)
Click on the Yes button. This adds the Data Source to your project and it will now appear in the ReportDesign project folder as Northwind.sdf. The Save the Connection String to the Application Configuration File section of the wizard also pops-up as shown.
Creating a Simple Report with Visual Studio 2008
Accept the default and click on the Next button. The window retrieves the database objects as shown in the next figure where the Tables object is shown expanded.
Creating a Simple Report with Visual Studio 2008
To keep matters simple the Customers table data will be used in fashioning this report. Place a check mark for the Customers and expand the Customers table node as shown. Also choose the columns that should appear in the report by choosing them with check marks as shown.
Creating a Simple Report with Visual Studio 2008

Designing the Report

When you click on the Finish button you will add a NorthwindDataSet to the Project. Click on the Finish button. This adds a NorthwindDataSet.xsd file to the Project and a new wizard, Report Wizard pops-up requiring you to select the data source. It will display the columns you selected in the earlier step.
Creating a Simple Report with Visual Studio 2008
You get a chance to add another data source at this point should you choose to do so. Here only the data chosen earlier will be used. Click on the Next button.

Choosing a Report Type

This opens the window where you may choose the type of report. Tabular is appropriate for the selected data.
Creating a Simple Report with Visual Studio 2008

Grouping the Data

Click on the Next button. In the window that opens you may choose to group the data in any fashion you think appropriate. In this tutorial it will be grouped under 'City' field. For designing meaningful reports it will be necessary to know the data well. The grouping is as shown in the next figure although this may not be the best.
Creating a Simple Report with Visual Studio 2008

(For more resources on Microsoft, see here.)

Choosing Layout of Data

Click on the Next button to display the window where you may choose a table layout. A stepped layout is chosen as shown.
Creating a Simple Report with Visual Studio 2008

Choosing a Report Style

Click on the Next button to display the style for the report one may choose. Here the 'Corporate' style is chosen as shown.
Creating a Simple Report with Visual Studio 2008
Clicking on the Next button brings up the summary page for the report as shown.
Creating a Simple Report with Visual Studio 2008
Click on the Finish button. After a while the the report design shows up as Report1.rdlc[Design] as shown in the next figure.
Creating a Simple Report with Visual Studio 2008
The Report title is Report1 which can be changed by clicking in this field and typing it over (in the last figure you see this has been changed). It may also be suitably positioned and formatted. The Page level is shown by =Fileds!Customer ID.Value and the grouping by city by =Fields!City.Value under each page.
Now the Project should contain the items shown in the next figure.
Creating a Simple Report with Visual Studio 2008
Further design changes can be made to the report as needed.

Displaying the Report

Build the project, ReportDesign and you can see the report by clicking on the green arrow in the toolbar menu. Presently you will see an empty report. The design of the report and the Data Source were independently designed although it appeared like a continuous process. You still need to add a data source to the report.

Adding the Data Source to the Report

Click on the ReportViewer's Smart task and choose the default displayed.
Creating a Simple Report with Visual Studio 2008
Click on Choose Data Sources which displays the next window shown.
Creating a Simple Report with Visual Studio 2008
Click the OK button on this screen. Now build the project and run the form with the green arrow menu item.
This brings up the form and after a little processing the report gets displayed.
Creating a Simple Report with Visual Studio 2008

Date selections Max in C#

dtpFrTotsale.MaxDate = DateTime.Today;
 dtpToTotsale.MaxDate = DateTime.Today;

Thursday, 18 September 2014

how to show hiden files in Pendrive using Cmd prompt


please chose your pen drive path

ex: G:

Write this code


G:\> attrib -h -s -r /s /d *.*     then press enter

Friday, 5 September 2014

how to print page footer last page only using CrystalReport

Step 1:
Select page footer item  (Right Click)
step 2:
Select format object or Format Multiple Object 
now to open the screen
Please tick Suppress Check box and click X+2  ( marked column )






Step 3:
Put this code in X+2 
 PageNumber <> TotalPageCount
and click Save and Close





thanks