Commit Graph

23 Commits

Author SHA1 Message Date
Bob Badour
f7cf305656 [LSC] Add LOCAL_LICENSE_KINDS to development
Added SPDX-license-identifier-Apache-2.0 to:
  apps/BluetoothDebug/Android.bp
  apps/BuildWidget/Android.bp
  apps/CustomLocale/Android.bp
  apps/DevelopmentSettings/Android.bp
  apps/Fallback/Android.bp
  apps/GestureBuilder/Android.bp
  apps/NinePatchLab/Android.bp
  apps/OBJViewer/Android.bp
  apps/PushApiAuthenticator/Android.bp
  apps/PushApiTestAppOne/Android.bp
  apps/PushApiTestAppTwo/Android.bp
  apps/SdkSetup/Android.bp
  apps/SettingInjectorSample/Android.bp
  apps/WidgetPreview/Android.bp
  apps/launchperf/Android.bp
  cmds/monkey/Android.mk
  gsi/gsi_util/Android.bp
  gsi/repack_super_image/Android.bp
  host/windows/Android.bp
  python-packages/Android.bp
  samples/AccelerometerPlay/Android.bp
  samples/AdaptiveIconSample/Android.bp
  samples/AliasActivity/Android.bp
  samples/AndroidBeamDemo/Android.bp
  samples/AppNavigation/Android.bp
  samples/AutofillKeyboard/Android.bp
  samples/BackupRestore/Android.bp
  samples/BasicGLSurfaceView/Android.bp
  samples/BluetoothChat/Android.bp
  samples/BrokenKeyDerivation/Android.bp
  samples/BrokenKeyDerivation/tests/Android.bp
  samples/BusinessCard/Android.bp
  samples/Compass/Android.bp
  samples/ContactManager/Android.bp
  samples/CubeLiveWallpaper/Android.bp
  samples/DataWiper/Android.bp
  samples/DeviceAdminWhitelistedAccount/Android.bp
  samples/FixedGridLayout/Android.bp
  samples/HeavyWeight/Android.bp
  samples/HelloActivity/Android.bp
  samples/HelloActivity/tests/Android.bp
  samples/HelloEffects/Android.bp
  samples/Home/Android.bp
  samples/HoneycombGallery/Android.bp
  samples/InlineFillService/Android.bp
  samples/JetBoy/Android.bp
  samples/LceDemo/Android.bp
  samples/LunarLander/Android.bp
  samples/LunarLander/tests/Android.bp
  samples/MultiResolution/Android.bp
  samples/MultiWindow/Android.bp
  samples/MySampleRss/Android.bp
  samples/NotePad/Android.bp
  samples/Obb/Android.bp
  samples/RSSReader/Android.bp
  samples/ReceiveShareDemo/Android.bp
  samples/SampleSyncAdapter/Android.bp
  samples/SimpleJNI/Android.bp
  samples/SimpleJNI/jni/Android.bp
  samples/SipDemo/Android.bp
  samples/SkeletonApp/Android.bp
  samples/SkeletonApp/tests/Android.bp
  samples/Snake/Android.bp
  samples/Snake/tests/Android.bp
  samples/SoftKeyboard/Android.bp
  samples/SpellChecker/HelloSpellChecker/Android.bp
  samples/SpellChecker/SampleSpellCheckerService/Android.bp
  samples/StackWidget/Android.bp
  samples/ThemedNavBarKeyboard/Android.bp
  samples/ToyVpn/Android.bp
  samples/TtsEngine/Android.bp
  samples/USB/AdbTest/Android.bp
  samples/USB/MissileLauncher/Android.bp
  samples/UiAutomator/Android.mk
  samples/Vault/Android.bp
  samples/Vault/tests/Android.bp
  samples/VoiceRecognitionService/Android.bp
  samples/VoicemailProviderDemo/Android.bp
  samples/WeatherListWidget/Android.bp
  samples/WiFiDirectDemo/Android.bp
  samples/WiFiDirectServiceDiscovery/Android.bp
  samples/Wiktionary/Android.bp
  samples/WiktionarySimple/Android.bp
  samples/XmlAdapters/Android.bp
  samples/apkcachetest/Android.bp
  samples/training/NsdChat/Android.bp
  scripts/Android.bp
  testrunner/Android.mk
  testrunner/tests/Android_native.mk
  tools/apkcheck/Android.bp
  tools/bugreport/Android.bp
  tools/etc1tool/Android.bp
  tools/idegen/Android.bp
  tools/mkstubs/Android.bp
  tools/rmtypedefs/Android.bp
  vndk/Android.bp
  vndk/tools/Android.bp
  vndk/tools/elfcheck/Android.bp
  vndk/tools/header-checker/Android.bp
  vndk/tools/header-checker/src/repr/protobuf/proto/Android.bp
  vndk/tools/header-checker/tests/integration/ifunc/Android.bp
  vndk/tools/header-checker/tests/integration/version_script_example/Android.bp
  vndk/tools/image-diff-tool/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CPL-1.0 SPDX-license-identifier-MIT
    SPDX-license-identifier-Unicode-DFS SPDX-license-identifier-W3C
    legacy_restricted legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-CPL-1.0
