jlibtorrent 2: powering the next generation of BitTorrent clients in Java and on arm64

Since its inception, jlibtorrent has bridged the high-performance C++ BitTorrent engine libtorrent with Java environments—enabling developers to build full-featured torrent clients on Android, desktop Java, and server applications. With the recent jlibtorrent 2 release series (version 2.0.11.0 onward) the library undertakes a major leap—both in API richness, platform portability (including native arm64 binaries), and runtime capability—positioning it as the backbone for the next generation of BitTorrent clients built in Java (many targeting Android) and for server-side deployments on Linux arm64 for low-energy hosting.

Java API changes in jlibtorrent 2

  • A fluent builder API for creating .torrent files: the TorrentBuilder class now offers TorrentBuilder.Listener (for file-filtering and progress callbacks) and TorrentBuilder.Result to expose rich metadata output.
  • Time-series metrics support via TorrentStats.SeriesMetric (including metrics like TIME, DOWNLOAD_RATE, UPLOAD_RATE) enabling richer monitoring and analytics.
  • Enhanced DHT/item support for mutable items: SessionManager.MutableItem introduces editable DHT items with Ed25519 signatures and versioning, opening up advanced peer/data-anchoring use-cases.
  • Networking introspection via EnumNet.IpInterface (address, netmask, friendly names) and EnumNet.IpRoute (routing table entries with gateway and MTU) to support complex network-aware clients.
  • Comprehensive API refinements: many previously internal types (AnnounceInfohash, Pair, PiecesTracker, Vectors, AlertMulticaster, MoveFlags, IntSeries, and nested types) have been documented, and now offer full JavaDoc coverage with dozens of example usage patterns.
  • Zero HTML/critical errors in the generated javadoc for the 2.0.12.8 release, marking a maturation of API stability and documentation quality.

Platform and build improvements

  • Native binaries now support Linux arm64 (alongside Apple Silicon and Android arm64) enabling client applications and servers to run on modern low-power, high-efficiency hardware (e.g., AWS Graviton, Ampere Altra, Raspberry Pi-class boards).
  • The jlibtorrent 2 series is built on libtorrent’s “RC_2_0” branch and uses modern toolchains (C++20, Boost 1.88.0+, OpenSSL 3.5.2) and updated SWIG bindings (e.g., 4.x series) ensuring performance, security, and long-term compatibility.
  • Android builds are optimized for 16KB page-size (NDK r28c) and modern Android SDKs; desktop builds support macOS (arm64), Windows, and Linux.
  • Maven/Gradle artifacts now include both class wrappers and native libraries for multiple architectures, simplifying client-side dependency management across platforms.

Why this matters

For Java and Android developers building BitTorrent clients, jlibtorrent 2 offers:

  • Java-friendly, high-performance torrent engine: Access to libtorrent’s capabilities (v2.0 engine) via Java wrappers means full-featured clients (seeding, DHT, magnets, v1/v2 torrents) without having to implement C++ JNI layers from scratch.
  • Cross-platform consistency: One set of Java APIs works on Android (arm/arm64/x86/x86_64), desktop (Windows, macOS, Linux), and now server/embedded arm64.
  • Server-side arm64 deployments: As hosting moves toward energy-efficient arm64 hardware (e.g., cloud Graviton/Altra, edge servers), jlibtorrent supports native binaries for these platforms—enabling server-side torrent applications, indexing, seeding farms, or hybrid models (mobile+backend) on modern infrastructure.
  • Rich API & observability: Features like the series metrics, IP route introspection, DHT mutable items, and builder APIs for .torrent generation make it easier to build advanced clients: monitoring, analytics, plugin extensions, custom storage strategies, or even BitTorrent-native plugin ecosystems.
  • Maturation: With more than 50 public API classes now fully documented, dozens of example use-cases, and a clean JavaDoc build, jlibtorrent 2 is positioned as a production-ready library rather than an exploratory layer.

How FrostWire leverages jlibtorrent 2

The open-source project FrostWire (which began as a fork of LimeWire and evolved into a Java-based BitTorrent client) now transitions into its next era: FrostWire for Android 3 and FrostWire 7 for Desktop. These versions (available today for developers that compile from source) incorporate jlibtorrent 2 as their underlying torrent engine.

  • On Android, the native arm64 builds of jlibtorrent allow FrostWire to run efficiently across modern mobile chipsets and tablets, with lower power consumption and full support for BitTorrent v2 features.
  • On desktop and server contexts, FrostWire 7 (and related server/daemon variants) leverage the arm64 Linux binaries to run on cost-effective, high-density hostings (such as Graviton nodes) for seeding, indexing, or cloud-based media distribution.
  • By basing on the new builder APIs, FrostWire can offer built-in “create and share a torrent” workflows, advanced analytics (upload/download rate time series), and network topology awareness (choosing optimal interfaces/routes).
  • FrostWire’s evolution thus illustrates how a modern Java client can span mobile, desktop, and backend/cloud deployments — all running the same torrent core logic via jlibtorrent 2.

