Import Debian changes 1:14~beta1-ok1

android-platform-frameworks-base (1:14~beta1-ok1) nile; urgency=medium

  * Build for openKylin.
This commit is contained in:
openKylinBot 2024-05-06 16:24:09 +08:00 committed by luoyaoming
parent 95982c67fd
commit 1a3f7064ea
51 changed files with 1580 additions and 0 deletions

14
debian/.gitlab-ci.yml vendored Normal file
View File

@ -0,0 +1,14 @@
pages:
image: registry.salsa.debian.org/salsa-ci-team/ci-image-git-buildpackage:latest
stage: deploy
only:
- master
artifacts:
paths:
- public
expire_in: 1 day
script:
- gitlab-ci-add-pages-repo android-tools-team/android-platform-frameworks-native
- gitlab-ci-add-pages-repo android-tools-team/android-platform-system-core
- gitlab-ci-git-buildpackage-all
- gitlab-ci-aptly

11
debian/README.packaging vendored Normal file
View File

@ -0,0 +1,11 @@
Procedure to update to a new upstream release:
$ debian/rules update
# Update to preview or beta version from upstream branch/tag
# Download orig tgz from site: https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-u-beta-1-gpl
# Rename to ../android-platform-frameworks-base_14~beta1.tar.gz
$ IMPORT_VER=14~beta1 debian/rules update
-- Roger Shimizu <rosh@debian.org> Sat, 29 Jul 2023 20:01:05 -0700

59
debian/README.source vendored Normal file
View File

