tree: b9c43a6eefe3b8606399fd960d8039b3783d677f [path history] [tgz]
  1. AdbWinApi.dll
  2. AdbWinUsbApi.dll
  3. androidthings.png
  4. atft.py
  5. atft_unittest.py
  6. atftman.py
  7. atftman_unittest.py
  8. athings_icon.png
  9. config.json
  10. cw.png
  11. download.png
  12. eraser.png
  13. fastboot
  14. fastboot.exe
  15. fastboot_exceptions.py
  16. fastbootsh.py
  17. fastbootsh_unittest.py
  18. fastbootsubp.py
  19. fastbootsubp_unittest.py
  20. LICENSE
  21. operation_start_p256.bin
  22. operation_start_x25519.bin
  23. pie-chart.png
  24. README.md
  25. rocket.png
  26. selected.png
  27. serialmapperlinux.py
  28. serialmapperwin.py
at-factory-tool/README.md

Android Things Factory Tool (ATFT)


This repository contains codes for Android Things Factory Tool.

What is it?

The Google Android Things Factory Tool (ATFT) helps factory partners with key provisioning and security related operations. It provides a user interface to issue commands between a product device and an Android Things Factory Appliance (ATFA). For detail please refer to user guide.

How to Run

If you already have a prebuilt version of the tool.

Windows

  1. Download Microsoft Visual C++ Compiler for Python 2.7 from [this link] (https://www.microsoft.com/en-us/download/details.aspx?id=44266).

  2. Install the Microsoft Visual C++ Compiler for Python 2.7 following the instruction on the link.

  3. Execute the exe file ‘atft.exe’ under ‘AThings-Factory-Tool’ folder.

Linux

  1. Execute the file ‘atft’ under ‘AThings-Factory-Tool’ folder. Run:

    cd AThings-Factory-Tool; ./atft

How to Build and Run From Source Code

Windows

  1. Make sure you have python 2.7 installed. (The tool is not compatible with python 3.0)

  2. Install the following python packages:

    • wxPython 4.0.0 or above
    • passlib 1.7.1
  3. Checkout this git repo to a temporary directory.

  4. Create a working folder named ‘AThings-Factory-Tool’

  5. Copy the whole ‘repo/at-factory-tool’ folder to the ‘AThings-Factory-Tool’ directory.

  6. Copy the license files to the ‘AThings-Factory-Tool’ directory:

    • repo/NOTICE
    • repo/MODULE_LICENSE_APACHE2
    • repo/LICENSE
  7. Goto the ‘AThings-Factory-Tool/at-factory-tool’ folder.

  8. Create a text file called GIT_COMMIT, fill its content with the git commit number to keep track of which commit you checked out.

    You could use the following command to get the commit number, run under the checked out repo directory: git log

  9. Edit ‘config.json’ using your text editor. (Notepad would not show the format correctly, use sublime or notepad++ or other advanced text editors instead)

    Change the value for “LOG_DIR” to a directory to store the log file. This default needs to be changed because ‘/tmp/atfa_log’ does not exist on Windows.

    Change the value for “AUDIT_DIR” to a directory to store the audit file. This default needs to be changed because ‘/tmp/atfa_audit’ does not exist on Windows.

  10. Open a command line, run

    python atft.py

    Make sure the program runs without error.

  11. If you want to create a bundled executable file that includes all the dependencies, make sure you have python package PyInstaller installed.

    You could use the following command:

    pip install pyinstaller

    to install.

  12. In a command line window, run

    cd [the AThings-Factory-Tool/at-factory-tool folder]

    pyinstaller --noconsole atft.py

    This would create a folder containing all the dependencies and the executable file. The ‘--noconsole’ tells the bundled binary not showing a command line window, so if you want to print out any debug message in you own modification, you could remove this flag.

    The built binary is under folder ‘AThings-Factory-Tool/at-factory-tool/dist/atft’

  13. Copy everything from ‘AThings-Factory-Tool/at-factory-tool/dist/atft/*’ to ‘AThings-Factory-Tool/’

  14. Delete folder ‘AThings-Factory-Tool/at-factory-tool/dist’ and ‘AThings-Factory-Tool/at-factory-tool/build’

  15. Copy all the following files from folder ‘AThings-Factory-Tool/at-factory-tool/’ to ‘AThings-Factory-Tool/’

    • All image files (*.png)
    • config.json
    • NOTICE
    • MODULE_LICENSE_APACHE2
    • README.md (if exists)
    • fastboot.exe
    • AdbWinApi.dll
    • AdbWinUsbApi.dll
    • operation_start_p256.bin
    • operation_start_x25519.bin
  16. Now just copy the ‘AThings-Factory-Tool’ folder to the workstation you want to use it. To use the tool, execute the exe file ‘atft.exe’ under ‘AThings-Factory-Tool’ folder.

Linux

  1. Make sure you have python 2.7 installed. (The tool is not compatible with python 3.0)

  2. Install the following python packages:

    • wxPython 4.0.0 or above
    • passlib 1.7.1
    • sh
  3. Checkout this git repo to a temporary directory.

  4. Create a working folder named ‘AThings-Factory-Tool’

  5. Copy the whole ‘repo/at-factory-tool’ folder to the ‘AThings-Factory-Tool’ directory.

  6. Copy the license files to the ‘AThings-Factory-Tool’ directory:

    • repo/NOTICE
    • repo/MODULE_LICENSE_APACHE2
    • repo/LICENSE
  7. Goto the ‘AThings-Factory-Tool/at-factory-tool’ folder.

  8. Create a text file called GIT_COMMIT, fill its content with the git commit number to keep track of which commit you checked out.

  9. Open a command line, run

    python atft.py

    Make sure the program runs without error.

  10. If you want to create a bundled executable file that includes all the dependencies, make sure you have python package PyInstaller installed.

    You could use the following command:

    pip install pyinstaller

    to install.

  11. In a command line window, run

    cd [the AThings-Factory-Tool/at-factory-tool folder]

    pyinstaller --noconsole atft.py

    This would create a folder containing all the dependencies and the executable file. The ‘--noconsole’ tells the bundled binary not showing a command line window, so if you want to print out any debug message in you own modification, you could remove this flag.

    The built binary is under folder ‘AThings-Factory-Tool/at-factory-tool/dist/atft’

  12. Copy everything from ‘AThings-Factory-Tool/at-factory-tool/dist/atft/*’ to ‘AThings-Factory-Tool/’

  13. Delete folder ‘AThings-Factory-Tool/at-factory-tool/dist’ and ‘AThings-Factory-Tool/at-factory-tool/build’

  14. Copy all the following files from folder ‘AThings-Factory-Tool/at-factory-tool/’ to ‘AThings-Factory-Tool/’

    • All image files (*.png)
    • config.json
    • NOTICE
    • MODULE_LICENSE_APACHE2
    • README.md (if exists)
    • fastboot
    • operation_start_p256.bin
    • operation_start_x25519.bin
  15. Now just copy the ‘AThings-Factory-Tool’ folder to the workstation you want to use it. To use the tool, execute the file ‘atft’ under ‘AThings-Factory-Tool’ folder. Run:

    cd AThings-Factory-Tool; ./atft