to:
  samples/SearchableDictionary/Android.bp

Added SPDX-license-identifier-Apache-2.0 legacy_unencumbered
to:
  tools/Android.bp

Added SPDX-license-identifier-BSD SPDX-license-identifier-CPL-1.0
    SPDX-license-identifier-MIT SPDX-license-identifier-Unicode-DFS
    SPDX-license-identifier-W3C
to:
  sdk/Android.bp

Added legacy_restricted
to:
  samples/KeyChainDemo/Android.bp
  tools/line_endings/Android.bp
  vndk/tools/definition-tool/datasets/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I9847e00fb4278bc083b4debbc751003c995ea45c
2021-02-12 17:13:45 -08:00
Jeongik Cha
c5d47e8b93 Use inclusive language in diff script
Test: run compare_images_and_print.sh
Bug: 162284096
Change-Id: I1f5cebbc61606a16ddfae8f64dfc57e01cbcbd3d
2020-07-29 20:31:27 +09:00
Jeongik Cha
3447456056 Use inclusive language in diff tool
Also, apply recommendation from the lint

Bug: 162284096
Test: m compare_images
Change-Id: I43a031a56aadd4b51ee309500df58348d23072aa
2020-07-29 19:57:55 +09:00
Kiyoung Kim
cbd202a1a1 Compare list only and ignore SHA-1 with option -l
Current image diff tool compares SHA-1, so it generates more output
when only file list comparison is required. This change adds an extra
option -l to compare file list only if needed.

Bug: 144398762
Test: Tested locally with two artifacts
Change-Id: I47351fc19fb8089c65ed3d3ba901dfe83aa7deba
2020-06-05 14:31:16 +09:00
Daniel Norman
e999df1b2a Merge "Adds official comment support to the whitelist format." 2020-03-02 18:31:56 +00:00
Daniel Norman
f5d8193c46 Adds official comment support to the whitelist format.
Test: Added a comment to the whitelist.txt, ran compare_images.
Change-Id: I27a8949b13dd55d23cbb6fd5a3b68ecdcb7204b2
2020-02-28 11:51:59 -08:00
Chris Gross
41e92f962b Ensure compare_images is built with one TARGET_PRODUCT.
Currently compare_images is built using aosp_arm (the default),
but is excuted under aosp_arm64. This change just moves the build
step inside of the aosp_arm64 lunch invocation.

Test: Ran compare_images_and_print.sh

Change-Id: I2e63a4027f6499666d3a199fd9887556af35a361
2020-02-19 00:51:02 +00:00
Yo Chiang
967803932e Output diff result to stderr
compare_images_and_print.sh redirect diff result to stderr, so that the
stdout and stderr log don't get interwined.
Don't `cat` common.csv as it is not very useful and clutters the log.

Test: ./development/vndk/tools/image-diff-tool/compare_images_and_print.sh \
    --check "-t \
    compare_images_test/mainline_system_google_arm64-target_files-6112128 \
    compare_images_test/coral-target_files-6112128 -s SYSTEM -i"

Change-Id: Idf609c43a0d1e488ecb2baca99c8ff98edcf7798
2020-01-07 18:30:46 +08:00
Jeongik Cha
e35e89dd77 Add preserve_extracted_files option in compare_images
With the option: extract zip file in the directory where zip is, and the
extracted files remain.
Without the option: extract zip file in tmp and clean up after a run

Test: check if files remain with -p option
Bug: N/A
Change-Id: I1aa74c017dbb885481b8f5a0674d089c0a732620
2019-12-17 02:03:20 +00:00
Jeongik Cha
af646f7981 Extract zip file in tmp directory
As-is: extract zip file in-place
To-be: extract zip file in tmp dir

Test: run the tool with -u option, and check if there is no file in a
directory where zip file is located

Change-Id: I2654bfa257714cb5b266abf4feb31acaabdbb7cb
2019-12-11 21:55:50 +09:00
Yo Chiang
9039ad4acd Add 'whitelist' option to compare_images
* `compare_images -t a b -s system -w whitelist.txt` to specify
  whitelist.
* diff.csv is split into two parts:
  - whitelisted_diff.csv: Diffs that are ignored by a whitelist
  - diff.csv: Diffs that are not ignored by any whitelist.
* Add `-c, --check` option to compare_images_and_print.sh
  When this option is specified, compare_images_and_print.sh exits with
  a non-zero status if diff.csv contains any unexpected diffs.

Bug: 144398662
Test: Tested manually by creating two directories that contain common
      files, whitelisted diffing files and not whitelisted diffing files.
Test: ./compare_images_and_print.sh --help
Test: ./compare_images_and_print.sh --check "-t a b -s SYSTEM -i"
Change-Id: Ie80741d08ef5bc245b409b46ee716ae783428a7d
2019-11-14 15:49:48 +08:00
Yo Chiang
b783c4955b Refactor compare_images
* Drop unused import
* Simplify filename globbing logic

