Skip to content

Commit d120460

Browse files
committed
Init Commit
1 parent d4c7694 commit d120460

33 files changed

+92023
-2
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: soimkim
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**System environment (please complete the following information):**
20+
- OS: [e.g. Ubuntu 16.04, Windows, Mac OS]
21+
- Python : [e.g. python3.7]
22+
23+
**Additional context**
24+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: soimkim
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Description
2+
<!--
3+
Please describe what this PR do.
4+
-->
5+
6+
## Type of change
7+
<!--
8+
Please insert 'x' one of the type of change.
9+
-->
10+
- [ ] Bug fix (non-breaking change which fixes an issue)
11+
- [ ] New feature (non-breaking change which adds functionality)
12+
- [ ] Documentation update
13+
- [ ] Refactoring, Maintenance
14+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
15+

.github/release-drafter-config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
label: 'enhancement'
6+
- title: '🐛 Hotfixes'
7+
labels:
8+
- 'bug'
9+
- 'bug fix'
10+
- title: '🔧 Maintenance'
11+
labels:
12+
- 'documentation'
13+
- 'chore'
14+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
15+
version-resolver:
16+
major:
17+
labels:
18+
- 'major'
19+
minor:
20+
labels:
21+
- 'minor'
22+
patch:
23+
labels:
24+
- 'patch'
25+
default: patch
26+
template: |
27+
## Changes
28+
$CHANGES
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# 1. Update changelog
2+
# 2. Upload a Python Package using Twine
3+
4+
name: Release fosslight_android
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
update-changelog:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Get Release
18+
uses: agners/[email protected]
19+
id: get_release
20+
env:
21+
GITHUB_TOKEN: ${{ github.token }}
22+
- name: Bump up version
23+
env:
24+
NEW_TAG: ${{ steps.get_release.outputs.tag_name }}
25+
run: |
26+
pip install --upgrade bumpversion
27+
LAST_TWO_TAGS=$(git for-each-ref refs/tags/ --count=2 --sort=-v:refname --format="%(refname:short)")
28+
LAST_ONE=$(echo $LAST_TWO_TAGS | cut -d' ' -f 2)
29+
last_version=$(echo ${LAST_ONE//v/""})
30+
echo Last version: ${last_version}
31+
new_version=$(echo ${NEW_TAG//v/""})
32+
echo New version: ${new_version}
33+
git config --local user.name "github-actions[bot]"
34+
bumpversion --current-version $last_version --new-version $new_version setup.py
35+
- name: update changelog with gren
36+
env:
37+
GREN_GITHUB_TOKEN: ${{ secrets.TOKEN }}
38+
run: |
39+
npm install [email protected]
40+
node_modules/.bin/gren changelog --override
41+
- name: Commit files
42+
run: |
43+
git config --local user.name "github-actions[bot]"
44+
git add CHANGELOG.md
45+
git commit -m "Update ChangeLog"
46+
- name: Push changes
47+
uses: ad-m/github-push-action@master
48+
with:
49+
github_token: ${{ secrets.TOKEN }}
50+
branch: main
51+
52+
deploy:
53+
runs-on: ubuntu-18.04
54+
needs: update-changelog
55+
steps:
56+
- uses: actions/checkout@v2
57+
with:
58+
ref: main
59+
- name: Set up Python
60+
uses: actions/setup-python@v2
61+
with:
62+
python-version: '3.8'
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
pip install setuptools wheel twine
67+
- name: Build and publish
68+
env:
69+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
70+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
71+
run: |
72+
python setup.py sdist bdist_wheel
73+
twine upload dist/*

.github/workflows/pull-request.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Running tests with tox for releasing new version
2+
3+
name: Pull requests fosslight_android_scanner
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- '*'
9+
10+
jobs:
11+
check-commit-message:
12+
name: Check Commit Message
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Get PR Commits
16+
id: 'get-pr-commits'
17+
uses: tim-actions/get-pr-commits@master
18+
with:
19+
token: ${{ secrets.TOKEN }}
20+
21+
- name: Check Subject Line Length
22+
uses: tim-actions/[email protected]
23+
with:
24+
commits: ${{ steps.get-pr-commits.outputs.commits }}
25+
pattern: '^.{0,50}(\n.*)*$'
26+
error: 'Subject too long (max 50)'
27+
- name: Check Body Line Length
28+
if: ${{ success() || failure() }}
29+
uses: tim-actions/[email protected]
30+
with:
31+
commits: ${{ steps.get-pr-commits.outputs.commits }}
32+
pattern: '^.+(\n.{0,72})*$'
33+
error: 'Body line too long (max 72)'
34+
build:
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
python-version: [3.8]
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install tox
49+
- name: Run Tox
50+
run: |
51+
tox -e release
52+
reuse:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v2
56+
- name: REUSE Compliance Check
57+
uses: fsfe/reuse-action@v1
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Release Drafter
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
update_release_draft:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: release-drafter/release-drafter@v5
11+
with:
12+
config-name: release-drafter-config.yml
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-FileCopyrightText: Copyright 2023 LG Electronics Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
include README.md
4+
include requirements.txt
5+
include LICENSE
6+
7+
recursive-include src *

README.md

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,81 @@
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

Comments
 (0)