Implications for the wider BitTorrent ecosystem

  • Java ecosystem: Historically, most BitTorrent client engines have been C++ (libtorrent), C (Transmission), or in other languages. By providing a fully-featured Java wrapper, jlibtorrent 2 lowers the barrier for Java/Kotlin (Android) developers to build native-capable clients without rewriting complex protocol engines.
  • Mobile-first torrenting: As mobile devices become more capable and power-efficient, having a mature Java/Android torrent engine means richer P2P apps, offline media distribution, peer-to-peer content delivery, etc., are more feasible on mobile platforms.
  • Edge/Server hybrid deployments: The availability of arm64 native binaries means torrent-based services can run on low-power edge servers, small VPS instances, or even embedded devices—broadening deployment scenarios beyond traditional x86 desktops.
  • BitTorrent v2 readiness: As the ecosystem moves toward BitTorrent v2 (merkle tree torrents, enhanced hashing), jlibtorrent 2 supports those features, enabling clients built today to be future-proof.
  • Extensibility: With plugin-capable API surfaces (builder APIs, DHT mutable items, network introspection), new use-cases—such as cryptocurrency-anchored DHT items, content-distribution overlays, branded client workflows, or hybrid peer/edge architectures—become more accessible to Java teams.

Summary

In short: jlibtorrent 2 represents the modern foundation for Java-based BitTorrent applications—high-performance native bindings across architectures (including arm64 servers and mobile), deeply-documented APIs, builder patterns, monitoring capabilities, and extensibility hooks. With FrostWire for Android 3 and FrostWire 7 for Desktop as flagship users, this library sets the stage not only for mobile and desktop clients, but also for server and edge deployments that use BitTorrent technology in new ways.

Welcome to jlibtorrent 2.0.11.0

This is our first build of jlibtorrent-2.0, all tests are passing but we have yet to integrate the library with a production bittorrent client such as FrostWire for Desktop and FrostWire for Android.

We’ll be doing so over the next weeks, and once we’ve throughly tested everything is working as expected we’ll promote our next build (if necessary) to a stable release you can use to update your app to support bittorrent 2.0 features, plus all the fixes in libtorrent made the last 15 months.

