Repository navigation
[No QA] Update Fresco, NitroUtils, expo-av #73862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
428dce0
feat: add elf alignment checker script
Kureev e3db56b
chore: fix alignment in fresco and nitro sql
Kureev eb3b79a
chore: update patch version
Kureev c7ef15a
chore: patch cspell.json
Kureev b1494a4
Merge branch 'main' into kureev/16kb-compat
Kureev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,32 @@ | ||
| project(ExpensifyNitroUtils) | ||
| cmake_minimum_required(VERSION 3.9.0) | ||
|
|
||
| set (PACKAGE_NAME ExpensifyNitroUtils) | ||
| set (CMAKE_VERBOSE_MAKEFILE ON) | ||
| set (CMAKE_CXX_STANDARD 20) | ||
| set(PACKAGE_NAME ExpensifyNitroUtils) | ||
| set(CMAKE_VERBOSE_MAKEFILE ON) | ||
| set(CMAKE_CXX_STANDARD 20) | ||
|
|
||
| # Define C++ library and add all sources | ||
| add_library(${PACKAGE_NAME} SHARED | ||
| src/main/cpp/cpp-adapter.cpp | ||
| src/main/cpp/cpp-adapter.cpp | ||
| ) | ||
|
|
||
| # Add Nitrogen specs :) | ||
| # Add Nitrogen specs | ||
| include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/ExpensifyNitroUtils+autolinking.cmake) | ||
|
|
||
| # Set up local includes | ||
| include_directories( | ||
| "src/main/cpp" | ||
| "../cpp" | ||
| "src/main/cpp" | ||
| "../cpp" | ||
| ) | ||
|
|
||
| find_library(LOG_LIB log) | ||
|
|
||
| # 🔧 Ensure 16KB ELF page alignment | ||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=16384") | ||
|
|
||
| # Link all libraries together | ||
| target_link_libraries( | ||
| ${PACKAGE_NAME} | ||
| ${LOG_LIB} | ||
| android # <-- Android core | ||
| ) | ||
| ${PACKAGE_NAME} | ||
| ${LOG_LIB} | ||
| android | ||
| ) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| #!/bin/bash | ||
| set -o pipefail | ||
|
|
||
| progname="${0##*/}" | ||
| progname="${progname%.sh}" | ||
|
Comment on lines
+1
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you give docs to the start of the script on how to use it and what its used for please? |
||
|
|
||
| # usage: check_elf_alignment.sh [path to *.so files|path to *.apk] | ||
| cleanup_trap() { | ||
| if [ -n "$tmp" ] && [ -d "$tmp" ]; then | ||
| rm -rf "$tmp" | ||
| fi | ||
| exit "${1:-0}" | ||
| } | ||
|
|
||
| # shellcheck disable=SC1090 | ||
| source "$(dirname "$0")/shellUtils.sh" | ||
|
|
||
| usage() { | ||
| echo "Host side script to check the ELF alignment of shared libraries." | ||
| echo "Shared libraries are reported ALIGNED when their ELF regions are" | ||
| echo "16 KB or 64 KB aligned. Otherwise they are reported as UNALIGNED." | ||
| echo | ||
| echo "Usage: ${progname} [input-path|input-APK|input-APEX]" | ||
| } | ||
|
|
||
| if [ "$#" -ne 1 ]; then | ||
| usage | ||
| exit 1 | ||
| fi | ||
|
|
||
| case "$1" in | ||
| --help | -h | -\?) | ||
| usage | ||
| exit 0 | ||
| ;; | ||
| *) | ||
| dir="$1" | ||
| ;; | ||
| esac | ||
|
|
||
| if ! [ -f "$dir" ] && ! [ -d "$dir" ]; then | ||
| error "Invalid file: $dir" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ "$dir" == *.apk ]]; then | ||
| trap 'cleanup_trap' EXIT | ||
|
|
||
| echo | ||
| title "Recursively analyzing $dir" | ||
| echo | ||
|
|
||
| if zipalign --help 2>&1 | grep -q "\-P <pagesize_kb>"; then | ||
| title "APK zip-alignment" | ||
| zipalign -v -c -P 16 4 "$dir" | grep -E 'lib/arm64-v8a|lib/x86_64|Verification' | ||
| echo "=========================" | ||
| else | ||
| info "NOTICE: Zip alignment check requires build-tools version 35.0.0-rc3 or higher." | ||
| info " You can install the latest build-tools by running the below command" | ||
| info " and updating your \$PATH:" | ||
| echo | ||
| info ' sdkmanager "build-tools;35.0.0-rc3"' | ||
| fi | ||
|
|
||
| dir_filename=$(basename "$dir") | ||
| tmp=$(mktemp -d -t "${dir_filename%.apk}_out_XXXXX") | ||
| unzip "$dir" lib/* -d "$tmp" >/dev/null 2>&1 | ||
| dir="$tmp" | ||
| fi | ||
|
|
||
| if [[ "$dir" == *.apex ]]; then | ||
| trap 'cleanup_trap' EXIT | ||
|
|
||
| echo | ||
| title "Recursively analyzing $dir" | ||
| echo | ||
|
|
||
| dir_filename=$(basename "$dir") | ||
| tmp=$(mktemp -d -t "${dir_filename%.apex}_out_XXXXX") | ||
| if ! deapexer extract "$dir" "$tmp"; then | ||
| error "Failed to deapex." | ||
| exit 1 | ||
| fi | ||
| dir="$tmp" | ||
| fi | ||
|
|
||
| unaligned_libs=() | ||
|
|
||
| echo | ||
| title "ELF alignment" | ||
|
|
||
| matches="$(find "$dir" -type f)" | ||
| IFS=$'\n' | ||
| for match in $matches; do | ||
| [[ "$match" == *".apk" ]] && warn "doesn't recursively inspect .apk file: $match" | ||
| [[ "$match" == *".apex" ]] && warn "doesn't recursively inspect .apex file: $match" | ||
|
|
||
| [[ $(file "$match") == *"ELF"* ]] || continue | ||
|
|
||
| res="$(objdump -p "$match" | grep LOAD | awk '{ print $NF }' | head -1)" | ||
| if [[ $res =~ 2\*\*(1[4-9]|[2-9][0-9]|[1-9][0-9]{2,}) ]]; then | ||
| printf "%s: %sALIGNED%s (%s)\n" "$match" "$GREEN" "$RESET" "$res" | ||
| else | ||
| printf "%s: %sUNALIGNED%s (%s)\n" "$match" "$RED" "$RESET" "$res" | ||
| unaligned_libs+=("$match") | ||
| fi | ||
| done | ||
|
|
||
| if [ "${#unaligned_libs[@]}" -gt 0 ]; then | ||
| printf "%sFound %d unaligned libs (only arm64-v8a/x86_64 libs need to be aligned).%s\n" "$RED" "${#unaligned_libs[@]}" "$RESET" | ||
| elif [ -n "${dir_filename:-}" ]; then | ||
| success "ELF Verification Successful" | ||
| fi | ||
| echo "=====================" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that this is very similar to https://cs.android.com/android/platform/superproject/main/+/main:system/extras/tools/check_elf_alignment.sh, with only slight modifications to use our shellUtils and to pass shellcheck.