diff --git a/README.md b/README.md index c6710dfc3b6f92876a9e2dc33d812469b797349f..bcf9fc7da84ec5056cdd0b28f24736085b858478 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,44 @@ This Module (aar) implements IpScramblerModule functionnalities with Tor, reliying on a fork of OrbotService. +# Build +PrivacyModuleTor includes git repo submodules of OrbotService, the module used by Orbot to run Tor -# Functionalities +Be sure that you have all of the git submodules up-to-date: -## v0.2.0 + git submodule update --init --recursive -* appList is now a bypass tor app list. -* add a parameter enableNotification on start tor, which hide service notification (set to false). +You can build the AAR modules : + + ./gradlew :orbotservice:assembleRelease :privacymoduletor:assembleRelease + +To deploy localy during development + + ./gradlew --console=verbose publishToMavenLocal + +This will put compiled AAR and pom file exposing their dependencies in the local maven +repository (usually in ~/.m2/repository). + + +To push release on gitlab + + ./gradlew --console=verbose publish + +# Update orbotservice to an upper Orbot version + +1. Upgrade the code: follow the steps in [orbotservice/README.md](orbotservice/README.md) +2. Prepare the orbotservice the dependencies : follow the steps in [exportdependencies/update_dependencies.md](exportdependencies/update_dependencies.md), first using the mvn install:install-file command +3. build and deploy orbotservice locally: + + ./gradlew :orbotservice:assembleRelease + ./gradlew --console=verbose :orbotservice:publishToMavenLocal + +4. build and deploy locally privacymoduletor + ./gradlew :orbotservice:assembleRelease :privacymoduletor:assembleRelease + ./gradlew --console=verbose :privacymoduletor:publishToMavenLocal +5. Test this new version with advanced privacy, and merge the orbotservice. +6. deploy the orbotservice dependencies to gitlab registry see [exportdependencies/update_dependencies.md](exportdependencies/update_dependencies.md), using mvn deploy:deploy-file command +7. deploy orbotservice in gitlab registry + ./gradlew --console=verbose :orbotservice:publish +8. Create privacymoduletor MR. CI will prepare and publish the privacymoduletor.aar . diff --git a/build.gradle b/build.gradle index 2b8e34cf225c332793bafc665de0b43ba80802a7..74fc18585a645a603a8c90f79476b2e8b11a7e7f 100644 --- a/build.gradle +++ b/build.gradle @@ -2,12 +2,10 @@ apply plugin: 'maven-publish' buildscript { - apply from: './dependencies.gradle' - ext.kotlin_version = "1.6.10" - ext.orbot_version = "orbot-16.6.2" - ext.orbot_service_revision = "2" - ext.advanced_privacy_version = "1.7.0" + ext.advanced_privacy_version = "1.10.0" + + apply from: './dependencies.gradle' repositories { google() @@ -18,59 +16,3 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } - -configure(project(':orbotservice')) { - publishing { - publications { - maven(MavenPublication) { - groupId 'foundation.e' - //You can either define these here or get them from project conf elsewhere - artifactId 'orbotservice' - version "$orbot_version-$orbot_service_revision" - artifact "$buildDir/outputs/aar/orbotservice-release.aar" //aar artifact you want to publish - - //generate pom nodes for dependencies - pom.withXml { - def dependenciesNode = asNode().appendNode('dependencies') - configurations.implementation.allDependencies.each { dependency -> - if (dependency.name != 'unspecified') { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', dependency.group) - dependencyNode.appendNode('artifactId', dependency.name) - dependencyNode.appendNode('version', dependency.version) - } - } - } - - repositories { - def ciJobToken = System.getenv("CI_JOB_TOKEN") - def ciApiV4Url = System.getenv("CI_API_V4_URL") - if (ciJobToken != null) { - maven { - url "${ciApiV4Url}/projects/1063/packages/maven" - credentials(HttpHeaderCredentials) { - name = 'Job-Token' - value = ciJobToken - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - maven { - url "https://gitlab.e.foundation/api/v4/projects/1063/packages/maven" - credentials(HttpHeaderCredentials) { - name = "Private-Token" - value = gitLabPrivateToken - // the variable resides in ~/.gradle/gradle.properties - } - authentication { - header(HttpHeaderAuthentication) - } - } - } - } - } - } - } -} diff --git a/dependencies.gradle b/dependencies.gradle index 62435469dbac85bd05eb72cad915bf900649e968..3b5431904b48be8735463c7d502b77826f62032c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -21,11 +21,12 @@ ext { guardian_geoip : "20191217", guardian_jsocks : "1.0.4", guardian_jtorctl : "0.4.5.7", - ipt_proxy : "1.7.1", + ipt_proxy : "1.8.1", portmapper : "2.0.5", - tor_android : "0.4.7.8", + tor_android : "0.4.7.10", pcap_core : "1.8.2", - pcap_factory : "1.8.2" + pcap_factory : "1.8.2", + orbot_service : "orbot-16.6.3-1" ] libs = [ @@ -48,12 +49,12 @@ ext { apl_appintro : "com.github.apl-devs:appintro:$versions.apl_appintro", bclogic_pulsator : "pl.bclogic:pulsator4droid:$versions.bclogic_pulsator", fastlane_screengrab : "tools.fastlane:screengrab:$versions.fastlane_screengrab", - guardian_geoip : "info.guardianproject:geoip:$versions.guardian_geoip", + guardian_geoip : "foundation.e:geoip:$versions.orbot_service", guardian_jsocks : "com.gitlab.guardianproject:jsocksandroid:$versions.guardian_jsocks", guardian_jtorctl : "info.guardianproject:jtorctl:$versions.guardian_jtorctl", - ipt_proxy : "com.github.bitmold:OrbotIPtProxy:$versions.ipt_proxy", + ipt_proxy : "foundation.e:OrbotIPtProxy:$versions.orbot_service", portmapper : "com.offbynull.portmapper:portmapper:$versions.portmapper", - tor_android : "info.guardianproject:tor-android:$versions.tor_android", + tor_android : "foundation.e:tor-android:$versions.orbot_service", pcap_core : "org.pcap4j:pcap4j-core:$versions.pcap_core", pcap_factory : "org.pcap4j:pcap4j-packetfactory-static:$versions.pcap_factory" ] diff --git a/exportdependencies/pom.xml b/exportdependencies/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..0dfb098b4853714f89f5833472a2581c35d3b494 --- /dev/null +++ b/exportdependencies/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + foundation.e + orbotservice + orbot-16.6.3-1 + + + + + ${project.groupId} + ${project.artifactId} + ${project.version} + aar + OrbotLib.aar + + + + + gitlab-e-maven + https://gitlab.e.foundation/api/v4/projects/1063/packages/maven + + + diff --git a/exportdependencies/publish.gradle b/exportdependencies/publish.gradle new file mode 100644 index 0000000000000000000000000000000000000000..657ce22afef1b056cfe62c8c60b510d2141a0532 --- /dev/null +++ b/exportdependencies/publish.gradle @@ -0,0 +1,52 @@ +apply plugin: 'maven-publish' + +publishing { + publications { + maven(MavenPublication) { + groupId 'foundation.e' + artifactId 'orbotservice' + version versions.orbot_service + artifact "$buildDir/outputs/aar/orbotservice-release.aar" + + pom.withXml { + def dependenciesNode = asNode().appendNode('dependencies') + configurations.implementation.allDependencies.each { dependency -> + if (dependency.name != 'unspecified') { + def dependencyNode = dependenciesNode.appendNode('dependency') + dependencyNode.appendNode('groupId', dependency.group) + dependencyNode.appendNode('artifactId', dependency.name) + dependencyNode.appendNode('version', dependency.version) + } + } + } + + repositories { + def ciJobToken = System.getenv("CI_JOB_TOKEN") + def ciApiV4Url = System.getenv("CI_API_V4_URL") + if (ciJobToken != null) { + maven { + url "${ciApiV4Url}/projects/1063/packages/maven" + credentials(HttpHeaderCredentials) { + name = 'Job-Token' + value = ciJobToken + } + authentication { + header(HttpHeaderAuthentication) + } + } + } else { + maven { + url "https://gitlab.e.foundation/api/v4/projects/1063/packages/maven" + credentials(HttpHeaderCredentials) { + name = "Private-Token" + value = gitLabPrivateToken + } + authentication { + header(HttpHeaderAuthentication) + } + } + } + } + } + } +} \ No newline at end of file diff --git a/exportdependencies/update_dependencies.md b/exportdependencies/update_dependencies.md new file mode 100644 index 0000000000000000000000000000000000000000..32ef58da8cd963b68ff2eb11abac819c580ef74a --- /dev/null +++ b/exportdependencies/update_dependencies.md @@ -0,0 +1,43 @@ +A few orbot dependencies are added directly through the /libs directory, because remotely available version are outdated. We can't embed .aar or .jar into the orbotservice.aar (as any aar), so we have to expose this dependencies in the gitlab repository. + +To do that we use the mn deploy:deploy-file command ; and also the mvn install:install-file command to deploy in local maven repository for development. + +1. Update the orbot_service version in + * exportdependencies/pom.xml file + * dependencies.gradle +2. For each dependencies in orbot/libs, update or prepare an entry in dependecies.gradle, using groupId=foundation.e ; version orbot_service, and an approprioate artifactId . +3. For each dependencies in orbot/libs, run with appropriate PATH and ARTIFACTID : + +mvn install:install-file \ +-DartifactId=[ARTIFACTID] \ +-Dpackaging=aar \ +-Dfile=[PATH] + +4. Later, when isvalidated, deploy to gitlab repository: + +mvn deploy:deploy-file \ +-DrepositoryId=gitlab-e-maven \ +-Durl=https://gitlab.e.foundation/api/v4/projects/1063/packages/maven \ +-DartifactId=[ARTIFACTID] \ +-Dpackaging=aar \ +-Dfile=[PATH] + +example, for tor-android-binary +step 2: +"info.guardianproject:tor-android:$versions.tor_android" -> "foundation.e:tor-android:$versions.orbot_service", + +step 3: + +mvn install:install-file \ +-DartifactId=tor-android \ +-Dpackaging=aar \ +-Dfile="../../orbot/libs/tor-android-binary-release.aar + +step 4 : + +mvn deploy:deploy-file \ +-DrepositoryId=gitlab-e-maven \ +-Durl=https://gitlab.e.foundation/api/v4/projects/1063/packages/maven \ +-DartifactId=tor-android \ +-Dpackaging=aar \ +-Dfile="../../orbot/libs/tor-android-binary-release.aar diff --git a/libs/tor-android-binary-release.aar b/libs/tor-android-binary-release.aar deleted file mode 100644 index 01414d4c89ab2213dace973970800234e9206150..0000000000000000000000000000000000000000 Binary files a/libs/tor-android-binary-release.aar and /dev/null differ diff --git a/orbotservice b/orbotservice index 58bdb85984314967b5a82202823063f24ba7cd10..1930a046eff2dd37d23ffd83f0064f60334468a5 160000 --- a/orbotservice +++ b/orbotservice @@ -1 +1 @@ -Subproject commit 58bdb85984314967b5a82202823063f24ba7cd10 +Subproject commit 1930a046eff2dd37d23ffd83f0064f60334468a5 diff --git a/privacymoduletor/build.gradle b/privacymoduletor/build.gradle index 8c985d4f2eb4de34c01c68445b9d0b65ff5f1f94..62d747b7f91bc614eef663ab8dcfc83c417a2250 100644 --- a/privacymoduletor/build.gradle +++ b/privacymoduletor/build.gradle @@ -29,7 +29,7 @@ android { minSdkVersion 24 targetSdkVersion 31 - versionName "$advanced_privacy_version-$orbot_version" + versionName "$advanced_privacy_version-$versions.orbot_service" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -55,7 +55,7 @@ dependencies { implementation 'androidx.core:core-ktx:1.8.0' implementation(libs.androidx_localbroadcast) - implementation "foundation.e:orbotservice:$orbot_version-$orbot_service_revision" + implementation "foundation.e:orbotservice:$versions.orbot_service" }