PRE-RELEASE BINARIES
All the jlibtorrent unit tests pass with these, however, it has not been integrated to an actual bittorrent client yet.
most likely we’ll be releasing updates soon as we migrate FrostWire clients to use jlibtorrent 2.x

  • Migration and Integration
    • Migration to support libtorrent 2.0 integration.
    • Maintained 1.2.x on a separate branch without active maintenance; pull requests are welcome.
  • SWIG Interface Enhancements
    • Modularization of SWIG Interfaces:
      • SWIG interface files have been modularized for better maintainability and readability.
      • Added separate .i files for various libtorrent components, including:
        • libtorrent_address.i
        • libtorrent_tcp_endpoint.i
        • libtorrent_udp_endpoint.i
        • libtorrent_kademlia_dht_state.i
        • libtorrent_client_data.i
        • libtorrent_sha1_hash.i
        • libtorrent_info_hash.i
        • libtorrent_storage_defs.i
        • libtorrent_bitfield.i
        • libtorrent_operations.i
        • libtorrent_error_code.i
        • libtorrent_announce.i
        • libtorrent_file_storage.i
        • libtorrent_peer_request.i
        • libtorrent_bdecode.i
        • libtorrent_torrent_info.i
        • libtorrent_torrent_flags.i
        • libtorrent_add_torrent_params.i
        • libtorrent_close_reason.i
        • libtorrent_peer_info.i
        • libtorrent_torrent_handle.i
        • libtorrent_torrent_status.i
        • libtorrent_performance_counters.i
        • libtorrent_portmap.i
        • libtorrent_piece_block.i
        • libtorrent_socket_type.i
        • libtorrent_entry.i
    • Alert Types Integration:
      • Integrated additional alert type interface files to comprehensively cover libtorrent’s alert system:
        • libtorrent_dht_announce_alert.i
        • libtorrent_external_ip_alert.i
        • libtorrent_listen_failed_alert.i
        • libtorrent_listen_succeeded_alert.i
        • libtorrent_incoming_connection_alert.i
        • libtorrent_peer_alert.i
        • libtorrent_dht_direct_response_alert.i
        • libtorrent_dht_outgoing_get_peers_alert.i
        • libtorrent_dht_pkt_alert.i
        • libtorrent_udp_error_alert.i
        • libtorrent_dht_sample_infohashes_alert.i
        • libtorrent_tracker_alert.i
        • libtorrent_dht_lookup.i
        • libtorrent_portmap_alert.i
        • libtorrent_portmap_error_alert.i
        • libtorrent_dht_mutable_item_alert.i
        • libtorrent_dht_put_alert.i
        • libtorrent_session_stats_alert.i
        • libtorrent_peer_log_alert.i
        • libtorrent_read_piece_alert.i
        • libtorrent_dht_stats_alert.i
        • libtorrent_torrent_conflict_alert.i
    • Type Aliases and Templates:
      • Introduced typed_bitfield template for handling different index types, enhancing type safety and flexibility.
    • Operator Renaming:
      • Mapped C++ operators to Java-friendly method names using %rename directives:
        • operator== to op_eq
        • operator!= to op_ne
        • operator< to op_lt
        • operator> to op_gt
        • operator<= to op_lte
        • operator>= to op_gte
        • operator~ to op_inv
        • operator^ to op_xor
        • operator| to op_or
        • operator& to op_and
        • operator[] to op_at
      • Included boost_system_error_code.i for proper error handling.
  • Build Scripts and Dependencies
    • Added New Build Options:
      • Introduced --swig-only and --build-only options to the SWIG/build scripts (run-swig.sh and build.sh).
        • --swig-only: Executes only the SWIG interface generation without initiating the build process.
        • --build-only: Runs only the build process using pre-generated SWIG wrappers, skipping the SWIG generation phase.
      • These options provide developers with greater flexibility during development and testing by allowing selective execution of build stages.
    • Build Script Enhancements:
      • Addedprepare-macos.sh script to automate the installation of dependencies and the required SWIG version on macOS systems.
        • Installs necessary packages using Homebrew (wgetpcre2).
        • Checks and installs SWIG version 4.2.1 if not already present.
        • Verifies successful installation post-build.
      • Updatedrun-swig.sh script to handle platform-specific code adjustments and ensure correct SWIG version usage.
        • Implemented additional sed commands to fix code issues in libtorrent headers before SWIG processing.
        • Added safeguards to handle SWIG failures gracefully, providing informative messages and exiting if necessary.
        • Updated build flags and configurations to align with the latest libtorrent ABI versions.
        • Set TORRENT_ABI_VERSION=4 and updated namespaces for versions 3 and 4.
  • Dependency Upgrades
    • Boost Upgrade:
      • Upgraded Boost library to version 1.86.0 to improve performance and compatibility.
    • OpenSSL Upgrade:
      • Updated OpenSSL to version 1.1.1t to enhance security and support the latest protocols.
    • Gradle Upgrade:
      • Upgraded Gradle to version 8.10.2 to leverage new features and improvements in build automation.
    • Java Development Kit (JDK):
      • Jar built with JDK 11, ensuring compatibility with the build environment.
    • Libtorrent Update:
      • Updated libtorrent to RC_2_0 (rev: 2ab8fedabb7716947edc77958da6d0b5e1040df9) to incorporate the latest fixes and features from the libtorrent 2.0 branch.
    • Android NDK Upgrade:
      • Upgraded Android NDK to version r26d (LTS) from r25c, providing the latest toolchains and platform support.
    • SWIG Upgrade:
      • Upgraded SWIG to version 4.2.1 to improve interface generation and support new language features.
  • Exception and Error Handling
    • Enhanced Exception Handling:
      • Improved exception translation from C++ to Java within SWIG interfaces to ensure robust error management.
  • Compatibility and Performance Fixes
    • Fixed Compatibility Issues:
      • Resolved syntax issues in file_storage.hpp and ip_filter.hpp to ensure successful SWIG processing and avoid compilation errors.
      • Adjusted build flags and macros for Boost and libtorrent compatibility across different platforms.
    • Performance Optimizations:
      • Optimized SWIG typemaps and wrappers for efficient data handling, minimizing performance overhead in Java bindings.
  • Directors and Inheritance
    • Enabled SWIG Directors:
      • Enabled directors for classes requiring Java-side inheritance, facilitating the overriding of C++ virtual methods in Java subclasses:
        • add_files_listener
        • set_piece_hashes_listener
        • alert_notify_callback
        • swig_plugin
        • posix_wrapper
  • Code Clean-up and Maintenance
    • Ignored Deprecated and Internal Elements:
      • Excluded numerous deprecated methods, internal functions, and classes from the SWIG interface to streamline Java bindings and prevent potential conflicts.
    • Removed Redundant Code:
      • Deleted unnecessary %ignore directives and obsolete SWIG configurations to maintain a clean and maintainable interface.
    • Enhanced Documentation:
      • Improved comments and added TODOs for future integrations, such as web_seed_entry.hpp once merged from the master branch.