@ -0,0 +1,59 @@
The Android source repositories are quite chaotic. They often include a mix
of things under arbitrary umbrellas. For example, there are parts of this
particular repository that will only ever be built when building the complete
Android OS (aka "target"), other parts that are only built as part of the SDK
to support building Android apps (aka "host"), and other parts that are used
both in the SDK and the Android OS. Most of the source code in this particular
repostory will never be built or included on Debian because it is only used in
the Android OS.
It is possible to see which sections will be built for what by looking at the
Android.mk files. The parts that are meant for the "host" system, in this
case Debian, will have lines like this in it:
include $(BUILD_HOST_EXECUTABLE)
include $(BUILD_HOST_JAVA_LIBRARY)
include $(BUILD_HOST_SHARED_LIBRARY)
include $(BUILD_HOST_STATIC_LIBRARY)
The build targets that are only for Android OS builds instead have this:
include $(BUILD_EXECUTABLE)
include $(BUILD_JAVA_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
include $(BUILD_STATIC_LIBRARY)
A given chunk of code that is built both for "host" will have both of these
lines included in the Android.mk file.
Structure of the package's git repository
-----------------------------------------
The source code has been excerpted form the git repository
https://android.googlesource.com/platform/frameworks/base
The Android project does not release tarballs of their core software. Unlike
the other source packages in android-tools, this package source repo is not
configured following git-buildpackage's "No upstream tarballs" setup because
the upstream git repo is so massive, it is basically unmanageable. It can peg
your CPU for minutes while checking out a branch or tag.
Instead, the source tarballs are generated from the upstream git repo based on
the android-* tags. Use get-orig-source rule in debian/rules to generate
upstream tarballs.
Omitted files
-------------
All of the files in the upstream make for an almost 1 GiB tarball. So
only the section that are currently used are included in the tarball.
Check the debian/copyright for details. There is a bug in tar which
prevents uscan from doing this automatically, so use `debian/rules
get-orig-source`
https://bugs.debian.org/831870
-- Hans-Christoph Steiner <hans@eds.org>, Fri, 27 Nov 2020 14:21:10 +0100
-- Kai-Chung Yan <seamlikok@gmail.com> Sat, 28 Nov 2015 16:39:54 +0800

251
debian/aapt.1 vendored Normal file
View File

@ -0,0 +1,251 @@
.\" Hey, EMACS: -*- nroff -*-
.TH aapt 1 "October 15, 2014"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
aapt \- Android Asset Packaging Tool
.SH SYNOPSIS
.B aapt
.RI command\ [\ options\ ]\ files\ ...
.br
.PP
.B aapt
.RI l[ist]\ [\-v]\ [\-a]\ file.{zip,jar,apk}
.br
List contents of Zip-compatible archive.
.PP
.B aapt
.RI d[ump]\ [\-\-values]\ WHAT\ file.{apk}\ [asset\ [asset\ ...]]
strings Print the contents of the resource table string pool in the APK.
badging Print the label and icon for the app declared in APK.
permissions Print the permissions from the APK.
resources Print the resource table from the APK.
configurations Print the configurations in the APK.
xmltree Print the compiled xmls in the given assets.
xmlstrings Print the strings of the given compiled xml assets.
.B aapt
.RI p[ackage]\ [\-d]\ [\-f]\ [\-m]\ [\-u]\ [\-v]\ [\-x]\ [\-z]\ [\-M\ AndroidManifest.xml]
[\-0 extension [\-0 extension ...]] [\-g tolerance] [\-j jarfile]
[\-\-debug-mode] [\-\-min-sdk-version VAL] [\-\-target-sdk-version VAL]
[\-\-app-version VAL] [\-\-app-version-name TEXT] [\-\-custom-package VAL]
[\-\-rename-manifest-package PACKAGE]
[\-\-rename-instrumentation-target-package PACKAGE]
[\-\-utf16] [\-\-auto-add-overlay]
[\-\-max-res-version VAL]
[\-I base-package [\-I base-package ...]]
[\-A asset-source-dir] [\-G class-list-file] [\-P public-definitions-file]
[\-S resource-sources [\-S resource-sources ...]]
[\-F apk-file] [\-J R-file-dir]
[\-\-product product1,product2,...]
[\-c CONFIGS] [\-\-preferred-configurations CONFIGS]
[raw-files-dir [raw-files-dir] ...]
[\-\-output-text-symbols DIR]
Package the android resources. It will read assets and resources that are
supplied with the \-M \-A \-S or raw-files-dir arguments. The \-J \-P \-F and \-R
options control which files are output.
.B aapt
.RI r[emove]\ [\-v]\ file.{zip,jar,apk}\ file1\ [file2\ ...]
Delete specified files from Zip-compatible archive.
.B aapt
.RI a[dd]\ [\-v]\ file.{zip,jar,apk}\ file1\ [file2\ ...]
Add specified files to Zip-compatible archive.
.B aapt
.RI c[runch]\ [\-v]\ \-S\ resource-sources\ ...\ \-C\ output-folder\ ...
Do PNG preprocessing on one or several resource folders
and store the results in the output folder.
.B aapt
.RI s[ingleCrunch]\ [\-v]\ \-i\ input-file\ \-o\ outputfile
Do PNG preprocessing on a single file.
.B aapt
.RI v[ersion]
Print program version.
.SH DESCRIPTION
The Android Asset Packaging Tool (aapt) takes your application resource files,
such as the AndroidManifest.xml file and the XML files for your Activities,
and compiles them. An R.java is also produced so you can reference your
resources from your Java code.
.PP
.SH OPTIONS
A summary of options is included below.
.TP
.B \-a
print Android-specific data (resources, manifest) when listing
.TP
.B \-c
specify which configurations to include. The default is all
configurations. The value of the parameter should be a comma
separated list of configuration values. Locales should be specified
as either a language or language-region pair. Some examples:
en
port,en
port,land,en_US
If you put the special locale, zz_ZZ on the list, it will perform
pseudolocalization on the default locale, modifying all of the
strings so you can look for strings that missed the
internationalization process. For example:
port,land,zz_ZZ
.TP
.B \-d
one or more device assets to include, separated by commas
.TP
.B \-f
force overwrite of existing files
.TP
.B \-g
specify a pixel tolerance to force images to grayscale, default 0
.TP
.B \-j
specify a jar or zip file containing classes to include
.TP
.B \-k
junk path of file(s) added
.TP
.B \-m
make package directories under location specified by \-J
.TP
.B \-u
update existing packages (add new, replace older, remove deleted files)
.TP
.B \-v
verbose output
.TP
.B \-x
create extending (non-application) resource IDs
.TP
.B \-z
require localization of resource attributes marked with
localization="suggested"
.TP
.B \-A
additional directory in which to find raw asset files
.TP
.B \-G
A file to output proguard options into.
.TP
.B \-F
specify the apk file to output
.TP
.B \-I
add an existing package to base include set
.TP
.B \-J
specify where to output R.java resource constant definitions
.TP
.B \-M
specify full path to AndroidManifest.xml to include in zip
.TP
.B \-P
specify where to output public resource definitions
.TP
.B \-S
directory in which to find resources. Multiple directories will be scanned
and the first match found (left to right) will take precedence.
.TP
.B \-0
specifies an additional extension for which such files will not
be stored compressed in the .apk. An empty string means to not
compress any files at all.
.TP
.B \-\-debug-mode
inserts android:debuggable="true" in to the application node of the
manifest, making the application debuggable even on production devices.
.TP
.B \-\-min-sdk-version
inserts android:minSdkVersion in to manifest. If the version is 7 or
higher, the default encoding for resources will be in UTF-8.
.TP
.B \-\-target-sdk-version
inserts android:targetSdkVersion in to manifest.
.TP
.B \-\-max-res-version
ignores versioned resource directories above the given value.
.TP
.B \-\-values
when used with "dump resources" also includes resource values.
.TP
.B \-\-version-code
inserts android:versionCode in to manifest.
.TP
.B \-\-version-name
inserts android:versionName in to manifest.
.TP
.B \-\-custom-package
generates R.java into a different package.
.TP
.B \-\-extra-packages
generate R.java for libraries. Separate libraries with ':'.
.TP
.B \-\-generate-dependencies
generate dependency files in the same directories for R.java and resource package
.TP
.B \-\-auto-add-overlay
Automatically add resources that are only in overlays.
.TP
.B \-\-preferred-configurations
Like the \-c option for filtering out unneeded configurations, but
only expresses a preference. If there is no resource available with
the preferred configuration then it will not be stripped.
.TP
.B \-\-rename-manifest-package
Rewrite the manifest so that its package name is the package name
given here. Relative class names (for example .Foo) will be
changed to absolute names with the old package so that the code
does not need to change.
.TP
.B \-\-rename-instrumentation-target-package
Rewrite the manifest so that all of its instrumentation
components target the given package. Useful when used in
conjunction with \-\-rename-manifest-package to fix tests against
a package that has been renamed.
.TP
.B \-\-product
Specifies which variant to choose for strings that have
product variants
.TP
.B \-\-utf16
changes default encoding for resources to UTF-16. Only useful when API
level is set to 7 or higher where the default encoding is UTF-8.
.TP
.B \-\-non-constant-id
Make the resources ID non constant. This is required to make an R java class
that does not contain the final value but is used to make reusable compiled
libraries that need to access resources.
.TP
.B \-\-error-on-failed-insert
Forces aapt to return an error if it fails to insert values into the manifest
with \-\-debug-mode, \-\-min-sdk-version, \-\-target-sdk-version \-\-version-code
and \-\-version-name.
Insertion typically fails if the manifest already defines the attribute.
.TP
.B \-\-output-text-symbols
Generates a text file containing the resource symbols of the R class in the
specified folder.
.TP
.B \-\-ignore-assets
Assets to be ignored.
.SH AUTHOR
aapt was written by The Android Open Source Project.
.PP

1
debian/aapt.bash-completion vendored Normal file
View File

@ -0,0 +1 @@
debian/bash-completion/aapt

1
debian/aapt.docs vendored Normal file
View File

@ -0,0 +1 @@
NOTICE

2
debian/aapt.install vendored Normal file
View File

@ -0,0 +1,2 @@
debian/out/aapt usr/lib/android-sdk/build-tools/debian
debian/out/aapt2 usr/lib/android-sdk/build-tools/debian

2
debian/aapt.links vendored Normal file
View File

@ -0,0 +1,2 @@
usr/lib/android-sdk/build-tools/debian/aapt usr/bin/aapt
usr/lib/android-sdk/build-tools/debian/aapt2 usr/bin/aapt2

12
debian/aapt.lintian-overrides vendored Normal file
View File

@ -0,0 +1,12 @@
# Executables from the Android SDK normally each staticly link in all
# of the libs. That means each executable includes a full copy of all
# the libs, which is not how Debian works. These libs need to be
# dynamically linlked in so that just the library can be updated when
# there is a security fix, instead of requiring all of the executables
# be recompiled. That said, these libraries do not have a stable
# interface and were never intended to be used by any other project,
# only with the internal, Android SDK executables. Therefore, the
# Android SDK executables use private libraries located in
# /usr/lib/${DEB_HOST_MULTIARCH}/android
custom-library-search-path

1
debian/aapt.manpages vendored Normal file
View File

@ -0,0 +1 @@
debian/aapt.1

34
debian/aapt.mk vendored Normal file
View File

@ -0,0 +1,34 @@
include /usr/share/dpkg/architecture.mk
NAME = aapt
# tools/aapt/Android.bp
SOURCES = Main.cpp
SOURCES := $(foreach source, $(SOURCES), tools/aapt/$(source))
OBJECTS = $(SOURCES:.cpp=.o)
CPPFLAGS += \
-DAAPT_VERSION=\"$(ANDROID_BUILD_TOOLS_VERSION)\" \
-DSTATIC_ANDROIDFW_FOR_TOOLS \
-Ilibs/androidfw/include \
LDFLAGS += \
-Ldebian/out \
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-laapt \
-landroidfw \
-lutils \
-pie
# -latomic should be the last library specified
# https://github.com/android/ndk/issues/589
ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),)
LDFLAGS += -latomic
endif
build: $(OBJECTS)
$(CXX) $^ -o debian/out/$(NAME) $(LDFLAGS)
$(OBJECTS): %.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)

