|
1 | | -# fosslight_android_scanner |
2 | | -FOSSLight Android |
| 1 | +<!-- |
| 2 | +# SPDX-FileCopyrightText: Copyright 2023 LG Electronics Inc. |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | +--> |
| 5 | + |
| 6 | +# FOSSLight Android |
| 7 | + |
| 8 | +> List all the binaries loaded on the Android-based model to check which open source is used for each binary, and to check whether the notices are included in the OSS notice (ex-NOTICE.html: OSS Notice for Android-based model). |
| 9 | +
|
| 10 | +## License |
| 11 | +FOSSLight Android is LGE proprietary license, as found in the LICENSE file. |
| 12 | + |
| 13 | +## Install |
| 14 | + |
| 15 | +To install fosslight_android, you need to have the following pieces of software on |
| 16 | +your computer: |
| 17 | + |
| 18 | +- Python 3.6+ |
| 19 | +- pip |
| 20 | + |
| 21 | +It is recommended to install it in the [python 3.6 + virtualenv environment](https://fosslight.org/fosslight-guide-en/scanner/etc/guide_virtualenv.html). |
| 22 | + |
| 23 | +### Installation via pip (For LGE use only) |
| 24 | +You only need to run the following command: |
| 25 | + |
| 26 | +```bash |
| 27 | +pip3 install "http://mod.lge.com/hub/osc/fosslight_android/-/archive/master/fosslight_android-master.zip" |
| 28 | +``` |
| 29 | + |
| 30 | +After this, make sure that `~/.local/bin` is in your `$PATH`. |
| 31 | + |
| 32 | +### Installation from source |
| 33 | + |
| 34 | +```bash |
| 35 | +$ cd android_binary_analysis/ |
| 36 | +android_binary_analysis$ pip3 install . |
| 37 | +``` |
| 38 | + |
| 39 | +## Prerequisite |
| 40 | + |
| 41 | +When building android, save the build log as a text file. |
| 42 | + |
| 43 | +```bash |
| 44 | +$ source ./build/envsetup.sh |
| 45 | +$ make clean |
| 46 | +$ lunch aosp_hammerhead-user |
| 47 | +$ make -j4 2>&1 | tee android.log |
| 48 | +``` |
| 49 | + |
| 50 | +## Usage |
| 51 | + |
| 52 | +This tool can do various more things, detailed in the documentation. Here a |
| 53 | +short summary: |
| 54 | + |
| 55 | +### Required Parameters |
| 56 | +- `s` --- Android source path. |
| 57 | +- `a` --- Android build log file name. (File in Android source path.) |
| 58 | + |
| 59 | +### Optional Paremeters |
| 60 | +- `m` --- Analyze the source code for the path where the license could not be found. |
| 61 | +- `p` --- Check files that should not be included in the Packaging file. |
| 62 | +- `f` --- Print result of Find Command for binary that can not find Source Code Path. |
| 63 | +- `t` --- Collect NOTICE for binaries that are not added to NOTICE.html. |
| 64 | +- `d` --- Divide needtoadd-notice.html by binary. |
| 65 | +- `i` --- Disable the function to automatically convert OSS names based on AOSP. |
| 66 | +- `r` --- result.txt file with a list of binaries to remove. |
| 67 | + |
| 68 | +### Example |
| 69 | +```bash |
| 70 | +$ fosslight_android -s /home/test/android_source_path -a android.log -m |
| 71 | +``` |
| 72 | +- android.log : Exists under the android source path. (/home/test/android_source_path/android.log) |
| 73 | +- It is recommended to add the m option. |
| 74 | + This is because, if the m option is used, the license is automatically detected based on the source code path for the binary for which the license could not be detected. However, if the m option is added, the script execution time becomes longer. |
| 75 | + |
| 76 | +## Result files |
| 77 | +- fosslight_binary_[datetime].txt : A file that outputs checksum and TLSH values for each binary. |
| 78 | +- fosslight_report_[%y%m%d_%H%M].xlsx : Result file output in FOSSLight Report format (Source Path and OSS information are included for each binary) |
| 79 | +- fosslight_log_[datetime].txt : FOSSLight Android execution log output file. |
| 80 | +### In case of m option |
| 81 | +- Files in source_analyzed_[%Y%m%d_%H%M%S] : Result of source code analysis for each path. |
0 commit comments