2.0.11.0
 * Migration to support libtorrent 2.0 integration
 * Maintained 1.2.x on a separate branch without active maintenance; pull requests are welcome
 * SWIG interface files have been modularized for better maintainability and readability
 * Added missing alert types
 * Introduced typed_bitfield template
 * Operator renaming for Java compatibility
 * Included boost_system_error_code.i
 * Added prepare-macos.sh script
 * Updated run-swig.sh script
 * Set TORRENT_ABI_VERSION=4
 * Boost 1.86.0 upgrade
 * OpenSSL 1.1.1t upgrade
 * Gradle 8.10.2 upgrade
 * Jar built with JDK 11
 * Libtorrent updated to RC_2_0 (rev:2ab8fedabb7716947edc77958da6d0b5e1040df9)
 * Android NDK r26d (LTS) upgrade (from r25c)
 * Added `--swig-only` and `--build-only` options to swig/build scripts
 * Added `prepare-macos.sh` script for macOS build setup
 * Updated `run-swig.sh` script for improved SWIG processing 
 * Upgraded SWIG to 4.2.1
 * Enhanced exception handling in SWIG interfaces
 * Fixed issues in file_storage.hpp and ip_filter.hpp
 * Adjusted build flags and macros for Boost and libtorrent compatibility
 * Enabled SWIG directors for specific classes
 * Ignored deprecated methods in SWIG interface
 * Improved documentation and added TODOs
 * lt:fix uTP issue where closing the connection could corrupt the payload
 * lt:apply DSCP/TOS to sockets before initiating the TCP connection
 * lt:assume copy_file_range() exists on linux (unless old glibc)
 * lt:fix issue where set_piece_deadline() did not correctly post read_piece_alert
 * lt:fix integer overflow in piece picker
 * lt:torrent_status::num_pieces counts pieces passed hash check, as documented
 * lt:check settings_pack::max_out_request_queue before performance alert
 * lt:allow on_unknown_torrent method in the absence of active torrents (new plugin feature added)
 * lt:add feature to async_move_storage() to not move files
 * lt:fix reject resume data if it contains mismatching info hashes
 * lt:fix clear the candidate_cache when clear peer_list
 * lt:fix missing python converter for dht::announce_flags_t
 * lt:fix issue with web seed connections when they close and re-open
 * lt:fallocate() not supported is not a fatal error
 * lt:fix proxying of IPv6 connections via IPv4 proxy
 * lt:treat CGNAT address range as local IPs
 * lt:add stricter checking of piece layers when loading torrents
 * lt:add stricter checking of v1 and v2 hashes being consistent
 * lt:cache failed DNS lookups as well as successful ones
 * lt:add an i2p torrent state to control interactions with clear swarms
 * lt:fix i2p SAM protocol parsing of quoted messages
 * lt:expose i2p peer destination in peer_info
 * lt:fix i2p tracker announces
 * lt:fix issue with read_piece() stopping torrent on pieces not yet downloaded
 * lt:improve handling of allow_i2p_mixed setting to work for magnet links
 * lt:fix web seed request for renamed single-file torrents
 * lt:fix issue where web seeds could disappear from resume data
 * lt:extend save_resume with additional conditional flags
 * lt:fix issue with retrying trackers in tiers > 0
 * lt:fix last_upload and last_download resume data fields to use posix time
 * lt:improve error messages for no_connect_privileged_ports, by untangle it from the port filter
 * lt:fix I2P issue introduced in 2.0.0
 * lt:add async tracker status query, post_trackers()
 * lt:add async torrent status query, post_status()
 * lt:support loading version 2 of resume data format
 * lt:fix issue with odd piece sizes
 * lt:add async piece availability query, post_piece_availability()
 * lt:add async download queue query, post_download_queue()
 * lt:add async file_progress query, post_file_progress()
 * lt:add async peer_info query, post_peer_info()
 * lt:fix uTP streams timing out instead of closing cleanly
 * lt:add write_torrent_file_buf() overload for generating .torrent files
 * lt:add create_torrent::generate_buf() function to generate into a buffer
 * lt:fix copy_file when the file ends with a sparse region
 * lt:uTP performance, fix packet loss when sending is stalled
 * lt:fix trackers being stuck after session pause/resume
 * lt:fix bug in hash_picker with empty files
 * lt:uTP performance, prevent premature timeouts/resends
 * lt:add option to not memory map files below a certain size
 * lt:settings_pack now returns default values when queried for missing settings
 * lt:fix copy_file fall-back when SEEK_HOL/SEEK_DATA is not supported
 * lt:improve error reporting from file copy and move
 * lt:tweak pad file placement to match reference implementation (tail-padding)
 * lt:uTP performance, more lenient nagle's algorithm to always allow one outstanding undersized packet
 * lt:uTP performance, piggy-back held back undersized packet with ACKs
 * lt:uTP performance, don't send redundant deferred ACKs
 * lt:support incoming SOCKS5 packets with hostnames as source address, for UDP trackers
 * lt:ignore duplicate network interface change notifications on linux
 * lt:fix total_want/want accounting when forcing a recheck
 * lt:fix merging metadata with magnet links added on top of existing torrents
 * lt:add torrent_flag to default all file priorities to dont_download
 * lt:fix &so= feature in magnet links
 * lt:improve compatibility of SOCKS5 UDP ASSOCIATE
 * lt:fix madvise range for flushing cache in mmap_storage
 * lt:open files with no_cache set in O_SYNC mode~
 * lt:fix issue in use of copy_file_range() on linux
 * lt:avoid open-file race in the file_view_pool
 * lt:fix issue where stop-when-ready would not close files
 * lt:fix issue with duplicate hybrid torrent via separate v1 and v2 magnet links
 * lt:added new function to load torrent files, load_torrent_*()
 * lt:support sync_file_range() on linux
 * lt:fix issue in write_torrent_file() when file size is exactly piece size
 * lt:fix file_num_blocks() and file_num_pieces() for empty files
 * lt:add new overload to make_magnet_uri()
 * lt:add missing protocol version to tracker_reply_alert and tracker_error_alert
 * lt:fix privilege issue with SetFileValidData()
 * lt:add asynchronous overload of torrent_handle::add_piece()
 * lt:default to a single hashing thread, for full checks
 * lt:Fix bug when checking files and the first piece is invalid
 * lt:fix issue creating a v2 torrent from torrent_info containing an empty file
 * lt:make recheck files also update which files use partfile
 * lt:add write_through disk_io_write_mode, which flushes pieces to disk immediately
 * lt:improve copy file function to preserve sparse regions (when supported)
 * lt:add function to truncate over-sized files part of a torrent
 * lt:fix directory creation on windows shared folders
 * lt:add flag to make add_files() not record file attributes
 * lt:deprecate (unused) allow_partial_disk_writes settings
 * lt:fix disk-full error reporting in mmap_disk_io
 * lt:fixed similar-torrents feature for v2 torrents
 * lt:fix potential unbounded recursion in add_completed_job, in disk I/O
 * lt:deprecated (unused) volatile_read_cache setting
 * lt:fix part files being marked as hidden on window
 * lt:on windows, explicitly flush memory mapped files periodically
 * lt:fix build with WolfSSL
 * lt:fix issue where incoming uTP connections were not accepted over SOCKS5
 * lt:fix several issues in handling of checking files of v2 torrents, esp. from magnet links
 * lt:make the token limit when parsing metadata from magnet files configurable
 * lt:fix issue with stalled pieces on disk full errors
 * lt:fix missing python binding for file_progress_flags
 * lt:fix torrent_file_with_hashes() to fail when we don't have the piece layers
 * lt:restore path character encoding conversion for non UTF-8 locales on linux
 * lt:fix use-after-free bug in make_magnet_uri
 * lt:add write_torrent_file() to produce a .torrent file from add_torrent_params
 * lt:allow loading v2 .torrent files without piece layer
 * lt:fix issue with adding v2 torrents with invalid file root hash
 * lt:fix piece picker bug causing double-picks with prefer-contiguous enabled
 * lt:expose session_params in python bindings
 * lt:fix (deprecated) use of add_torrent_params::info_hash
 * lt:fix issue creating and loading v2 torrents with empty files. Improves conformance to BEP52 reference implementation
 * lt:add new torrent_file_with_hashes() which includes piece layers for creating .torrent files
 * lt:add file_prio_alert, posted when file priorities are updated
 * lt:fix issue where set_piece_hashes() would not propagate file errors
 * lt:add missing python binding for event_t
 * lt:add work-around for systems without fseeko() (such as Android)
 * lt:add convenience header libtorrent/libtorrent.hpp
 * lt:increase default max_allowed_in_request_queue
 * lt:fix loading non-ascii filenames on windows with torrent_info constructor (2.0 regression)
 * lt:add std::hash<> specialization for info_hash_t
 * lt:fix integer overflow in hash_picker and properly restrict max file sizes in torrents
 * lt:strengthen SSRF mitigation for web seeds
 * lt:add v1() and v2() functions to torrent_info
 * lt:fix piece_layers() to work for single-piece files
 * lt:fix python binding regression in session constructor flags
 * lt:fix unaligned piece requests in mmap_storage
 * lt:improve client_data_t ergonomics
 * lt:fix issue with concurrent access to part files
 * lt:fix attribute in single-file v2 torrent creation
 * lt:fix padding for empty files in v2 torrent creation
 * lt:add function to ask a file_storage whether it's v2 or not
 * lt:fix mtime field when creating single-file v2 torrents
 * lt:fix performance regression in checking files
 * lt:disable use of SetFileValidData() by default (windows). A new setting allows enabling it
 * lt:dropped dependency on iconv
 * lt:deprecate set_file_hash() in torrent creator, as it's superceded by v2 torrents
 * lt:deprecate mutable access to info_section in torrent_info
 * lt:removed deprecated lazy_entry/lazy_bdecode
 * lt:stats_alert deprecated
 * lt:remove bittyrant choking algorithm
 * lt:update userdata in add_torrent_params to be type-safe and add to torrent_handle
 * lt:add ip_filter to session_params
 * lt:added support for wolfSSL for SHA-1 hash and HTTPS (no Torrents over SSL)
 * lt:requires OpenSSL minimum version 1.0.0 with SNI support
 * lt:deprecated save_state() and load_state() on session in favour of new
 * lt:write_session_params() and read_session_params()
 * lt:added support for BitTorrent v2 (see docs/upgrade_to_2.0.html)
 * lt:create_torrent() pad_file_limit parameter removed
 * lt:create_torrent() merkle- and optimize-alignment flags removed
 * lt:merkle_tree removed from add_torrent_params
 * lt:announce_entry expose information per v1 and v2 info-hash announces
 * lt:deprecated sha1_hash info_hash members on torrent_removed_alert,
 * lt:torrent_deleted_alert, torrent_delete_failed_alert and add_torrent_params
 * lt:undeprecate error_file_metadata for torrent errors related to its metadata
 * lt:remove support for adding a torrent under a UUID (used for previous RSS support)
 * lt:remove deprecated feature to add torrents by file:// URL
 * lt:remove deprecated feature to download .torrent file from URL
 * lt:requires boost >= 1.66 to build
 * lt:update networking API to networking TS compatible boost.asio
 * lt:overhauled disk I/O subsystem to use memory mapped files (where available)
 * lt:libtorrent now requires C++14 to build
 * lt:added support for GnuTLS for HTTPS and torrents over SSL
 * lt:fix issue where stop-when-ready would not close files
 * lt:uTP performance, fix packet loss when sending is stalled
 * lt:uTP performance, prevent premature timeouts/resends
 * lt:uTP performance, more lenient nagle's algorithm to always allow one outstanding undersized packet
 * lt:uTP performance, piggy-back held back undersized packet with ACKs
 * lt:uTP performance, don't send redundant deferred ACKs
 * lt:fix wanted_done/done accounting when force-rechecking
 * lt:expose userdata via torrent_handle (back-port from 2.0)
 * lt:fix renaming of filenames that are too long for the filesystem
 * lt:made UPnP and LSD code avoid using select_reactor (to work around an issue on windows in boost.asio < 1.80)

