Skip to main content
Sign in
Snippets Groups Projects
Commit b5acc813 authored by Dan Ballard's avatar Dan Ballard
Browse files

Bug 41082: Tor Expert Bundle android builds create .aar file

parent 7c9183b0
No related branches found
No related tags found
1 merge request!910Bug 41082: Tor Expert Bundle android builds create .aar file
......@@ -90,10 +90,10 @@ mv [% c('input_files_by_name/noscript') %] "$TBDIR/$EXTSPATH/{73a6fe31-595d-460b
[% END -%]
}
tar -xvf [% c('input_files_by_name/tor-expert-bundle') %]
tar -xvf [% c('input_files_by_name/tor-expert-bundle') %]/tor-expert-bundle.tar.gz
[% IF c("var/macos_universal") -%]
mkdir aarch64
tar -C aarch64 -xf [% c('input_files_by_name/tor-expert-bundle-aarch64') %]
tar -C aarch64 -xf [% c('input_files_by_name/tor-expert-bundle-aarch64') %]/tor-expert-bundle.tar.gz
[% END -%]
# geoip(6) and anything else that belongs in the data dir from the expert bundle
......@@ -451,13 +451,13 @@ fi
[%IF c("var/tor-browser") -%]
tor_expert_bundle_src="[% c("input_files_by_name/tor-expert-bundle") %]"
# strip off trailing "$buildid.tar.gz"
tor_expert_bundle_dest=${tor_expert_bundle_src:0:-14}.tar.gz
cp $rootdir/[% c("input_files_by_name/tor-expert-bundle") %] "$OUTDIR"/$tor_expert_bundle_dest
tor_expert_bundle_dest=${tor_expert_bundle_src:0:-7}.tar.gz
cp $rootdir/[% c("input_files_by_name/tor-expert-bundle") %]/tor-expert-bundle.tar.gz "$OUTDIR"/$tor_expert_bundle_dest
[% IF c("var/macos_universal") %]
tor_expert_bundle_src="[% c('input_files_by_name/tor-expert-bundle-aarch64') %]"
# strip off trailing "$buildid.tar.gz"
tor_expert_bundle_dest=${tor_expert_bundle_src:0:-14}.tar.gz
cp $rootdir/[% c('input_files_by_name/tor-expert-bundle-aarch64') %] "$OUTDIR"/$tor_expert_bundle_dest
tor_expert_bundle_dest=${tor_expert_bundle_src:0:-7}.tar.gz
cp $rootdir/[% c('input_files_by_name/tor-expert-bundle-aarch64') %]/tor-expert-bundle.tar.gz "$OUTDIR"/$tor_expert_bundle_dest
[% END -%]
[% END -%]
[% IF c("var/build_infos_json") -%]
......
......
......@@ -24,7 +24,7 @@ cd /var/tmp/build
mv $rootdir/[% c('input_files_by_name/noscript') %] "$noscript_path"
[%IF c("var/tor-browser") -%]
tar -xaf "$rootdir/[% c("input_files_by_name/tor-expert-bundle") %]" tor/pluggable_transports/pt_config.json
tar -xaf "$rootdir/[% c("input_files_by_name/tor-expert-bundle") %]/tor-expert-bundle.tar.gz" tor/pluggable_transports/pt_config.json
[% END -%]
unzip -j "$apk" assets/omni.ja
mkdir omni
......@@ -70,8 +70,8 @@ unsign_patch="[% dest_dir %]/[% c('filename') %]/[% c('var/project-name') %]-qa-
bsdiff $qa_apk $aligned_apk $unsign_patch
[%IF c("var/tor-browser") -%]
tor_expert_bundle_src="[% c("input_files_by_name/tor-expert-bundle") %]"
tor_expert_bundle_src="[% c('input_files_by_name/tor-expert-bundle') %]"
# strip off trailing "$buildid.tar.gz"
tor_expert_bundle_dest=${tor_expert_bundle_src:0:-14}.tar.gz
cp $rootdir/$tor_expert_bundle_src [% dest_dir %]/[% c('filename') %]/$tor_expert_bundle_dest
tor_expert_bundle_dest=${tor_expert_bundle_src:0:-7}.tar.gz
cp "$rootdir/[% c("input_files_by_name/tor-expert-bundle") %]/tor-expert-bundle.tar.gz" [% dest_dir %]/[% c('filename') %]/$tor_expert_bundle_dest
[% END -%]
......@@ -35,7 +35,7 @@ rm -fR service/src/main/jniLibs/*
# Extract tor-expert-bundle
tebdir=$rootdir/tor-expert-bundle-[% arch %]
mkdir $tebdir
tar -C $tebdir -xf $rootdir/[% c('input_files_by_name/tor-expert-bundle-' _ arch) %]
tar -C $tebdir -xf $rootdir/[% c('input_files_by_name/tor-expert-bundle-' _ arch) %]/tor-expert-bundle.tar.gz
# Figure out our android abi from our arch
[% IF arch == "armv7" -%]
......
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.torproject.torExpertBundle"
android:versionCode="1"
android:versionName="0.0.1" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="29" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:allowBackup="false" >
</application>
</manifest>
\ No newline at end of file
......@@ -2,6 +2,10 @@
[% c("var/set_default_env") -%]
distdir=/var/tmp/dist/[% project %]
mkdir -p $distdir
output_dir=[% dest_dir %]/[% c('filename') %]
mkdir -p $output_dir
cd $distdir
tar -xkf $rootdir/[% c('input_files_by_name/tor') %]
......@@ -18,6 +22,32 @@ tar -xkf $rootdir/[% c('input_files_by_name/conjure') %]
awk '{gsub(/\$\{pt_extension\}/, "[% c("var/pt_extension") %]"); print}' $rootdir/pt_config.json > pt_config.json
cd $distdir
# package a .aar on android
[% IF c("var/android") -%]
aar_file=torExpertBundle-[% c('arch') %].aar
mkdir aar
mkdir -p aar/jni/[% c('arch') %]
mkdir -p aar/assets/common
cp -a tor/libTor.so aar/jni/[% c('arch') %]/
cp -a tor/pluggable_transports/conjure-client aar/jni/[% c('arch') %]/libConjure.so
cp -a tor/pluggable_transports/lyrebird aar/jni/[% c('arch') %]/Lyrebird.so
cp -a tor/pluggable_transports/snowflake-client aar/jni/[% c('arch') %]/libSnowflake.so
cp -a tor/pluggable_transports/webtunnel-client aar/jni/[% c('arch') %]/libWebtunnel.so
cp -a data/* aar/assets/common/
cp -a tor/pluggable_transports/pt_config.json aar/assets/common/
cp -a $rootdir/AndroidManifest.xml aar/
cd aar
jar -cvf $output_dir/tor-expert-bundle-[% c('arch') %].aar *
cd ..
[% END %]
[%
SET tar_src = [ "tor", "data" ];
IF c("var/linux");
......@@ -25,6 +55,6 @@ cd $distdir
END;
c('tar', {
tar_src => tar_src,
tar_args => '-czvf' _ dest_dir _ '/' _ c('filename'),
tar_args => '-czvf' _ dest_dir _ '/' _ c('filename') _ '/tor-expert-bundle.tar.gz',
});
%]
\ No newline at end of file
# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("var/osname") %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
filename: '[% project %]-[% c("var/osname") %]-[% c("version") %]-[% c("var/build_id") %]'
version: '[% c("var/torbrowser_version") %]'
container:
......@@ -23,3 +23,4 @@ input_files:
- name: conjure
project: conjure
- filename: pt_config.json
- filename: AndroidManifest.xml
......@@ -43,7 +43,7 @@ patch -p1 < $rootdir/0001-Bug-40800-Add-WebTunnel-support.patch
# Extract tor-expert-bundle
tebdir=$rootdir/tor-expert-bundle-[% arch %]
mkdir $tebdir
tar -C $tebdir -xf $rootdir/[% c('input_files_by_name/tor-expert-bundle-' _ arch) %]
tar -C $tebdir -xf $rootdir/[% c('input_files_by_name/tor-expert-bundle-' _ arch) %]/tor-expert-bundle.tar.gz
ptdir=$tebdir/tor/pluggable_transports
# Overwrite the obfs4proxy binary provided by Pluto and add Snowflake
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment