Skip to content

Commit

Permalink
add android support (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah authored Mar 17, 2021
1 parent ab76c6b commit 77d25f6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
os: ubuntu-latest
cross: true
binary_path: target/aarch64-unknown-linux-gnu/release/tickrs
- target: aarch64-linux-android
os: ubuntu-latest
cross: true
binary_path: target/aarch64-linux-android/release/tickrs

runs-on: ${{ matrix.target.os }}
steps:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and `Removed`.

## [Unreleased]

### Packaging

- Add support and releases for Android (aarch64-linux-android)

## [0.14.3] - 2021-03-15

### Changed
Expand Down
14 changes: 12 additions & 2 deletions api/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::HashMap;
use anyhow::{bail, Context, Result};
use futures::AsyncReadExt;
use http::Uri;
use isahc::HttpClient;
use isahc::prelude::*;
use serde::de::DeserializeOwned;

use crate::model::{Chart, ChartData, Company, CompanyData, Options, OptionsHeader};
Expand Down Expand Up @@ -182,7 +182,17 @@ impl Client {

impl Default for Client {
fn default() -> Client {
let client = HttpClient::new().unwrap();
#[allow(unused_mut)]
let mut builder = HttpClient::builder();

#[cfg(target_os = "android")]
{
use isahc::config::SslOption;

builder = builder.ssl_options(SslOption::DANGER_ACCEPT_INVALID_CERTS);
}

let client = builder.build().unwrap();

let base = String::from("https://query1.finance.yahoo.com");

Expand Down

0 comments on commit 77d25f6

Please sign in to comment.