[dev] How we got Travis Continuous Integration for multiple language projects in a mono repo

With every commit that makes it to the monorepo both the Android and Desktop project are built and tested. This post documents how we did that.

This post is intended to help developers on other projects where they need wish to start multiple travis jobs for completely different configurations.

Most documented examples on the web on how to use travis are usually focused only on building a single project in a single environment. But what if your repository has multiple projects that need to run under different contexts and programming languages.

At FrostWire we have a big monorepo which is host to multiple projects:

android/ # android client (java8, android-sdk environment gradle build)
desktop/ # desktop client and tests (java11+ gradle build)
common/ # common java sources for android and desktop projects


Travis allows you to define what we understand to be a “Job Matrix”, where each entry in this Matrix specifies an individual job (and they can run in parallel when you push your commit and travis gets word of it)

Here’s our first version of .travis.yml to build the android and desktop projects, and run tests jobs on a single git push:
matrix:
  include:
    # android build job
    - language: android
      dist: xenial
      android:
        components:
          - build-tools 29.0.2
          - android-29
          - extra-google-google_play_services
          - extra-google-m2repository
          - extra-android-m2repository
      licenses:
        - 'android-sdk-preview-license-52d11cd2'
        - 'android-sdk-license-.+'
        - 'google-gdk-license-.+'
      script:
        - yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;29.0.2"
        - cd android
        - pwd
        - ./gradlew assembleDebug
    # desktop build job
    - language: java
      jdk:
        - openjdk11
      script:
        - cd desktop
        - gradle build
    # desktop/common tests job
    - language: java
      jdk:
        - openjdk11
      script:
        - cd desktop
        - gradle test

