Rate This Document
Findability
Accuracy
Completeness
Readability

Reconstructing a Java or Python Application

You can reconstruct Java or Python applications and upload application source files and software packages for analysis. The tool then generates an analysis report and provides suggestions.

Prerequisites

  • You have logged in to the Kunpeng DevKit.
  • The Development Assistant has been installed.

Procedure

  1. Click in the shortcut menu bar on the left pane or click next to Development Assistant. The Kunpeng Application Projects page is displayed. See Figure 1.
    Figure 1 Kunpeng Application Projects
  2. Click Secure Computing Application. The Secure Computing Application page is displayed. See Figure 2.
    Figure 2 Secure Computing Application
  3. Click Java/Python Application. On the left pane of the displayed page, select Java/Python application reconstruction for Task Type, select Application source code or Software package for Analysis Type, and configure other parameters as required.
    Figure 3 Analyze C/C++ Source Code deselected
    Figure 4 Analyze C/C++ Source Code selected
    Figure 5 Software package
    Table 1 Parameter settings (1)

    Parameter

    Description

    Task Type

    Task type, which can be:

    • Project creation
    • Java/Python application reconstruction

    Analysis Type

    Analysis type, which can be:

    • Application source code
      NOTE:

      If you select Analyze C/C++ Source Code, the C/C++ source code will be analyzed. You need to select a build tool and enter the compile command.

    • Software package

    Source File Path

    Path of the source file.

    Build Tool

    Build tool, which can be:

    • make
    • cmake
    • automake

    Currently, only GCC 7.3.0 is supported.

    Compile Command

    Commands for compiling files.

    Software Package

    Upload the software package to be analyzed.

    (Optional) Signature Private Key

    Import the signature private key.

    (Optional) Signature Certificate

    Import the signature certificate.

    (Optional) Compilation Output Directory

    Stores compiled binary files.

  4. Click Analyze. A dialog box is displayed indicating that an analysis for application reconstruction is in progress.
    Figure 6 Analyzing for application reconstruction...
  5. After the analysis is complete, the Analysis Report on Java/Python Application Reconstruction page is displayed. See Figure 7 and Figure 8. The application reconstruction analysis report varies according to analysis types. For example, the source file reconstruction analysis report displays the dependency files and source files to be ported. You can perform the porting based on your requirements. In addition, you can download reports (.csv and .html) and view applications and recommended code on the report page.
    Figure 7 Source file reconstruction analysis report
    Figure 8 Software package reconstruction analysis report
    Table 2 Parameters in a source file reconstruction analysis report

    Parameter

    Description

    Dependency file statistics

    Displays statistics on the number of dependency files to be ported, source files to be ported, and the code lines to be modified.

    Dependency Files to Be Ported

    Displays SO files including dynamic library files, static library files, software packages, and executable files. You can perform the porting according to the suggestions. For details, see Instructions on Using the Confidential OS SDK.

    Source Files to Be Ported

    • Displays the total number of source files to be ported and the number of code lines to be modified. You can click View Suggested Source Code in the Operation column to view the suggestions.
    • The file types include C/C++ source file, makefile, Python, Java and ASM file. You can filter specific file types to view.
    Table 3 Parameters in a software package reconstruction analysis report

    Parameter

    Description

    Dependency File Statistics

    Displays statistics on the number of dependency files to be ported, compatible source files, incompatible source files, and incompatible POSIX interfaces.

    Dependency Files to Be Ported

    • Displays SO files including dynamic library files, static library files, software packages, and executable files.
    • The architecture types include x86_64 or AArch64.
    NOTE:
  6. Click Task Configuration on the report page to view the task configuration information.
    Figure 9 Viewing configuration information