# Build facebook-no-ads trên Ubuntu (Theos)

## 1. Clone

```bash
git clone https://github.com/haoict/facebook-no-ads.git
cd facebook-no-ads
```

## 2. Export Theos path

```bash
export THEOS=/home/tommy/theos
```

## 3. Sửa Makefile (1 lần)

Mở `Makefile`, sửa dòng 1-2:

```makefile
ARCHS = arm64                          # bỏ arm64e nếu SDK < 14.0
TARGET = iphone:clang:16.5:14.0        # SDK có sẵn: 16.5 hoặc 12.4
```

Thêm `-Wno-deprecated-declarations` vào CFLAGS:

```makefile
facebooknoads_CFLAGS = -fobjc-arc -std=c++11 -Wno-deprecated-declarations
```

Tương tự với `pref/Makefile`:

```makefile
ARCHS = arm64                          # bỏ arm64e
```

## 4. Build

```bash
export THEOS=/home/tommy/theos
make clean && make package
```

File `.deb` ở `packages/com.haoict.facebooknoads_<version>_iphoneos-arm.deb`.

## 5. Inject vào IPA

```bash
cyan -i facebook.ipa -o facebook_tweaked.ipa -uwef path/to/tweak.deb [-n "Tên App"] [-b "com.bundle.id"] -s
```

## 6. Ghi chú

- Theos Linux toolchain: `/home/tommy/theos/toolchain/linux/iphone/`
- SDKs có sẵn: `iPhoneOS12.4.sdk`, `iPhoneOS16.5.sdk`
- Nếu gặp lỗi missing framework, cài libhdev từ Cydia/Zebra trên máy jailbreak