A New FrostWire 6.1.2 for PC, MacOSX and Linux is yours to download.

Download Installers on FrostWire’s Official Website
Download Installers and SourceCode on GitHub

Screenshot of Changelog in Github.com

Full Changelog:

frostwire (6.1.2) stable; urgency=high
  * Search performance improvements. New RxJava-based implementation.
  * Search box suggestions improved.
  * New Check/uncheck all search engines checkbox.
  * TorLock search fixed.
  * Added SSL (https) support for torrent web seeds.
  * Options window remembers last pane opened.
  * Fixes painting issues when searching Starred audio files on the library.
  * frostwire-jlibtorrent library updates.
  * Library user experience bug fixes.
        
 -- FrostWire Team   Wed, 24 Jun 2015 11:44:00 -0500

Write runtime libtorrent plugins with Java using frostwire-jlibtorrent #FrostWireLabs

We’ve just pushed upgrades to the frostwire-jlibtorrent API that will allow developers to extend and interact the Bittorrent protocol at a lower level through the implementation of libtorrent plugins.

Before today, a libtorrent plugin developer had to code plugins in C++ and rebuild the libtorrent library binaries for the architectures on which the plugin was meant to be used.

We think that non-bittorrent higher level abstractions (e.g. Bitcoin+Bittorrent integration) that need to occur near the core of the bittorrent protocol can be more easily coded, tested and debugged in a language like Java, without having to touch nor recompile the libtorrent libraries.

