Skip to content

Commit 43abca4

Browse files
alienzhzhangwei
andauthored
feat: update multi-platform API examples for RTC SDK 4.7.0 (#485)
* Polish beauty panel layout and clean up resources * chore(android): standardize case skill system across example apps * Update LiveStreaming watermark API * Add ScreenSharing permission callback * Update audio scenario options * Expose audio route options * Expose video module position option * Handle token state changes in JoinChannelVideoByToken * Hide deprecated RhythmPlayer from UI list * feat(ai-engineering): add multi-platform API Example iteration workflow (#475) * feat(ai-engineering): add multi-platform API Example workflow Add repository-local Contract, platform implementation, independent verification, and cross-platform acceptance tooling. Use an Agora repository profile for SDK version sources and keep coverage and release knowledge specific to the overseas repository. * refactor(ai-engineering): support per-platform SDK targets * ci(ios): add signing preflight and unsigned build validation - validate Jenkins signing profiles and certificate expiration - support legacy and modern distribution certificate names - switch Azure iOS jobs to unsigned compile checks --------- Co-authored-by: zhangwei <zhangwei03@shengwang.cn> * Codex/4.7.0 release iteration (#479) * chore: update RTC SDK version to 4.7.0 * feat: add Simplified Chinese localizations * fix: complete iOS Chinese localization --------- Co-authored-by: zhangwei <zhangwei03@shengwang.cn> * fix: use EglBaseLock for FaceUnity rendering (#480) Co-authored-by: zhangwei <zhangwei03@shengwang.cn> * Dev/4.7.0 agorabeauty (#481) * feat: unify Agora Beauty 2.0 resources * fix(android): align channel profile with live broadcasting (#478) * fix(android): align channel profile with live broadcasting * fix(android): default channel profile pickers to live broadcasting --------- Co-authored-by: zhangwei <zhangwei03@shengwang.cn> * fix(android): adapt native extensions to RTC SDK 4.7.0 - update native SDK headers for simple filter and stream encryption - align the FFmpeg library name with the 4.7.0 SDK package * fix: correct iOS Chinese localization * fix: repair Windows APIExample CI build --------- Co-authored-by: zhangwei <zhangwei03@shengwang.cn> * Codex/4.7.0 mac ci download order (#482) * fix(mac): download SDK before beauty resources * fix(mac): align CI build flow with iOS * fix(mac): use Xcode-managed CI signing --------- Co-authored-by: zhangwei <zhangwei03@shengwang.cn> * fix: adapt Agora Beauty 2.0 to video effect APIs * fix(android): adapt examples to RTC SDK 4.7.0 * fix(ios): adapt examples to RTC SDK 4.7.0 * chore(android): remove face capture example * fix(macos): adapt examples to RTC SDK 4.7.0 * chore(android): hide deprecated rhythm player examples * chore(ios): remove deprecated face capture examples * feat: update Windows examples for RTC SDK 4.7.0 * docs: support hidden API example cases * feat(android): add SenseTime beauty example * feat(ios): add SenseTime beauty example * fix(ios): download beauty resources from Artifactory * feat(android): update agora beauty * fix(windows): correct audio mixing resource path * fix(windows): correct packaged resource paths * fix(windows): package custom video sample * chore: standardize agent assets and harden release checks * chore: update ai-engineering * fix: refine RTC 4.7.0 example compatibility * fix: address Android 4.7.0 build blockers * fix: address RTC 4.7.0 review findings * chore: update RTC SDK headers for 4.7.0 * fix(android): correct FFmpeg library name * ci: align Agora APIExample package contents * chore: streamline repository git hooks * refactor: streamline AI engineering assets and retire Azure CI Consolidate cross-platform guidance and project skills, fix lifecycle and API templates, and enforce complete AI asset validation in repository policy. Document isolated Python setup and CI ownership; remove retired Azure pipelines and their dedicated scripts. * refactor(ci): remove obsolete cloud project scripts * docs: refresh RTC documentation links * fix: harden AI templates and align example names Guard permission and token callbacks across leave, teardown, and restart. Correct Android SDK imports and initialization handling and the Objective-C Swift bridge interface. Add executable template lifecycle regressions and stage complete templates for application compilation in CI. Align example labels, localized resources, and architecture case indexes. * refactor(macos): modernize screen capture and require macOS 12 Use RTC SDK screen enumeration for local video transcoding and remove WindowsCenter. Adopt @main and align the app, Pods, and documentation on a macOS 12 deployment target. * fix(ios): adopt scene lifecycle while preserving iOS 12 Use storyboard scene windows on iOS 13 and later, retaining AppDelegate startup on iOS 12 and the original SwiftUI iOS 14 deployment target. Resolve UI presentation through scene windows and keep Floaty log controls in the navigation hierarchy, with local safe-area and share-sheet anchors. Document lifecycle ownership, deployment and Xcode requirements, independent workspaces, and the audio project's lack of extension targets. Validation: native deployment-target typechecks; three non-audio app builds per repository using the existing local SDK; Scene lifecycle probes and Floaty component regressions on iPhone/iPad simulators; repository policy and AI asset checks. Audio SDK builds and actual iOS 12/RTC device checks remain pending unavailable dependencies and devices. * fix(ios): support Xcode 27 and adapt audio call layout * build(android): migrate RTC dependencies to official Maven repositories * fix(ci): align lightweight pull request compile checks * fix(ios): disable optional beauty pods in public CI --------- Co-authored-by: zhangwei <zhangwei03@shengwang.cn>
1 parent e40e6e1 commit 43abca4

838 files changed

Lines changed: 23112 additions & 15453 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
name: cross-platform-api-change
3+
description: Coordinate an RTC API Examples change across Android, iOS, macOS, and Windows when behavior, SDK usage, dependencies, CI, or packaging may affect more than one project.
4+
---
5+
6+
# Cross-Platform API Change
7+
8+
Use one written contract to keep every affected implementation aligned. The contract is
9+
the source of truth for behavior; an existing platform implementation is only a reference.
10+
11+
## Required Context
12+
13+
1. Read the root `AGENTS.md`.
14+
2. Read `docs/ai/README.md`, `docs/ai/change-contract-template.md`, and
15+
`docs/ai/project-matrix.md`.
16+
3. For SDK, dependency, CI, packaging, signing, or external-asset changes, also read
17+
`docs/ai/release-risks.md`.
18+
4. Read the platform and project `AGENTS.md` and `ARCHITECTURE.md` files for every project
19+
that may be affected.
20+
21+
Treat the current source tree as the case inventory. Do not rely on a separately maintained
22+
case catalog.
23+
24+
## Workflow
25+
26+
### 1. Establish The Contract
27+
28+
Before editing, copy `docs/ai/change-contract-template.md` into the issue, pull request, or
29+
task notes and complete it. Define observable behavior, SDK operations, inputs and defaults,
30+
callbacks, success and failure signals, lifecycle cleanup, non-goals, and the reference
31+
implementation or documentation.
32+
33+
Separate shared behavior from platform-specific API and UI details. If the requirement
34+
changes, update the contract first and then re-evaluate scope and existing work.
35+
36+
### 2. Decide Every Project
37+
38+
Review every row in `docs/ai/project-matrix.md`. Mark each project `REQUIRED`,
39+
`REVIEW_ONLY`, or `NOT_APPLICABLE`. Include a reason for every project that is not required.
40+
Do not assume that Android Views covers Compose, iOS UIKit covers SwiftUI or Objective-C,
41+
or a full-SDK project covers its audio-only counterpart.
42+
43+
### 3. Implement From The Same Contract
44+
45+
One coordinator owns the contract and cross-platform decisions. Split implementation by
46+
top-level platform only when parallel work is explicitly available, and give every owner
47+
the same contract, its project scope, allowed paths, reference, and validation requirements.
48+
Platform owners must not redefine shared behavior.
49+
50+
Implementations may differ because of SDK types, UI frameworks, permissions, or operating
51+
system behavior. Record each intentional difference and its reason in the contract.
52+
53+
### 4. Verify Each Required Project
54+
55+
For every required project:
56+
57+
- compare the diff with the shared contract;
58+
- verify SDK arguments, defaults, callbacks, lifecycle, threading, errors, registration,
59+
resources, localization, and cleanup as applicable;
60+
- run the strongest valid build or static check documented by that project;
61+
- record changed files, commands, results, blockers, and intentional differences.
62+
63+
Keep scope decisions and validation status separate. Record each planned validation as one
64+
of:
65+
66+
- `PASS`: the command or behavioral check completed and met its acceptance criteria;
67+
- `FAIL`: the check ran and failed;
68+
- `BLOCKED`: the check cannot run yet; record the blocker, remaining command, and the
69+
condition that will unblock it;
70+
- `NOT_RUN`: the check was not attempted; record why.
71+
72+
Do not convert `BLOCKED` or `NOT_RUN` into a pass. They are valid handoff states, but they
73+
leave the overall change incomplete.
74+
75+
Compilation is necessary but does not prove behavioral parity. Use an independent review
76+
pass when available.
77+
78+
### 5. Close Cross-Platform Acceptance
79+
80+
The change is complete only when every project has an explicit scope decision, every
81+
required implementation satisfies the contract, and every required validation is `PASS`.
82+
A change with `FAIL`, `BLOCKED`, or `NOT_RUN` validation may be handed off with clear next
83+
steps, but must not be reported as complete. Copy the final scope, differences, and
84+
validation evidence into the pull request using `.github/pull_request_template.md`.
85+
86+
Before handoff, confirm that SDK sources match `docs/ai/project-matrix.md` and that no real
87+
App ID, certificate, token, signing asset, private key, or private download URL is staged.
88+
89+
Do not commit task transcripts, agent identities, generated case catalogs, prompt snapshots,
90+
or run logs. Preserve durable product behavior and verification evidence in the issue or
91+
pull request.

‎.git-hooks/check-commit-message.sh‎

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
1-
#!/bin/bash
2-
3-
commit_msg_file=$1
4-
commit_msg=$(cat "$commit_msg_file")
5-
6-
7-
if perl -e '
8-
binmode(STDIN, ":utf8");
9-
$/ = undef;
10-
$text = <>;
11-
if ($text =~ /[\x{4e00}-\x{9fff}]/) {
12-
exit(1);
13-
} else {
14-
exit(0);
15-
}' < "$commit_msg_file"
16-
then
17-
exit 0
18-
else
19-
echo "Error: Commit message contains Chinese characters."
20-
echo "Please use English only in commit messages."
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
if [[ $# -ne 1 || ! -f "$1" ]]; then
6+
echo "Error: expected a commit message file." >&2
217
exit 1
22-
fi
8+
fi
9+
10+
if ! command -v python3 >/dev/null 2>&1; then
11+
echo "Error: python3 is required to validate commit messages." >&2
12+
exit 1
13+
fi
14+
15+
python3 - "$1" <<'PY'
16+
import pathlib
17+
import sys
18+
19+
20+
han_ranges = (
21+
(0x3400, 0x4DBF),
22+
(0x4E00, 0x9FFF),
23+
(0xF900, 0xFAFF),
24+
(0x20000, 0x2EBEF),
25+
(0x30000, 0x323AF),
26+
)
27+
28+
try:
29+
message = pathlib.Path(sys.argv[1]).read_text(encoding="utf-8")
30+
except (OSError, UnicodeError) as error:
31+
print(f"Error: cannot read commit message as UTF-8: {error}", file=sys.stderr)
32+
raise SystemExit(1)
33+
34+
if any(start <= ord(character) <= end for character in message for start, end in han_ranges):
35+
print("Error: commit message contains Chinese characters.", file=sys.stderr)
36+
print("Please use English only in commit messages.", file=sys.stderr)
37+
raise SystemExit(1)
38+
PY

‎.git-hooks/install-hooks.sh‎

Lines changed: 67 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,87 @@
1-
#!/bin/bash
2-
3-
# Functions for colored text output
4-
print_green() {
5-
echo -e "\033[0;32m$1\033[0m"
6-
}
7-
8-
print_yellow() {
9-
echo -e "\033[0;33m$1\033[0m"
10-
}
11-
12-
print_red() {
13-
echo -e "\033[0;31m$1\033[0m"
14-
}
15-
16-
# Function to add executable permissions
17-
ensure_executable() {
18-
if [ -f "$1" ] && [ ! -x "$1" ]; then
19-
chmod +x "$1"
20-
print_green "Added executable permission to $1"
21-
fi
22-
}
23-
24-
# Ensure script runs from project root directory
25-
if [ ! -d ".git" ]; then
26-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
27-
cd "$(dirname "$SCRIPT_DIR")" || { print_red "Cannot find project root directory"; exit 1; }
28-
29-
if [ ! -d ".git" ]; then
30-
print_red "Please run this script from the project root directory"
31-
exit 1
32-
fi
33-
fi
1+
#!/usr/bin/env bash
342

35-
# Check if pre-commit is installed
36-
if ! command -v pre-commit &> /dev/null; then
37-
print_yellow "pre-commit not found, attempting to install..."
38-
if command -v pip3 &> /dev/null; then
39-
pip3 install pre-commit
40-
elif command -v pip &> /dev/null; then
41-
pip install pre-commit
42-
else
43-
print_red "pip not found, please install Python and pip first, then run this script again"
44-
exit 1
45-
fi
46-
47-
if [ $? -ne 0 ]; then
48-
print_red "Failed to install pre-commit, please install manually: pip install pre-commit"
49-
exit 1
50-
fi
51-
print_green "pre-commit installed successfully!"
52-
else
53-
print_green "pre-commit is already installed!"
54-
fi
3+
set -euo pipefail
554

56-
# Check if gitleaks is installed (required)
57-
if ! command -v gitleaks &> /dev/null; then
58-
print_red "❌ gitleaks not found - this is a required security tool!"
59-
print_yellow "Installation guide: https://github.com/gitleaks/gitleaks#installing"
60-
61-
# Attempt automatic installation (based on OS)
62-
if [[ "$OSTYPE" == "darwin"* ]]; then
63-
print_yellow "Detected macOS, attempting to install gitleaks via Homebrew..."
64-
if command -v brew &> /dev/null; then
65-
brew install gitleaks
66-
if [ $? -eq 0 ]; then
67-
print_green "gitleaks installed successfully!"
68-
else
69-
print_red "Cannot automatically install gitleaks, please install manually"
70-
exit 1
71-
fi
72-
else
73-
print_red "Homebrew not found, please install Homebrew or install gitleaks manually"
74-
exit 1
75-
fi
76-
else
77-
print_red "Please install gitleaks manually and try again"
78-
exit 1
79-
fi
80-
else
81-
print_green "gitleaks is installed!"
82-
fi
5+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
836

84-
# Check required files and directories
85-
if [ ! -d ".git-hooks" ]; then
86-
print_red "Cannot find .git-hooks directory, please ensure you're in the correct project"
7+
if ! repo_root="$(git -C "$script_dir" rev-parse --show-toplevel 2>/dev/null)"; then
8+
echo "Error: .git-hooks must be inside a Git repository." >&2
879
exit 1
8810
fi
8911

90-
if [ ! -f ".gitleaks.toml" ]; then
91-
print_red "Cannot find .gitleaks.toml configuration file, please ensure it exists"
92-
exit 1
12+
cd "$repo_root"
13+
14+
has_error=false
15+
16+
hooks_path="$(git config --path --get core.hooksPath || true)"
17+
18+
if ! command -v pre-commit >/dev/null 2>&1; then
19+
echo "Error: pre-commit is required. Install it from https://pre-commit.com/#install" >&2
20+
has_error=true
9321
fi
9422

95-
if [ ! -f ".git-hooks/check-commit-message.sh" ]; then
96-
print_red "Cannot find .git-hooks/check-commit-message.sh file, please ensure it exists"
97-
exit 1
23+
if ! command -v gitleaks >/dev/null 2>&1; then
24+
echo "Error: gitleaks is required. Install it from https://github.com/gitleaks/gitleaks#installing" >&2
25+
has_error=true
9826
fi
9927

100-
# Ensure all scripts have executable permissions
101-
print_yellow "Granting executable permissions to hook scripts..."
102-
ensure_executable ".git-hooks/check-commit-message.sh"
103-
ensure_executable ".git-hooks/post-commit"
104-
ensure_executable ".git-hooks/pre-commit"
105-
106-
# Install pre-commit hook
107-
print_yellow "Installing pre-commit hook..."
108-
pre-commit install
109-
if [ $? -ne 0 ]; then
110-
print_red "Failed to install pre-commit hook!"
111-
exit 1
28+
if ! command -v python3 >/dev/null 2>&1; then
29+
echo "Error: python3 is required to validate commit messages." >&2
30+
has_error=true
11231
fi
113-
print_green "pre-commit hook installed successfully!"
11432

115-
# Install commit-msg hook
116-
print_yellow "Installing commit-msg hook..."
117-
pre-commit install --hook-type commit-msg
118-
if [ $? -ne 0 ]; then
119-
print_red "Failed to install commit-msg hook!"
33+
required_files=(
34+
".pre-commit-config.yaml"
35+
".gitleaks.toml"
36+
".git-hooks/run-gitleaks.sh"
37+
".git-hooks/check-commit-message.sh"
38+
".git-hooks/pre-commit-dispatcher.sh"
39+
)
40+
41+
for required_file in "${required_files[@]}"; do
42+
if [[ ! -f "$required_file" ]]; then
43+
echo "Error: required file not found: $required_file" >&2
44+
has_error=true
45+
fi
46+
done
47+
48+
if [[ "$has_error" == true ]]; then
12049
exit 1
12150
fi
122-
print_green "pre-commit commit-msg hook installed successfully!"
123-
124-
# Copy and set up custom hooks
125-
print_yellow "Setting up custom hooks..."
126-
# Copy commit-msg hook
127-
cp .git-hooks/check-commit-message.sh .git/hooks/commit-msg
128-
chmod +x .git/hooks/commit-msg
129-
130-
# Copy post-commit hook (if exists)
131-
if [ -f ".git-hooks/post-commit" ]; then
132-
cp .git-hooks/post-commit .git/hooks/post-commit
133-
chmod +x .git/hooks/post-commit
134-
fi
13551

136-
# Copy pre-commit hook (if exists)
137-
if [ -f ".git-hooks/pre-commit" ]; then
138-
# Backup pre-commit hook
139-
if [ -f ".git/hooks/pre-commit" ]; then
140-
cp .git/hooks/pre-commit .git/hooks/pre-commit.bak
52+
if [[ -z "$hooks_path" ]]; then
53+
pre-commit install --hook-type pre-commit --hook-type commit-msg
54+
else
55+
if [[ "$hooks_path" == /* ]]; then
56+
hooks_dir="$hooks_path"
57+
else
58+
hooks_dir="$repo_root/$hooks_path"
14159
fi
142-
143-
cp .git-hooks/pre-commit .git/hooks/pre-commit.custom
144-
chmod +x .git/hooks/pre-commit.custom
145-
146-
# Add custom pre-commit to existing hook chain
147-
if [ -f ".git/hooks/pre-commit" ]; then
148-
HOOK_CONTENT=$(cat .git/hooks/pre-commit)
149-
if ! grep -q "pre-commit.custom" .git/hooks/pre-commit; then
150-
echo -e "\n# Run custom pre-commit hook\n.git/hooks/pre-commit.custom || exit 1" >> .git/hooks/pre-commit
151-
chmod +x .git/hooks/pre-commit
60+
61+
dispatcher_source=".git-hooks/pre-commit-dispatcher.sh"
62+
dispatcher_marker="api-examples-pre-commit-dispatcher"
63+
64+
for hook_type in pre-commit commit-msg; do
65+
hook_target="$hooks_dir/$hook_type"
66+
if [[ -e "$hook_target" || -L "$hook_target" ]]; then
67+
if ! grep -Fq "$dispatcher_marker" "$hook_target" 2>/dev/null; then
68+
echo "Error: refusing to replace existing hook: $hook_target" >&2
69+
echo "Make that hook invoke pre-commit, then run this script again." >&2
70+
has_error=true
71+
fi
15272
fi
153-
else
154-
echo -e "#!/bin/bash\n\n# Run custom pre-commit hook\n.git/hooks/pre-commit.custom" > .git/hooks/pre-commit
155-
chmod +x .git/hooks/pre-commit
73+
done
74+
75+
if [[ "$has_error" == true ]]; then
76+
exit 1
15677
fi
157-
fi
15878

159-
pre-commit clean && pre-commit install && pre-commit install --hook-type commit-msg
79+
mkdir -p "$hooks_dir"
80+
install -m 0755 "$dispatcher_source" "$hooks_dir/pre-commit"
81+
install -m 0755 "$dispatcher_source" "$hooks_dir/commit-msg"
82+
echo "Installed pre-commit dispatchers in configured hook path: $hooks_dir"
83+
fi
16084

161-
print_green "================================================================"
162-
print_green "🎉 Git hooks setup complete! Your repository now has:"
163-
print_green " - Sensitive information leak detection using gitleaks"
164-
print_green " - Chinese character detection in commit messages"
165-
print_green "================================================================"
85+
echo "Git hooks installed successfully:"
86+
echo " - staged changes are scanned for sensitive information"
87+
echo " - commit messages containing Chinese characters are rejected"

0 commit comments

Comments
 (0)