37
debian/aapt2.mk vendored Normal file
View File

@ -0,0 +1,37 @@
include /usr/share/dpkg/architecture.mk
NAME = aapt2
# tools/aapt2/Android.bp
SOURCES = Main.cpp
SOURCES := $(foreach source, $(SOURCES), tools/aapt2/$(source))
OBJECTS = $(SOURCES:.cpp=.o)
CXXFLAGS += -fno-rtti
CPPFLAGS += \
-Idebian/out/proto/frameworks/base/tools/aapt2 \
-Ilibs/androidfw/include \
-Itools/aapt2 \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
LDFLAGS += \
-Ldebian/out \
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-laapt2 \
-landroidfw \
-lbase \
-pie
# -latomic should be the last library specified
# https://github.com/android/ndk/issues/589
ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),)
LDFLAGS += -latomic
endif
build: $(OBJECTS)
$(CXX) $^ -o debian/out/$(NAME) $(LDFLAGS)
$(OBJECTS): %.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)

56
debian/aapt2_test.mk vendored Normal file
View File

@ -0,0 +1,56 @@
include /usr/share/dpkg/architecture.mk
NAME = aapt2_test
# tools/aapt2/Android.bp
SOURCES = \
test/Builders.cpp \
test/Common.cpp \
test/Fixture.cpp \
SOURCES := $(foreach source, $(SOURCES), tools/aapt2/$(source))
SOURCES += $(foreach source, $(SOURCES), $(wildcard tools/aapt2/*_test.cpp))
SOURCES += $(foreach source, $(SOURCES), $(wildcard tools/aapt2/*/*_test.cpp))
# If there's no wget, some tests in aapt2_test will be skipped
ifeq (, $(shell which wget))
SOURCES := $(filter-out tools/aapt2/cmd/Compile_test.cpp tools/aapt2/cmd/Convert_test.cpp tools/aapt2/cmd/Link_test.cpp tools/aapt2/process/SymbolTable_test.cpp,$(SOURCES))
endif
OBJECTS = $(SOURCES:.cpp=.o)
CXXFLAGS += -std=gnu++17 \
-fno-rtti \
CPPFLAGS += \
-Idebian/out/proto/frameworks/base/tools/aapt2 \
-Ilibs/androidfw/include \
-Itools/aapt2 \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
LDFLAGS += \
-Ldebian/out \
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-laapt2 \
-landroidfw \
-lbase \
-lgmock \
-lgtest \
-lgtest_main \
-lprotobuf \
-lutils \
-lziparchive \
-pie
# -latomic should be the last library specified
# https://github.com/android/ndk/issues/589
ifneq ($(filter armel mipsel,$(DEB_HOST_ARCH)),)
LDFLAGS += -latomic
endif
build: $(OBJECTS)
$(CXX) $^ -o debian/out/$(NAME) $(LDFLAGS)
$(OBJECTS): %.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)

1
debian/android-framework-res.docs vendored Normal file
View File

@ -0,0 +1 @@
NOTICE

1
debian/android-framework-res.install vendored Normal file
View File

@ -0,0 +1 @@
debian/out/framework-res.apk usr/share/android-framework-res

4
debian/android-libaapt.install vendored Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/dh-exec
debian/out/libaapt.so* usr/lib/${DEB_HOST_MULTIARCH}/android
debian/out/libaapt2.so* usr/lib/${DEB_HOST_MULTIARCH}/android

View File

@ -0,0 +1,12 @@
# Executables from the Android SDK normally each staticly link in all
# of the libs. That means each executable includes a full copy of all
# the libs, which is not how Debian works. These libs need to be
# dynamically linlked in so that just the library can be updated when
# there is a security fix, instead of requiring all of the executables
# be recompiled. That said, these libraries do not have a stable
# interface and were never intended to be used by any other project,
# only with the internal, Android SDK executables. Therefore, the
# Android SDK executables use private libraries located in
# /usr/lib/${DEB_HOST_MULTIARCH}/android
custom-library-search-path