Today we’ve made available a new portion of the frostwire-jlibtorrent API that allows you to do this without all the C++ development headaches, you just focus on your plugin logic, and your code will also be available in all platforms with the same .class files.

Here’s an example of a dummy libtorrent Plugin implemented in Java using frostwire-jlibtorrent

To create a Plugin all you need to do is extend the AbstractPlugin class, whose newTorrent method will ask you to provide a TorrentPlugin interface implementation, this is meant to be a plugin instance that takes care of what happens when a torrent is added to the libtorrent session.

We provide an AbstractTorrentPlugin class for you to extend and as you do this you may or may not need to provide your own implementation of the TorrentPlugin::newPeerConnection method, which is meant to return a PeerPlugin, a plugin instance that takes care of what happens for every Peer connection, where probably most of your plugin logic will occur. We also provide an AbstractPeerPlugin implementation that you can extend.

Once you have your plugin ready to go, you can add it to the session with session.addExtension(myPlugin) and all torrents added to the session will invoke hooks that could be handled by your plugin implementations.

New FrostWire 5.7.5 for your desktop, now Java8 powered.

Download FrostWire 5.7.5 for Windows (Bitcoin, Litecoin, Dogecoin enabled .torrent)
Download FrostWire 5.7.5 for MacOSX (.torrent)
Download FrostWire 5.7.5 for Debian/Ubuntu (.torrent)

FrostWire 5.7.5 runs on Java 8, expect a faster and improved FrostWire overall.

frostwire-575-poly

We’ve upgraded our mp4 parsing libraries, this should solve some possible errors at the end of some media downloads.

We’ve also improved the quality of our cloud search results specially for music and video files.

Changelog

frostwire (5.7.5) stable; urgency=high

  * Improved mp4 parser.

  * Improved cloud search results.

  * Now FrostWire runs with Java8 technology.

  * Fixes player control layout issues when resizing the main window.

  * Fixes soundcloud url track/set downloads.

  * Fixes possible cloud download errors.

 

FrostWire is a free, open source BitTorrent client first released in September 2004, as a fork of LimeWire. It was initially very similar to LimeWire in appearance and functionality, but over time developers added more features, including BitTorrent support. In version 5, Gnutella support was dropped entirely, and FrostWire is only a BitTorrent client. Development of the program has been active since the program was first released in September 2004.

FrostWire for Desktop’s Lines of Code Count

    8724 text files.
    8237 unique files.                                          
    8917 files ignored.

http://cloc.sourceforge.net v 1.60  T=121.17 s (65.3 files/s, 14184.1 lines/s)
--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
Java                           7591         300370         340020        1033777
HTML                            192           2811           2130          21190
C++                              12           1337            510           3207
XML                              17            178            101           1632
C/C++ Header                     20            562           1623           1188
Ant                              19            289            136           1124
Maven                            10             66             20           1073
JSP                              16             64            606            777
Objective C                       7            184            100            675
Objective C++                     1            138             71            583
Javascript                        5             58             25            361
SQL                               1             34              7            288
CSS                               2             63             13            274
Bourne Again Shell                3             45             25            229
XSD                               2             28             57            187
C                                 2             58             14            134
PHP                               1             18              0             73
Bourne Shell                      4             13              1             45
DOS Batch                         7              8              4             41
make                              1              9              0             21
--------------------------------------------------------------------------------
SUM:                           7913         306333         345463        1066879
--------------------------------------------------------------------------------

Help us over a million lines of code at https://github.com/frostwire

FrostWire 5.7.0 is out for Windows, Mac and Linux now at FrostWire.com

Download FrostWire 5.7.0 for Windows (torrent)

Download FrostWire 5.7.0 for Mac (torrent)

Download FrostWire 5.7.0 for Ubuntu (torrent)

Download FrostWire 5.7.0 for Red Hat/Cent OS/RPM

Download FrostWire 5.7.0 for any other Linux Distro

Salsa Sara hoops in Wynwood, Miami for the FrostWire Team
Salsa Sara hoops in Wynwood, Miami for the FrostWire Team

What’s new?

  • Updated BitTorrent Engine to the latest code from the Azureus project along with FrostWire’s Team’s tunning and hacks for energy efficiency (as we reuse this same on code on Android)
  • Updated Java Runtime to fix compatibility launch issues Windows XP users were experiencing.
  • IRC Chat replaced for an HTML5 Chat App (Kiwi IRC), bye bye pjirc client.
  • New Torrents.com search engine integration.
  • Several UI bugs, freezes and crashes fixed.

Stay tuned for our Android release…

How to help translate FrostWire for Desktop (Windows / Mac / Linux)

Help us translate the FrostWire user interface, be part of an open source project, learn new things.

