Skip to content

Commit 034af4e

Browse files
committed
fix build
1 parent 4620a08 commit 034af4e

3 files changed

Lines changed: 55 additions & 45 deletions

File tree

build.sh

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ RUSTFLAGS="-C linker=aarch64-linux-android25-clang -C link-args=-Wl,-rpath=/data
2323
AR="llvm-ar" \
2424
CC="aarch64-linux-android25-clang" \
2525
CXX="aarch64-linux-android25-clang++" \
26-
cargo build -p vsd --release --target aarch64-linux-android --no-default-features --features "license,native-tls-vendored"
26+
OPENSSL_INCLUDE_DIR="$PACKAGES_DIR/openssl-aarch64-linux-android/data/data/com.termux/files/usr/include" \
27+
OPENSSL_LIB_DIR="$PACKAGES_DIR/openssl-aarch64-linux-android/data/data/com.termux/files/usr/lib" \
28+
cargo build -p vsd --release --target aarch64-linux-android --no-default-features --features "license,native-tls"
2729

2830
echo "Packaging aarch64-linux-android"
2931
cd target/aarch64-linux-android/release
@@ -33,31 +35,31 @@ cd ../../../
3335

3436
# Darwin
3537

36-
echo "Building aarch64-apple-darwin"
37-
RUSTFLAGS="-C linker=clang -C link-arg=--target=aarch64-apple-darwin -C link-arg=-isysroot -C link-arg=$PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -C link-arg=-fuse-ld=lld" \
38-
AR="llvm-ar" \
39-
CC="clang --target=aarch64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
40-
CXX="clang++ --target=aarch64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
41-
cargo build -p vsd --release --target aarch64-apple-darwin
42-
43-
echo "Packaging aarch64-apple-darwin"
44-
cd target/aarch64-apple-darwin/release
45-
llvm-readobj vsd --needed-libs
46-
tar -cJf $RELEASE_DIR/vsd-$VSD_VERSION-aarch64-apple-darwin.tar.xz ./vsd
47-
cd ../../../
48-
49-
echo "Building x86_64-apple-darwin"
50-
RUSTFLAGS="-C linker=clang -C link-arg=--target=x86_64-apple-darwin -C link-arg=-isysroot -C link-arg=$PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -C link-arg=-fuse-ld=lld" \
51-
AR="llvm-ar" \
52-
CC="clang --target=x86_64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
53-
CXX="clang++ --target=x86_64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
54-
cargo build -p vsd --release --target x86_64-apple-darwin
55-
56-
echo "Packaging x86_64-apple-darwin"
57-
cd target/x86_64-apple-darwin/release
58-
llvm-readobj vsd --needed-libs
59-
tar -cJf $RELEASE_DIR/vsd-$VSD_VERSION-x86_64-apple-darwin.tar.xz ./vsd
60-
cd ../../../
38+
# echo "Building aarch64-apple-darwin"
39+
# RUSTFLAGS="-C linker=clang -C link-arg=--target=aarch64-apple-darwin -C link-arg=-isysroot -C link-arg=$PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -C link-arg=-fuse-ld=lld" \
40+
# AR="llvm-ar" \
41+
# CC="clang --target=aarch64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
42+
# CXX="clang++ --target=aarch64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
43+
# cargo build -p vsd --release --target aarch64-apple-darwin
44+
45+
# echo "Packaging aarch64-apple-darwin"
46+
# cd target/aarch64-apple-darwin/release
47+
# llvm-readobj vsd --needed-libs
48+
# tar -cJf $RELEASE_DIR/vsd-$VSD_VERSION-aarch64-apple-darwin.tar.xz ./vsd
49+
# cd ../../../
50+
51+
# echo "Building x86_64-apple-darwin"
52+
# RUSTFLAGS="-C linker=clang -C link-arg=--target=x86_64-apple-darwin -C link-arg=-isysroot -C link-arg=$PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -C link-arg=-fuse-ld=lld" \
53+
# AR="llvm-ar" \
54+
# CC="clang --target=x86_64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
55+
# CXX="clang++ --target=x86_64-apple-darwin -isysroot $PACKAGES_DIR/MacOSX$MACOS_SDK_VERSION.sdk -fuse-ld=lld" \
56+
# cargo build -p vsd --release --target x86_64-apple-darwin
57+
58+
# echo "Packaging x86_64-apple-darwin"
59+
# cd target/x86_64-apple-darwin/release
60+
# llvm-readobj vsd --needed-libs
61+
# tar -cJf $RELEASE_DIR/vsd-$VSD_VERSION-x86_64-apple-darwin.tar.xz ./vsd
62+
# cd ../../../
6163