Test: Manually test noop
Change-Id: Ib1e491a47b2fd4fa76884571259f8c6764dbb547
2019-11-11 11:57:22 +08:00
Yo Chiang
e0765b40de Use prebuilt llvm tools
- objdump -> llvm-objdump: diff.py depends on prebuilt llvm-binutils
- llvm-objdump expects long options to start with '--'

Test: Manual
Change-Id: I9f3986444ef2f17eb37b4b1c1c66f5c1ccb47299
2019-11-08 13:57:53 +08:00
Jeongik Cha
37c23e051c Copy common.csv and diff.csv into DIST_DIR
Bug: 138639389
Test: DIST_DIR=... compare_image_and_print.sh ~~ and then check if there
are files in DIST_DIR

Change-Id: Ia3efde82429abb740b9deb93b4c87c0b45a0217a
2019-08-08 22:11:03 +09:00
Jeongik Cha
5e22d28ecb Add 'unzip' option
unzip option: 'unzip -qd target target/* search_path/*' before execution

Bug: 138639389
Test: place zip file in the dir, and then run compare_images with -u
Change-Id: I8ad442f32d8ab5a5e504882c6db0cae166fef42c
2019-08-07 11:02:28 +09:00
Jeongik Cha
a10c62a4fb cast Path to string type
os.path.isdir, os.path.exists cannot handle Path type until python 3.5
so cat Path to string type

Bug: 138639389
Test: development/vndk/tools/image-diff-tool/compare_images_and_print.sh "-t path1 path2 -s SYSTEM -i"
Change-Id: I147eac6f2548558737409a7a93ac54f0053a072e
2019-08-06 11:32:05 +09:00
Jeongik Cha
717fdcd8a0 Use pathlib Path.glob instead of glob.glob(recursive=True)
recursive option in glob.glob is supported from 3.5, so use Path.glob
instaed

Bug: 138639389
Test: development/vndk/tools/image-diff-tool/compare_images_and_print.sh "-t path1 path2 -s SYSTEM -i
"

Change-Id: If184b15e1b0be2a80f2f79a281b5093ad177eb6c
2019-08-05 15:35:01 +09:00
Jeongik Cha
697461a975 Set fullpath for script
compare_images -> out/host/linux-x86/bin/compare_images
lunch before compare_image because it didn't find llvm_strip

Bug: 138639389
Test: development/vndk/tools/image-diff-tool/compare_images_and_print.sh "-t path1 path2 -s SYSTEM -i"
Change-Id: I3cce8710470ebc8827aeaae75ac42da880ad9df2
2019-08-01 23:38:20 +09:00
Jeongik Cha
574b9d3b83 Add script for running diff easily
For convenient diff test in post-submit, write a script.

Bug: 138639389
Test: development/vndk/tools/image-diff-tool/compare_images_and_print.sh "-t path1 path2 -s SYSTEM -i"

Change-Id: Ia7e1f7fb7f22bd2a53028e0e65458b7c1adc53bd
2019-07-31 21:44:15 +09:00
Jeongik Cha
b68408275b Refactor compare_images
1. Rename some variables to more detail
2. Fix a bug that occurs when system.img contains product, system_ext
3. Remove multithread code, it made performance worse :(
  before: 136.97s user 1070.22s system 290% cpu 6:55.84 total
  after:  56.29s user 76.95s system 105% cpu 2:06.84 total

Bug: 138329983
Test: compare some images, and check if result is same as before
Change-Id: I4cec27475283a34d063ad3251cfc5909c34071c1
2019-07-25 19:14:20 +09:00
Jeongik Cha
30c0f1ede6 Rename tool's name
system_product_image_diff -> compare_images

it has more general options, so change its name more general

Bug: 131273025
Test: m
Change-Id: I7579f01edb9f8b8f2fe727b405a592b9c6217eb4
2019-07-16 15:10:12 +09:00
Jeongik Cha
5864907380 Add --ignore_signing_key option in compare tool
Even though some apps has identical contents(code, resource), they looks
different from each other if signing keys are different.

So, for efficiency, add --ignore_signing_key option in compare tool.
If it is set, sha1sum logic is changed.
As-is: sha1sum apk_file
To-be: add every sha1sum of files that are in apk_file except META-INF,
and then get sha1sum from sha1sums

Bug: 135503972
Test: compare two apk of which code and resource is same but signing key
is diffent.

Change-Id: I2176fdfce5f0fc2181073a1a1183c51dfbfaee49
2019-07-12 22:40:03 +09:00
Jeongik Cha
062f2b09ca system and product image diff tool
This tool compares system and product image across models, and generate
common.csv and diff.csv

Here is example output
- common.csv:
filename, sha1sum, targets
/system/a, da39a3ee5e, a;b;c

- diff.csv:
filename, sha1sum, targets
/system/b, da39a3ee5e, a;b
/system/c, 3f786850e3, a
/system/c, 89e6c98d92, b;c

Bug: 131273025
Test: m system_product_image_diff
Test: system_product_image_diff -t model1 model2 -s system product

Change-Id: Ie9cc368e0a6d26e956f1e27ebe683bea5e80465c
2019-06-14 15:15:38 +09:00