0. Get a GitHub.com account and sign in
Go to GitHub.com and sign up for a free account unless you have one already.

1. Download and install Git on your computer
If you don’t have git installed on your computer, here are instructions on how to install.

git, is a version control software which helps us keep track of all the changes on every file that belong to the FrostWire project.
GitHub.com is a site where we host our source code and its origin git repository (the official one), think of the repository as a database to keep all those file versions.

GitHub is really helpful because it makes colaboration very social, we can comment and review each other’s changes before merging them into the origin repository.

2. Fork us on github.
Go to https://github.com/frostwire/frostwire-desktop/, this is the page for our origin repo. Forking means you will be making a copy of your own inside your github account. You will wok on that one, and when you are done you will send the changes to the origin repo.

For us by clicking on the button that says “Fork” on the top right.

Once the fork is done, you can go to your github personal page, and in the list of your repositories you should have your frostwire-desktop fork.

As of now, that copy lives only at github.com, you could try and edit the files up there, but it’s very uncomfortable working that way, the text editor can be quite slow sometimes, so …

3. Clone your forked repo to your computer
Go to a command line, or with your favorite git client make a clone of YOUR repo (not ours).
If you use the command line git client, you should issue the following command

git clone https://github.com/myusername/frostwire-desktop

wait a few seconds and all the source code and assets that belong to the frostwire-desktop project will be downloaded to a folder called “frostwire-desktop” on your computer.

change directory to it…
cd frostwire-desktop

4. Create a branch for your translation
Create a branch with a name that will help us understand that this is a translation update you’re sending us, it could be named something like
“translation-french-2013-november-myname”, so that we can easily see what language you are translating, on which date you were working on it, and your name so we can give you credit for it.

You create a branch on the git command line like this (just remember to put the name of YOUR branch instead)

Create a branch locally
git branch translation-french-2013-november-myname

Push it to your remote repository
git push origin -u translation-french-2013-november-myname

now your branch lives both on your computer and at your github repository.

Switch to that branch
git checkout translation-french-2013-november-myname

Now you’re ready to start working on your branch.

After we’ve accepted your changes, next time you want to help us do another update of the translation you will have to create a new branch.

5. Make sure the latest english strings have been put into your language.po file
enter the following command to sync strings

ant gettext-extract

(this could take a while to finish as it goes through every line of code looking for translatable strings.)

6. Translate, translate, translate
Now you get to do the actual translation. Translation files are in the following folder inside the frostwire-desktop project
cd lib/messagebundles

If you’re going to translate say to arabic, you will edit the ar.po file, it should be easy to find the language file for the language you intend to work on. We recommend that you use a PO Editor software to make things easier, and always make sure to save the file using UTF-8 encoding.

7. Test your translation
To test your translation, you will need to recreate the message bundle file, for this you will need to invoke the following command

ant gettext-bundle

assuming you didn’t mess up anything in the format of the .po file this should finish after a few minutes of bundling every language file.
If you see any errors you should try to fix them, if you don’t know how to fix them you can reach us on the FrostWire forum, or right here for help.

once the bundle is built, you need to test your translation, for this you will need to build FrostWire, you can do this in one step, from the root frostwire-desktop folder type:

ant

after a couple minutes it should be done compiling everything, and then you can invoke the “run” script right there if you’re on Linux or Mac, if you’re on windows, go to gui/ and invoke the run.bat file.

FrostWire will open, switch to your language and make sure your translations are fine.

8. Time to commit and push your changes

Once you are finished, commit your changes, make sure you don’t make changes in other files than the .po of the language you are working with.
So if you’re working say with italian, you would do (from the frostwire-desktop root directory)

git commit lib/messagebundles/it.po -m "my translation update for italian users"

and then push it to your fork up on github

git push

9. Submit a pull request

Once you see your last commit on github and you are sure you’re finished, it’s time to let us know, so you will submit what’s called a “Pull Request”.
If there are any special notes please let us know, we’ll review your changes, and if everything is good to go, we’ll merge them, and you will make open source history 🙂

Configuring your Eclipse Build Path to build FrostWire

Everytime I setup eclipse in Windows I end up wasting about 30 minutes configuring the build path to get rid of all errors, here’s a self-reference post that you can also use to configure your Eclipse and get it ready to hack and patch FrostWire.

Source Tab
Add frostwire/core folder
Exclude: examples/**
Native library location: frostwire/lib/native/windows

Add frostwire/gui folder
Exclude: com/limegroup/gnutella/gui/Mac*.java; macosx; plugins; windows;
Native library location: frostwire/lib/native/windows

Add frostwire/gui/windows folder (nested, yes)

Libraries Tab
Add all jars in lib/jars, frostwire/dist, frostwire/components/all/dist

Order and Export Tab
Elements should be ordered as follows:

1. frostwire/core folder
2. frostwire/gui folder
3. frostwire/gui/windows folder
4. JRE System
5. lw-all.jar
6. FrostWire.jar
… Rest of jars.