4
debian/android-libandroidfw-dev.install vendored Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/dh-exec
debian/out/libandroidfw.so usr/lib/${DEB_HOST_MULTIARCH}/android
libs/androidfw/include/* usr/include/android

1
debian/android-libandroidfw.docs vendored Normal file
View File

@ -0,0 +1 @@
NOTICE

3
debian/android-libandroidfw.install vendored Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/dh-exec
debian/out/libandroidfw.so.* usr/lib/${DEB_HOST_MULTIARCH}/android

View File

@ -0,0 +1,12 @@
# Executables from the Android SDK normally each staticly link in all
# of the libs. That means each executable includes a full copy of all
# the libs, which is not how Debian works. These libs need to be
# dynamically linlked in so that just the library can be updated when
# there is a security fix, instead of requiring all of the executables
# be recompiled. That said, these libraries do not have a stable
# interface and were never intended to be used by any other project,
# only with the internal, Android SDK executables. Therefore, the
# Android SDK executables use private libraries located in
# /usr/lib/${DEB_HOST_MULTIARCH}/android
custom-library-search-path

102
debian/bash-completion/aapt vendored Normal file
View File

@ -0,0 +1,102 @@
# Debian aapt(1) completion -*- shell-script -*-
# Copyright: 2014 Hans-Christoph Steiner <hans@eds.org>
_aapt()
{
local cur prev words cword
_init_completion || return
local special i
for (( i=0; i < ${#words[@]}-1; i++ )); do
if [[ ${words[i]} == @(add|crunch|dump|list|package|remove|singleCrunch|version) ]]; then
special=${words[i]}
fi
done
if [[ -n $special ]]; then
case $special in
add)
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-C -S -v' -- "$cur" ) )
else
_filedir 'apk'
fi
return 0
;;
crunch)
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-C -i -o -S -v' -- "$cur" ) )
else
_filedir 'apk'
fi
return 0
;;
dump)
case "$prev" in
badging|configurations|permissions|resources|strings|xmltree|xmlstrings)
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--values' -- "$cur" ) )
else
_filedir 'apk'
fi
return 0
;;
esac
COMPREPLY=( $( compgen -W 'badging configurations permissions resources
strings xmltree xmlstrings' -- "$cur" ) )
return 0
;;
list)
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-a -v' -- "$cur" ) )
else
_filedir 'apk'
fi
return 0
;;
package)
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-A -c -d -f -F -g -G -I -j -m -P
-S -u -v -x -z -m -0
--debug-mode --min-sdk-version --target-sdk-version
--app-version --app-version-name --custom-package
--rename-manifest-package --rename-instrumentation-target-package
--utf16 --auto-add-overlay --max-res-version
--product --preferred-configurations --output-text-symbols
' -- "$cur" ) )
else
_filedir
fi
return 0
;;
remove)
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-v' -- "$cur" ) )
else
_filedir
fi
return 0
;;
singleCrunch)
case $prev in
-i|-o)
_filedir
return 0
;;
esac
COMPREPLY=( $( compgen -W '-i -o -v' -- "$cur" ) )
return 0
;;
version)
return 0
;;
esac
fi
COMPREPLY=( $( compgen -W 'add crunch dump list package remove singleCrunch version' -- "$cur" ) )
return 0
} &&
complete -F _aapt aapt
# ex: ts=4 sw=4 et filetype=sh

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
android-platform-frameworks-base (1:14~beta1-ok1) nile; urgency=medium
* Build for openKylin.
-- openKylinBot <openKylinBot@openkylin.top> Mon, 06 May 2024 16:24:09 +0800

1
debian/clean vendored Normal file
View File

@ -0,0 +1 @@
debian/out/

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
10

103
debian/control vendored Normal file
View File

@ -0,0 +1,103 @@
Source: android-platform-frameworks-base
Section: devel
Priority: optional
Maintainer: openKylin Developers <packaging@lists.openkylin.top>
XSBC-Original-Maintainer: Android Tools Maintainers <android-tools-devel@lists.alioth.debian.org>
Uploaders: Umang Parmar <umangjparmar@gmail.com>
Build-Depends: android-libutils-dev (>= 1:34),
android-libziparchive-dev,
android-platform-frameworks-native-headers (>= 1:34),
bash-completion,
clang,
debhelper (>= 10),
dh-exec,
libexpat-dev,
libgmock-dev <!nocheck>,
libpng-dev,
libprotobuf-dev (>= 3.20),
lld [amd64 i386 armel armhf arm64 mipsel mips64el],
pandoc,
protobuf-compiler (>= 3.20),
Standards-Version: 4.2.1
Rules-Requires-Root: no
Homepage: https://android.googlesource.com/platform/frameworks/base
Vcs-Git: https://salsa.debian.org/android-tools-team/android-platform-frameworks-base.git
Vcs-Browser: https://salsa.debian.org/android-tools-team/android-platform-frameworks-base
Package: android-libandroidfw
Section: libs
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends},
android-libutils (>= 1:34),
android-libziparchive,
Description: Android utility library
Library providing utility functions to Android related tools. This is needed
purely to get various Android utilities working. In the Google builds of the
Android SDK, this library is statically linked, but in the Debian packaging,
it is a private shared library.
Package: android-libandroidfw-dev
Section: libdevel
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Multi-Arch: foreign
Depends: ${misc:Depends},
android-libandroidfw (= ${binary:Version}),
android-libutils-dev (>= 1:34),
android-platform-frameworks-native-headers (>= 1:34),
Breaks: android-libandroidfw (<< 21-2~)
Replaces: android-libandroidfw (<< 21-2~)
Description: Android utility library - Development files
Library providing utility functions to Android related tools. This is needed
purely to get various Android utilities working. In the Google builds of the
Android SDK, this library is statically linked, but in the Debian packaging,
it is a private shared library.
.
This package contains the development files.
Package: aapt
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Multi-Arch: foreign
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Android Asset Packaging Tool
The Android Asset Packaging Tool (aapt) takes your application resource
files, such as the AndroidManifest.xml file and the XML files for your
Activities, and compiles them. An R.java is also produced so you can
reference your resources from your Java code. This tool allows you to view,
create, and update Zip-compatible archives (zip, jar, apk). It can also
compile resources into binary assets.
Package: android-libaapt
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Android Asset Packaging Tool - Shared library
The Android Asset Packaging Tool (aapt) takes your application resource
files, such as the AndroidManifest.xml file and the XML files for your
Activities, and compiles them. An R.java is also produced so you can
reference your resources from your Java code. This tool allows you to view,
create, and update Zip-compatible archives (zip, jar, apk). It can also
compile resources into binary assets.
.
This package contains the shared library.
Package: split-select
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Multi-Arch: foreign
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: APK split and selection tool
Generates the logic for selecting a Split APK given some target Android device
configuration.
.
Using the flag --generate will emit a JSON encoded tree of rules that must be
satisfied in order to install the given Split APK. Using the flag --target
along with the device configuration will emit the set of Split APKs to install,
following the same logic that would have been emitted
Package: android-framework-res
Architecture: all
Multi-Arch: foreign
Depends: ${misc:Depends}
Description: Android platform framework resources
This package provides the Android framework resources in an apk file,
framework-res.apk

145
debian/copyright vendored Normal file
View File

@ -0,0 +1,145 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0
Upstream-Name: Android framework classes and services
Source: https://android.googlesource.com/platform/frameworks/base
Comment:
Files excluded should be kept in sync with d/orig.excludes
Files-Excluded:
.clang-format*
.gitignore
.mailmap
.prebuilt_info
*.apk
*.dex
*.gz
*.jar
*.zip
data
docs/downloads
graphics/jni/fuzz/corpus
media/tests
packages
services
testdata
tools/preload
Files: *
Copyright: 2005-2012, The Android Open Source Project
2004-2010, NXP Software
2003-2010, VisualOn
1998-2009, PacketVideo
2002-2008, John Cowan
1991-2008, Unicode, Inc.
2007, Nuance Communications
1999-2006, The Apache Software Foundation
2004, Apple Computer, Inc.
2015, Samsung LSI
License: Apache-2.0
Files: debian/*
Copyright: 2014, Hans-Christoph Steiner <hans@eds.org>
2005-2012, The Android Open Source Project
1999-2006, The Apache Software Foundation
2015-2016, Kai-Chung Yan (殷啟聰)
License: Apache-2.0
Files: libs/hwui/utils/FatVector.h
libs/hwui/utils/LinearAllocator.*
Copyright: 2012-2015, The Android Open Source Project
License: BSD-2-clause
Files: obex/javax/obex/*.java
Copyright: 2008-2009, Motorola, Inc.
2014-2015, The Android Open Source Project
2008-2009, Motorola, Inc.
License: BSD-3-clause
Files: core/jni/android/graphics/HarfBuzzNGFaceSkia.cpp
Copyright: 2012, Google Inc
License: BSD-3-clause
Files: core/jni/android/graphics/HarfBuzzNGFaceSkia.h
Copyright: 2011, Google Inc
License: BSD-3-clause
Files: telephony/java/com/android/ims/internal/IImsEcbm.aidl
telephony/java/com/android/ims/internal/IImsEcbmListener.aidl
Copyright: 2014, The Linux Foundation
License: BSD-3-clause
Files: core/java/android/text/format/TimeFormatter.java
Copyright: 1989, The Regents of the University of California
License: BSD-Berkeley
License: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the full text of the Apache License, Version 2.0
can be found in the file `/usr/share/common-licenses/Apache-2.0'.
License: BSD-2-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
License: BSD-3-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Motorola, Inc. nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
License: BSD-Berkeley
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

3
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
pristine-tar = False
sign-tags = True

56
debian/libaapt.mk vendored Normal file
View File

@ -0,0 +1,56 @@
NAME = libaapt
# tools/aapt/Android.bp
SOURCES = \
AaptAssets.cpp \
AaptConfig.cpp \
AaptUtil.cpp \
AaptXml.cpp \
ApkBuilder.cpp \
Command.cpp \
CrunchCache.cpp \
FileFinder.cpp \
Images.cpp \
Package.cpp \
pseudolocalize.cpp \
Resource.cpp \
ResourceFilter.cpp \
ResourceIdCache.cpp \
ResourceTable.cpp \
SourcePos.cpp \
StringPool.cpp \
WorkQueue.cpp \
XMLNode.cpp \
ZipEntry.cpp \
ZipFile.cpp \
SOURCES := $(foreach source, $(SOURCES), tools/aapt/$(source))
OBJECTS = $(SOURCES:.cpp=.o)
CPPFLAGS += \
-DAAPT_VERSION=\"$(ANDROID_BUILD_TOOLS_VERSION)\" \
-DSTATIC_ANDROIDFW_FOR_TOOLS \
-Ilibs/androidfw/include \
-Wno-error=implicit-fallthrough \
-Wno-format-y2k \
LDFLAGS += \
-Ldebian/out \
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-Wl,-soname,$(NAME).so.0 \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-landroidfw \
-lexpat \
-lpng \
-lpthread \
-llog \
-lutils \
-lz \
-shared \
build: $(OBJECTS)
$(CXX) $^ -o debian/out/$(NAME).so.0 $(LDFLAGS)
ln -sf $(NAME).so.0 debian/out/$(NAME).so
$(OBJECTS): %.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)

137
debian/libaapt2.mk vendored Normal file
View File

@ -0,0 +1,137 @@
NAME = libaapt2
# tools/aapt2/Android.bp
SOURCES = \
cmd/Command.cpp \
cmd/Compile.cpp \
cmd/Convert.cpp \
cmd/Diff.cpp \
cmd/Dump.cpp \
cmd/Link.cpp \
cmd/Optimize.cpp \
cmd/Util.cpp \
\
compile/IdAssigner.cpp \
compile/InlineXmlFormatParser.cpp \
compile/NinePatch.cpp \
compile/Png.cpp \
compile/PngChunkFilter.cpp \
compile/PngCrunch.cpp \
compile/PseudolocaleGenerator.cpp \
compile/Pseudolocalizer.cpp \
compile/XmlIdCollector.cpp \
configuration/ConfigurationParser.cpp \
dump/DumpManifest.cpp \
filter/AbiFilter.cpp \
filter/ConfigFilter.cpp \
format/Archive.cpp \
format/Container.cpp \
format/binary/BinaryResourceParser.cpp \
format/binary/ResChunkPullParser.cpp \
format/binary/TableFlattener.cpp \
format/binary/XmlFlattener.cpp \
format/proto/ProtoDeserialize.cpp \
format/proto/ProtoSerialize.cpp \
io/BigBufferStream.cpp \
io/File.cpp \
io/FileStream.cpp \
io/FileSystem.cpp \
io/StringStream.cpp \
io/Util.cpp \
io/ZipArchive.cpp \
link/AutoVersioner.cpp \
link/ManifestFixer.cpp \
link/NoDefaultResourceRemover.cpp \
link/ProductFilter.cpp \
link/PrivateAttributeMover.cpp \
link/ReferenceLinker.cpp \
link/ResourceExcluder.cpp \
link/TableMerger.cpp \
link/XmlCompatVersioner.cpp \
link/XmlNamespaceRemover.cpp \
link/XmlReferenceLinker.cpp \
optimize/MultiApkGenerator.cpp \
optimize/ResourceDeduper.cpp \
optimize/ResourceFilter.cpp \
optimize/ResourcePathShortener.cpp \
optimize/VersionCollapser.cpp \
process/SymbolTable.cpp \
split/TableSplitter.cpp \
text/Printer.cpp \
text/Unicode.cpp \
text/Utf8Iterator.cpp \
util/BigBuffer.cpp \
util/Files.cpp \
util/Util.cpp \
Debug.cpp \
DominatorTree.cpp \
java/AnnotationProcessor.cpp \
java/ClassDefinition.cpp \
java/JavaClassGenerator.cpp \
java/ManifestClassGenerator.cpp \
java/ProguardRules.cpp \
LoadedApk.cpp \
Resource.cpp \
ResourceParser.cpp \
ResourceTable.cpp \
ResourceUtils.cpp \
ResourceValues.cpp \
SdkConstants.cpp \
StringPool.cpp \
trace/TraceBuffer.cpp \
xml/XmlActionExecutor.cpp \
xml/XmlDom.cpp \
xml/XmlPullParser.cpp \
xml/XmlUtil.cpp \
Configuration.proto \
Resources.proto \
ResourcesInternal.proto \
ValueTransformer.cpp \
SOURCES := $(foreach source, $(SOURCES), tools/aapt2/$(source))
SOURCES += \
debian/out/proto/frameworks/base/tools/aapt2/Configuration.pb.cc \
debian/out/proto/frameworks/base/tools/aapt2/Resources.pb.cc \
debian/out/proto/frameworks/base/tools/aapt2/ResourcesInternal.pb.cc
SOURCES_CC = $(filter %.cc,$(SOURCES))
OBJECTS_CC = $(SOURCES_CC:.cc=.o)
SOURCES_CPP = $(filter %.cpp,$(SOURCES))
OBJECTS_CPP = $(SOURCES_CPP:.cpp=.o)
CXXFLAGS += -std=gnu++17 \
-fno-rtti \
CPPFLAGS += \
-Icmds/idmap2/libidmap2_policies/include \
-Idebian/out/proto/frameworks/base/tools/aapt2 \
-Ilibs/androidfw/include \
-Itools/aapt2 \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
LDFLAGS += \
-Ldebian/out \
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-Wl,-soname,$(NAME).so.0 \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-landroidfw \
-lbase \
-lexpat \
-lpng \
-lprotobuf \
-shared \
build: $(OBJECTS_CC) $(OBJECTS_CPP)
$(CXX) $^ -o debian/out/$(NAME).so.0 $(LDFLAGS)
ln -sf $(NAME).so.0 debian/out/$(NAME).so
$(OBJECTS_CPP): %.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)
$(OBJECTS_CC): %.o: %.cc
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)
debian/out/proto/frameworks/base/tools/aapt2/%.pb.cc: tools/aapt2/%.proto
mkdir -p debian/out/proto/frameworks/base/tools/aapt2
protoc --cpp_out=debian/out/proto/frameworks/base/tools/aapt2 \
--proto_path=tools/aapt2 $<

57
debian/libandroidfw.mk vendored Normal file
View File

@ -0,0 +1,57 @@
NAME = libandroidfw
# libs/androidfw/Android.bp
SOURCES = \
ApkAssets.cpp \
Asset.cpp \
AssetDir.cpp \
AssetManager.cpp \
AssetManager2.cpp \
AssetsProvider.cpp \
AttributeResolution.cpp \
ChunkIterator.cpp \
ConfigDescription.cpp \
Idmap.cpp \
LoadedArsc.cpp \
Locale.cpp \
LocaleData.cpp \
misc.cpp \
ObbFile.cpp \
PosixUtils.cpp \
ResourceTypes.cpp \
ResourceUtils.cpp \
StreamingZipInflater.cpp \
TypeWrappers.cpp \
Util.cpp \
ZipFileRO.cpp \
ZipUtils.cpp \
\
# CursorWindow.cpp \
SOURCES := $(foreach source, $(SOURCES), libs/androidfw/$(source))
OBJECTS = $(SOURCES:.cpp=.o)
CXXFLAGS += -std=gnu++17 \
-Wno-missing-field-initializers \
-Wunreachable-code \
CPPFLAGS += \
-DSTATIC_ANDROIDFW_FOR_TOOLS \
-Ilibs/androidfw/include \
LDFLAGS += \
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-Wl,-soname,$(NAME).so.0 \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-lbase \
-llog \
-lutils \
-lz \
-lziparchive \
-shared \
build: $(OBJECTS)
$(CXX) $^ -o debian/out/$(NAME).so.0 $(LDFLAGS)
ln -sf $(NAME).so.0 debian/out/$(NAME).so
$(OBJECTS): %.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)

17
debian/orig.excludes vendored Normal file
View File

@ -0,0 +1,17 @@
.clang-format*
.gitignore
.mailmap
.prebuilt_info
*.apk
*.dex
*.gz
*.jar
*.zip
data
docs/downloads
graphics/jni/fuzz/corpus
media/tests
packages
services
testdata
tools/preload

14
debian/patches/aapt_typo.diff vendored Normal file
View File

@ -0,0 +1,14 @@
Description: Fix a typo
Author: Kai-Chung Yan (殷啟聰)
Last-Update: 2016-01-10
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -40,7 +40,7 @@
void printStringPool(const ResStringPool* pool)
{
if (pool->getError() == NO_INIT) {
- printf("String pool is unitialized.\n");
+ printf("String pool is uninitialized.\n");
return;
} else if (pool->getError() != NO_ERROR) {
printf("String pool is corrupt/invalid.\n");

View File

@ -0,0 +1,22 @@
Forwarded: not-needed
--- a/tools/aapt2/AppInfo.h
+++ b/tools/aapt2/AppInfo.h
@@ -21,6 +21,8 @@
#include <set>
#include <string>
+#include <stdint.h>
+
namespace aapt {
// Information relevant to building an app, parsed from the app's AndroidManifest.xml.
--- a/tools/aapt2/cmd/Command.h
+++ b/tools/aapt2/cmd/Command.h
@@ -18,6 +18,7 @@
#define AAPT_COMMAND_H
#include <functional>
+#include <memory>
#include <optional>
#include <ostream>
#include <string>

35
debian/patches/fix-compile-error.patch vendored Normal file
View File

@ -0,0 +1,35 @@
Description: fix std::vector must have a non-const, non-volatile value_type
Forwarded: not-needed
--- a/libs/androidfw/include/androidfw/LoadedArsc.h
+++ b/libs/androidfw/include/androidfw/LoadedArsc.h
@@ -295,7 +295,7 @@
std::unordered_map<uint8_t, TypeSpec> type_specs_;
ByteBucketArray<uint32_t> resource_ids_;
std::vector<DynamicPackageEntry> dynamic_package_map_;
- std::vector<const std::pair<OverlayableInfo, std::unordered_set<uint32_t>>> overlayable_infos_;
+ std::vector<std::pair<OverlayableInfo, std::unordered_set<uint32_t>>> overlayable_infos_;
std::map<uint32_t, uint32_t> alias_id_map_;
// A map of overlayable name to actor
--- a/tools/aapt2/util/Files.cpp
+++ b/tools/aapt2/util/Files.cpp
@@ -189,7 +189,7 @@
base->append(part.data(), part.size());
}
-std::string BuildPath(std::vector<const StringPiece>&& args) {
+std::string BuildPath(std::vector<StringPiece>&& args) {
if (args.empty()) {
return "";
}
--- a/tools/aapt2/util/Files.h
+++ b/tools/aapt2/util/Files.h
@@ -59,7 +59,7 @@
void AppendPath(std::string* base, android::StringPiece part);
// Concatenates the list of paths and separates each part with the directory separator.
-std::string BuildPath(std::vector<const android::StringPiece>&& args);
+std::string BuildPath(std::vector<android::StringPiece>&& args);
// Makes all the directories in `path`. The last element in the path is interpreted as a directory.
bool mkdirs(const std::string& path);

View File

@ -0,0 +1,26 @@
Description: fix proto import paths, this dir layout is different
Forwarded: not-needed
--- android-platform-frameworks-base-10.0.0+r36.orig/tools/aapt2/Resources.proto
+++ android-platform-frameworks-base-10.0.0+r36/tools/aapt2/Resources.proto
@@ -16,7 +16,7 @@
syntax = "proto3";
-import "frameworks/base/tools/aapt2/Configuration.proto";
+import "Configuration.proto";
package aapt.pb;
--- android-platform-frameworks-base-10.0.0+r36.orig/tools/aapt2/ResourcesInternal.proto
+++ android-platform-frameworks-base-10.0.0+r36/tools/aapt2/ResourcesInternal.proto
@@ -16,8 +16,8 @@
syntax = "proto3";
-import "frameworks/base/tools/aapt2/Configuration.proto";
-import "frameworks/base/tools/aapt2/Resources.proto";
+import "Configuration.proto";
+import "Resources.proto";
package aapt.pb.internal;

48
debian/patches/hard-code-versions.patch vendored Normal file
View File

@ -0,0 +1,48 @@
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -6,7 +6,6 @@
#include "Main.h"
#include "Bundle.h"
-#include <build/version.h>
#include <utils/Compat.h>
#include <utils/Log.h>
#include <utils/threads.h>
@@ -29,7 +28,7 @@
if (bundle->getFileSpecCount() != 0) {
printf("(ignoring extra arguments)\n");
}
- printf("Android Asset Packaging Tool, v0.2-%s\n", android::build::GetBuildNumber().c_str());
+ printf("Android Asset Packaging Tool, v0.2-%s\n", "debian");
return 0;
}
--- a/tools/aapt2/util/Util.cpp
+++ b/tools/aapt2/util/Util.cpp
@@ -24,7 +24,6 @@
#include "android-base/stringprintf.h"
#include "android-base/strings.h"
#include "androidfw/StringPiece.h"
-#include "build/version.h"
#include "text/Unicode.h"
#include "text/Utf8Iterator.h"
#include "util/BigBuffer.h"
@@ -230,17 +229,7 @@ std::string GetToolFingerprint() {
// Update minor version whenever a feature or flag is added.
static const char* const sMinorVersion = "19";
- // The build id of aapt2 binary.
- static std::string sBuildId = android::build::GetBuildNumber();
-
- if (android::base::StartsWith(sBuildId, "eng.")) {
- time_t now = time(0);
- tm* ltm = localtime(&now);
-
- sBuildId = android::base::StringPrintf("eng.%d%d", 1900 + ltm->tm_year, 1 + ltm->tm_mon);
- }
-
- return android::base::StringPrintf("%s.%s-%s", sMajorVersion, sMinorVersion, sBuildId.c_str());
+ return android::base::StringPrintf("%s.%s-%s", sMajorVersion, sMinorVersion, "debian");
}
static size_t ConsumeDigits(const char* start, const char* end) {

5
debian/patches/series vendored Normal file
View File

@ -0,0 +1,5 @@
hard-code-versions.patch
aapt_typo.diff
fix-compile-error.patch
fix-proto-import-paths.patch
add-missing-headers.patch

145
debian/rules vendored Executable file
View File

@ -0,0 +1,145 @@
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk
export CC = clang
export CXX = clang++
# https://android.googlesource.com/platform/development/+/refs/tags/android-u-beta-1-gpl/sdk/build_tools_source.prop_template
export ANDROID_BUILD_TOOLS_VERSION = 33.0.0
export DEB_HOST_MULTIARCH
VERSION_UPSTREAM=$(DEB_VERSION_UPSTREAM)
## Only need below if we need to pull an unofficial release version, e.g. from a devel branch
#VERSION_UPSTREAM=u-beta-1-gpl
## Security Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
# https://android.googlesource.com/platform/build/soong/+/refs/tags/android-u-beta-1-gpl/cc/config/global.go#307
export DEB_CFLAGS_MAINT_APPEND = -fPIC -std=gnu17 -gdwarf-4
export DEB_CXXFLAGS_MAINT_APPEND = -fPIC -std=gnu++2a -gdwarf-4
export DEB_LDFLAGS_MAINT_APPEND = -fPIC
export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG -UDEBUG \
-I/usr/include/android \
-Wno-c99-designator \
-Wno-gnu-designator \
-Wno-gnu-folding-constant \
-fmessage-length=0 \
-fno-exceptions \
-fno-strict-aliasing \
-no-canonical-prefixes \
ifneq (, $(shell which lld))
export DEB_LDFLAGS_MAINT_APPEND += -fuse-ld=lld -Wl,--build-id=sha1
endif
ifeq ($(IMPORT_VER),)
GBP_IMPORT = --uscan
else ifneq ("$(wildcard ../$(DEB_SOURCE)_$(IMPORT_VER).tar.gz)","")
GBP_IMPORT = ../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar.xz
else
GBP_IMPORT =
endif
debian/out/aapt: debian/aapt.mk debian/out/libaapt.so
dh_auto_build --buildsystem=makefile -- -f $<
debian/out/aapt2: debian/aapt2.mk debian/out/libaapt2.so
dh_auto_build --buildsystem=makefile -- -f $<
debian/out/lib%.so: debian/lib%.mk debian/out/libandroidfw.so
dh_auto_build --buildsystem=makefile -- -f $<
debian/out/split-select: debian/split-select.mk debian/out/libandroidfw.so debian/out/libaapt.so
dh_auto_build --buildsystem=makefile -- -f $<
debian/out/%_test: debian/%_test.mk debian/out/libaapt2.so
dh_auto_build --buildsystem=makefile -- --file=$<
%:
dh $@ --with bash-completion
override_dh_auto_configure:
mkdir -p debian/out
rm -f tools/aapt2/integration-tests/ConvertTest/duplicate_entries.apk
dh_auto_configure
override_dh_auto_build-arch: debian/out/aapt debian/out/aapt2 debian/out/split-select
pandoc -s -o debian/out/split-select.1 debian/split-select.1.md
override_dh_auto_build-indep: debian/out/aapt2
LD_LIBRARY_PATH=debian/out \
debian/out/aapt2 compile --dir core/res/res \
-o debian/out/resources.zip
LD_LIBRARY_PATH=debian/out \
debian/out/aapt2 link --manifest core/res/AndroidManifest.xml \
debian/out/resources.zip \
-o debian/out/framework-res.apk \
-A core/res/assets \
--min-sdk-version 33 --target-sdk-version 33 \
--product default \
--version-code 33 --version-name 13.0.0
# Build-Depends (for dh_auto_test): wget
# If there's no wget, some tests in aapt2_test will be skipped
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
# Skip building aapt2_test for mipsel and mips64el, due to ftbfs: tools/aapt2/filter/AbiFilter_test.cpp:58:8: error: expected unqualified-id
ifeq ($(filter mipsel mips64el,$(DEB_HOST_ARCH)),)
override_dh_auto_test-arch: debian/out/aapt2_test
LD_LIBRARY_PATH=debian/out debian/out/aapt version
LD_LIBRARY_PATH=debian/out debian/out/aapt2 version
ifneq (, $(shell which wget))
for dir in ConvertTest CommandTests CompileTest; do \
(mkdir -p debian/out/integration-tests/$$dir; cd debian/out/integration-tests/$$dir; \
wget -qO ../$${dir}.tgz \
https://android.googlesource.com/platform/frameworks/base/+archive/refs/tags/android-$(subst +,_,$(VERSION_UPSTREAM))/tools/aapt2/integration-tests/$${dir}.tar.gz && \
tar xfz ../$${dir}.tgz && rm ../$${dir}.tgz); \
done
endif
LD_LIBRARY_PATH=debian/out debian/out/aapt2_test
endif
endif
# Depends: git-buildpackage
get-orig-source:
ifneq ($(GBP_IMPORT),--uscan)
ifeq ("$(wildcard ../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar.xz)","")
mkdir -p $(DEB_SOURCE)_$(IMPORT_VER)
tar xfz ../$(DEB_SOURCE)_$(IMPORT_VER).tar.gz -C $(DEB_SOURCE)_$(IMPORT_VER)
(cd $(DEB_SOURCE)_$(IMPORT_VER); tar cf ../../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar --exclude-from ../debian/orig.excludes .)
rm -r $(DEB_SOURCE)_$(IMPORT_VER)
mkdir -p $(DEB_SOURCE)_$(IMPORT_VER)
tar xf ../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar -C $(DEB_SOURCE)_$(IMPORT_VER)
find $(DEB_SOURCE)_$(IMPORT_VER) -type d -empty -delete
rm ../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar
(cd $(DEB_SOURCE)_$(IMPORT_VER); tar cf ../../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar --mtime=20100517 .)
xz -9 < ../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar > $(GBP_IMPORT)
rm -r $(DEB_SOURCE)_$(IMPORT_VER) ../$(DEB_SOURCE)_$(IMPORT_VER).orig.tar
endif
endif
gbp import-orig $(GBP_IMPORT) \
--no-interactive --debian-branch=$(shell git symbolic-ref --short HEAD) \
--postimport="\
dch -b -v\$$GBP_DEBIAN_VERSION \"New upstream release \$$GBP_UPSTREAM_VERSION\"; \
git add debian/changelog; \
git commit -m\"dch: Note new upstream version \$$GBP_UPSTREAM_VERSION\""
check-upstream:
$(eval count = $$(shell git show upstream|wc -l))
@test $(count) -gt 10 || ( \
git reset --hard HEAD^^; \
git tag -d upstream/$(shell echo $(DEB_VERSION_UPSTREAM)|sed "s/~/_/g;s/:/%/g"); \
git checkout upstream; git reset --hard HEAD^; git checkout $(shell git symbolic-ref --short HEAD); \
echo; \
echo error: Line count of upstream/$(DEB_VERSION_UPSTREAM): $(count); \
echo Upstream changes does not deserve an update.;\
echo; \
exit 1; \
)
ifeq ($(GBP_IMPORT),)
update:
@echo Cannot find orig to import: ../$(DEB_SOURCE)_$(IMPORT_VER).tar.gz
else
update: get-orig-source check-upstream
@echo Package updated to upstream version: $(shell dpkg-parsechangelog -SVersion|sed 's/-[^-]*$$//'|sed 's/^[0-9]*://')
endif

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

4
debian/source/lintian-overrides vendored Normal file
View File

@ -0,0 +1,4 @@
# The upstream repository is supposed to work with the entire AOSP altogether
# and unfortunately this symlink happens to be cross-repository.
source-contains-unsafe-symlink native/android/include/android/multinetwork.h

49
debian/split-select.1.md vendored Normal file
View File

@ -0,0 +1,49 @@
% SPLIT-SELECT(1)
% The Android Open Source Project
# NAME
split-select - APK split and selection tool
WARNING: This manual might be outdated, please refer to `split-select --help`.
# SYNOPSIS
**split-select** --help
**split-select** --target _config_ --base _path/to/apk_
[--split _path/to/apk_ [...]]
**split-select** --generate --base _path/to/apk_ [--split _path/to/apk_ [...]]
# OPTIONS
--help
: Displays more information about this program.
--target _config_
: Performs the Split APK selection on the given configuration.
--generate
: Generates the logic for selecting the Split APK, in JSON format.
--base _path/to/apk_
: Specifies the base APK, from which all Split APKs must be based off.
--split _path/to/apk_
: Includes a Split APK in the selection process.
Where **config** is an extended AAPT resource qualifier of the form
"resource-qualifiers:extended-qualifiers", where "resource-qualifiers" is an
AAPT resource qualifier (ex: en-rUS-sw600dp-xhdpi), and 'extended-qualifiers'
is an ordered list of one qualifier (or none) from each category:
```
Architecture: armeabi, armeabi-v7a, arm64-v8a, x86, x86_64, mips
```
Generates the logic for selecting a Split APK given some target Android device
configuration. Using the flag **--generate** will emit a JSON encoded tree of
rules that must be satisfied in order to install the given Split APK. Using the
flag **--target** along with the device configuration will emit the set of Split
APKs to install, following the same logic that would have been emitted via JSON.

1
debian/split-select.docs vendored Normal file
View File

@ -0,0 +1 @@
NOTICE

1
debian/split-select.install vendored Normal file
View File

@ -0,0 +1 @@
debian/out/split-select usr/lib/android-sdk/build-tools/debian

1
debian/split-select.links vendored Normal file
View File

@ -0,0 +1 @@
usr/lib/android-sdk/build-tools/debian/split-select usr/bin/split-select

12
debian/split-select.lintian-overrides vendored Normal file
View File

@ -0,0 +1,12 @@
# Executables from the Android SDK normally each staticly link in all
# of the libs. That means each executable includes a full copy of all
# the libs, which is not how Debian works. These libs need to be
# dynamically linlked in so that just the library can be updated when
# there is a security fix, instead of requiring all of the executables
# be recompiled. That said, these libraries do not have a stable
# interface and were never intended to be used by any other project,
# only with the internal, Android SDK executables. Therefore, the
# Android SDK executables use private libraries located in
# /usr/lib/${DEB_HOST_MULTIARCH}/android
custom-library-search-path

1
debian/split-select.manpages vendored Normal file
View File

@ -0,0 +1 @@
debian/out/split-select.1

35
debian/split-select.mk vendored Normal file
View File

@ -0,0 +1,35 @@
NAME = split-select
# tools/split-select/Android.bp
SOURCES = \
Abi.cpp \
Grouper.cpp \
Rule.cpp \
RuleGenerator.cpp \
SplitDescription.cpp \
SplitSelector.cpp \
Main.cpp \
SOURCES := $(foreach source, $(SOURCES), tools/split-select/$(source))
OBJECTS = $(SOURCES:.cpp=.o)
CPPFLAGS += \
-D_DARWIN_UNLIMITED_STREAMS \
-Ilibs/androidfw/include \
-Itools \
LDFLAGS += \
-Ldebian/out \
-L/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-Wl,-rpath=/usr/lib/$(DEB_HOST_MULTIARCH)/android \
-laapt \
-landroidfw \
-llog \
-lutils \
-pie
build: $(OBJECTS)
$(CXX) $^ -o debian/out/$(NAME) $(LDFLAGS)
$(OBJECTS): %.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS)

19
debian/tests/control vendored Normal file
View File

@ -0,0 +1,19 @@
Test-Command: aapt version
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Depends: aapt
Test-Command: aapt2 version
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Depends: aapt
Restrictions: allow-stderr
Test-Command: for i in strings badging permissions resources configurations; do aapt dump $i /usr/share/android-framework-res/framework-res.apk > /dev/null; done
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Depends: aapt, android-framework-res
Test-Command: for i in badging configurations packagename permissions strings resources overlayable; do aapt2 dump $i /usr/share/android-framework-res/framework-res.apk > /dev/null; done
Architecture: amd64 i386 armel armhf arm64 mipsel mips64el riscv64
Depends: aapt, android-framework-res
Test-Command: ls -l /usr/share/android-framework-res/framework-res.apk
Depends: android-framework-res

7
debian/upstream/metadata vendored Normal file
View File

@ -0,0 +1,7 @@
---
Archive: Google Git
Repository: https://android.googlesource.com/platform/frameworks/base
Repository-Browse: https://android.googlesource.com/platform/frameworks/base
Homepage: https://source.android.com/source/developing.html
Bug-Database: https://issuetracker.google.com/issues?q=componentid:192728%20status:open
Bug-Submit: https://developer.android.com/studio/report-bugs

8
debian/watch vendored Normal file
View File

@ -0,0 +1,8 @@
# this produces a corrupt tarball, see README.source and get-orig-source
version=4
opts="pagemangle=s%\">android-%\.tar\.gz\">android-%g;s%/\+/refs/tags/%/+archive/%g, \
oversionmangle=s%_r(\d+|\d+\.\d+|\w)%+r$1%, \
repack, compression=xz, \
filenamemangle=s%[\w\/\.:]+\+archive\/android-%@PACKAGE@-%" \
https://android.googlesource.com/platform/frameworks/base/+refs \
[\w\/]+\+archive\/android-([0-9\.]+_r\d+|\d+\.\d+|\w)\.tar\.gz