2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=http://developer.android.com/tools/help/index.html
|
|
|
|
TERMUX_PKG_DESCRIPTION="Command which takes in class files and reformulates them for usage on Android"
|
2019-01-21 15:00:12 +01:00
|
|
|
TERMUX_PKG_LICENSE="Apache-2.0"
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_VERSION=$TERMUX_ANDROID_BUILD_TOOLS_VERSION
|
2019-08-14 13:27:16 +02:00
|
|
|
TERMUX_PKG_SKIP_SRC_EXTRACT=true
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_make_install() {
|
2017-11-17 02:06:11 +01:00
|
|
|
# Rewrite packages to avoid using com.android.* classes which may clash with
|
|
|
|
# classes in the Android runtime on devices (see #1801):
|
|
|
|
local JARJAR=$TERMUX_PKG_CACHEDIR/jarjar.jar
|
|
|
|
local RULEFILE=$TERMUX_PKG_TMPDIR/jarjar-rule.txt
|
|
|
|
local REWRITTEN_DX=$TERMUX_PKG_TMPDIR/dx-rewritten.jar
|
|
|
|
termux_download \
|
|
|
|
http://central.maven.org/maven2/com/googlecode/jarjar/jarjar/1.3/jarjar-1.3.jar \
|
|
|
|
$JARJAR \
|
|
|
|
4225c8ee1bf3079c4b07c76fe03c3e28809a22204db6249c9417efa4f804b3a7
|
|
|
|
echo 'rule com.android.** dx.@1' > $RULEFILE
|
|
|
|
java -jar $JARJAR process $RULEFILE \
|
|
|
|
$ANDROID_HOME/build-tools/${TERMUX_PKG_VERSION}/lib/dx.jar \
|
|
|
|
$REWRITTEN_DX
|
|
|
|
|
|
|
|
# Dex the rewritten jar file:
|
2017-02-02 01:39:29 +01:00
|
|
|
mkdir -p $TERMUX_PREFIX/share/dex
|
2018-07-26 12:21:43 +02:00
|
|
|
$TERMUX_D8 \
|
|
|
|
--release \
|
2019-09-25 23:00:56 +02:00
|
|
|
--min-api $TERMUX_PKG_API_LEVEL \
|
2018-07-26 12:21:43 +02:00
|
|
|
--output $TERMUX_PKG_TMPDIR \
|
2017-11-17 02:06:11 +01:00
|
|
|
$REWRITTEN_DX
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2018-07-26 12:21:43 +02:00
|
|
|
cd $TERMUX_PKG_TMPDIR
|
|
|
|
jar cf dx.jar classes.dex
|
|
|
|
mv dx.jar $TERMUX_PREFIX/share/dex/dx.jar
|
|
|
|
|
2015-06-13 01:03:31 +02:00
|
|
|
install $TERMUX_PKG_BUILDER_DIR/dx $TERMUX_PREFIX/bin/dx
|
2016-05-06 01:55:13 +02:00
|
|
|
perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dx
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|