6264
# Linux
6365

install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ curl -L https://dl.google.com/android/repository/android-ndk-$ANDROID_NDK_VERSIO
3737
unzip android-ndk-$ANDROID_NDK_VERSION-linux.zip -d $PACKAGES_DIR
3838
rm android-ndk-$ANDROID_NDK_VERSION-linux.zip
3939

40+
echo "Installing openssl-aarch64-linux-android"
41+
curl -L https://packages.termux.dev/apt/termux-main/pool/main/o/openssl/openssl_1%3A3.6.1_aarch64.deb -o openssl-aarch64-linux-android.deb
42+
dpkg-deb -x openssl-aarch64-linux-android.deb $PACKAGES_DIR/openssl-aarch64-linux-android
43+
rm openssl-aarch64-linux-android.deb
44+
4045
echo "Installing MacOSX SDK v$MACOS_SDK_VERSION"
4146
curl -L https://github.com/joseluisq/macosx-sdks/releases/download/$MACOS_SDK_VERSION/MacOSX$MACOS_SDK_VERSION.sdk.tar.xz | tar xJC $PACKAGES_DIR
4247

vsd/src/cookie.rs

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
77
*/
88

9-
#[cfg(feature = "capture")]
10-
use chromiumoxide::cdp::browser_protocol::network::{
11-
Cookie as BrowserCookie, CookieParam, TimeSinceEpoch,
12-
};
13-
149
use chrono::{TimeZone, Utc};
1510
use std::str;
1611

12+
#[derive(Clone, Debug)]
13+
pub struct Cookie<'a> {
14+
domain: &'a str,
15+
#[allow(unused)]
16+
include_subdomains: bool,
17+
path: &'a str,
18+
secure: bool,
19+
expires: i64,
20+
name: &'a str,
21+
value: &'a str,
22+
http_only: bool,
23+
}
24+
1725
#[derive(Clone, Debug)]
1826
pub struct Cookies<'a>(pub Vec<Cookie<'a>>);
1927

@@ -78,6 +86,7 @@ impl<'a> Cookies<'a> {
7886
Ok(Cookies(cookies))
7987
}
8088

89+
#[cfg(feature = "capture")]
8190
pub fn to_netscape(&self) -> String {
8291
let mut out = "# Netscape HTTP Cookie File\n\
8392
# https://curl.se/docs/http-cookies.html\n\
@@ -91,26 +100,15 @@ impl<'a> Cookies<'a> {
91100
}
92101
}
93102

94-
#[derive(Clone, Debug)]
95-
pub struct Cookie<'a> {
96-
domain: &'a str,
97-
include_subdomains: bool,
98-
path: &'a str,
99-
secure: bool,
100-
expires: i64,
101-
name: &'a str,
102-
value: &'a str,
103-
http_only: bool,
104-
}
105-
106103
impl<'a> Cookie<'a> {
104+
#[cfg(feature = "capture")]
107105
fn to_netscape(&self) -> String {
108106
format!(
109107
"{}\t{}\t{}\t{}\t{}\t{}\t{}",
110108
if self.http_only {
111-
&format!("#HttpOnly_{}", self.domain)
109+
format!("#HttpOnly_{}", self.domain)
112110
} else {
113-
self.domain
111+
self.domain.to_owned()
114112
},
115113
if self.include_subdomains {
116114
"TRUE"
@@ -191,6 +189,11 @@ impl From<str::Utf8Error> for ParseError {
191189
}
192190
}
193191

192+
#[cfg(feature = "capture")]
193+
use chromiumoxide::cdp::browser_protocol::network::{
194+
Cookie as BrowserCookie, CookieParam, TimeSinceEpoch,
195+
};
196+
194197
#[cfg(feature = "capture")]
195198
impl<'a> From<&'a Vec<CookieParam>> for Cookies<'a> {
196199
fn from(value: &'a Vec<CookieParam>) -> Self {

0 commit comments

Comments
 (0)