Opened 9 months ago

Closed 6 months ago

Last modified 6 months ago

#32993 closed defect (fixed)

Package Tor With Tor Android Service Project

Reported by: sisbell Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-mobile, tbb-rbm, tbb-parity, TorBrowserTeam202004R
Cc: sysrqb, sisbell, hans@…, tbb-team, boklm Actual Points:
Parent ID: #28704 Points:
Reviewer: sysrqb Sponsor:

Description

Currently tor-android-service uses pre-built tor library. Start using the tor library that is part of the build.

Child Tickets

Change History (14)

comment:1 Changed 8 months ago by pili

Keywords: TorBrowserTeam202002 added; TorBrowserTeam202001 removed

Moving tickets to February

comment:2 Changed 8 months ago by sisbell

Status: newneeds_review

Packages tor into android library

https://github.com/sisbell/tor-browser-build/commits/bug-32993

comment:3 Changed 8 months ago by boklm

Keywords: TorBrowserTeam202002R added; TorBrowserTeam202002 removed

comment:4 Changed 8 months ago by pili

Keywords: TorBrowserTeam202003R added; TorBrowserTeam202002R removed

We are no longer in February moving reviews

comment:5 Changed 8 months ago by sysrqb

Reviewer: boklm

comment:6 Changed 7 months ago by pili

Keywords: TorBrowserTeam202004R added; TorBrowserTeam202003R removed

We are no longer in March

comment:7 Changed 7 months ago by sysrqb

Reviewer: boklmsysrqb

I wonder why I did that.

comment:8 Changed 6 months ago by sysrqb

Cc: boklm added

Is there a reason to extract tor.tar.gz into a temporary directory and then copy all of the content into service/src/main? Can we simply extract tor.tar.gz directly into service/src/main instead?

Maybe boklm has an opinion on this.

diff --git a/projects/tor-android-service/build b/projects/tor-android-service/build
index 8f8d16d5..1521217f 100644
--- a/projects/tor-android-service/build
+++ b/projects/tor-android-service/build
@@ -8,10 +8,11 @@ cp -r $gradle_repo/dl/android/maven2/* $gradle_repo
 cp -r $gradle_repo/plugins-release/* $gradle_repo
 cp -r $gradle_repo/maven2/* $gradle_repo
 
-mkdir -p /var/tmp/build $output_dir
+mkdir -p /var/tmp/build /var/tmp/dist/tor $output_dir
 
 [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
 tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
+tar -C /var/tmp/dist/tor -xf [% c('input_files_by_name/tor') %]/tor.tar.gz
 
 cd /var/tmp/build/[% project %]-[% c('version') %]
 patch -p1 < $rootdir/remove-native-build.patch
@@ -19,6 +20,10 @@ patch -p1 < $rootdir/remove-native-build.patch
 # Remove native files, otherwise build will fail after gradle.patch
 rm -fR service/src/main/jni
 
+# Replace pre-packaged tor library with the latest build
+rm -fR service/src/main/jniLibs/*
+cp -r /var/tmp/dist/tor/* service/src/main
+

comment:9 in reply to:  8 ; Changed 6 months ago by boklm

Keywords: TorBrowserTeam202004 added; TorBrowserTeam202004R removed
Status: needs_reviewneeds_revision

Replying to sysrqb:

Is there a reason to extract tor.tar.gz into a temporary directory and then copy all of the content into service/src/main? Can we simply extract tor.tar.gz directly into service/src/main instead?

Yes, I think we should extract it in service/src/main directly.

comment:10 in reply to:  9 ; Changed 6 months ago by sisbell

Replying to boklm:

Replying to sysrqb:

Is there a reason to extract tor.tar.gz into a temporary directory and then copy all of the content into service/src/main? Can we simply extract tor.tar.gz directly into service/src/main instead?

Yes, I think we should extract it in service/src/main directly.

We have under consideration the uploading the tor packages to a central repo (like maven central). If we package directly into 'service/src/main' then that won't work cleanly with other projects that want to use tor for android.

comment:11 in reply to:  10 Changed 6 months ago by boklm

Replying to sisbell:

Replying to boklm:

Replying to sysrqb:

Is there a reason to extract tor.tar.gz into a temporary directory and then copy all of the content into service/src/main? Can we simply extract tor.tar.gz directly into service/src/main instead?

Yes, I think we should extract it in service/src/main directly.

We have under consideration the uploading the tor packages to a central repo (like maven central). If we package directly into 'service/src/main' then that won't work cleanly with other projects that want to use tor for android.

The proposed patch is extracting tor to /var/tmp/dist/tor, before copying it to service/src/main. Why can't we just extract it to service/src/main? I don't think it changes anything related to maven central, it's just a simplification of tor-android-service build script.

comment:12 Changed 6 months ago by sisbell

Status: needs_revisionneeds_review

This change includes

  • moved the 'remove-native-build.patch' patch in same block as removing the old jni lib since they are part of same operation
  • extracted tor directly to 'service/src/main'

https://github.com/sisbell/tor-browser-build/commits/bug-32993a

comment:13 in reply to:  12 ; Changed 6 months ago by boklm

Keywords: TorBrowserTeam202004R added; TorBrowserTeam202004 removed
Resolution: fixed
Status: needs_reviewclosed

Replying to sisbell:

This change includes

  • moved the 'remove-native-build.patch' patch in same block as removing the old jni lib since they are part of same operation
  • extracted tor directly to 'service/src/main'

https://github.com/sisbell/tor-browser-build/commits/bug-32993a

This looks good to me. I merged this branch to master with commit acfda9f43d3203bb12913b56cbf8c3891a16253c.

I checked that it builds correctly on all android platforms. However I didn't check that the apk is working correctly.

comment:14 in reply to:  13 Changed 6 months ago by gk

Replying to boklm:

Replying to sisbell:

This change includes

  • moved the 'remove-native-build.patch' patch in same block as removing the old jni lib since they are part of same operation
  • extracted tor directly to 'service/src/main'

https://github.com/sisbell/tor-browser-build/commits/bug-32993a

This looks good to me. I merged this branch to master with commit acfda9f43d3203bb12913b56cbf8c3891a16253c.

I checked that it builds correctly on all android platforms. However I didn't check that the apk is working correctly.

It is not. The log says it's still the old Tor that is loaded when testing a nightly build containing all the fixes for #28704 and children. I opened #33930 for that.

Note: See TracTickets for help on using tickets.