一款现代化的 Android 应用,用于全面的 URL 安全分析,结合多种威胁检测 API 和高级域名仿冒检测功能,保护用户远离恶意网站。
在项目根目录创建 secrets.properties 文件:
ABUSEIPDB_API_KEY=your_abuseipdb_key
VIRUSTOTAL_API_KEY=your_virustotal_key
URLSCAN_API_KEY=your_urlscan_key
重要:使用本应用时,您必须遵守每个 API 提供商的服务条款:
克隆仓库
git clone <repository-url>
cd olyx
配置 API 密钥
cp secrets.properties.example secrets.properties
# 编辑 secrets.properties 填入你的 API 密钥
构建并运行
./gradlew assembleDebug
./gradlew installDebug
olyx/
├── app/
│ ├── src/main/
│ │ ├── java/com/olyx/
│ │ │ ├── data/
│ │ │ │ ├── Models.kt # ApiResult, HistoryEntry
│ │ │ │ ├── HistoryManager.kt # Persistence logic
│ │ │ │ └── SpoofingDetector.kt # Domain analysis engine
│ │ │ ├── network/
│ │ │ │ └── ApiService.kt # API integrations
│ │ │ ├── ui/
│ │ │ │ ├── components/
│ │ │ │ │ ├── ApiScoreCard.kt # Individual API results
│ │ │ │ │ └── GlobalScoreCard.kt # Aggregate score display
│ │ │ │ ├── screens/
│ │ │ │ │ ├── HomeScreen.kt # URL input
│ │ │ │ │ ├── AnalysisScreen.kt # Results display
│ │ │ │ │ ├── HistoryScreen.kt # Search history
│ │ │ │ │ └── AboutScreen.kt # App information
│ │ │ │ ├── theme/
│ │ │ │ │ ├── Color.kt # Dark theme palette
│ │ │ │ │ ├── Theme.kt # Material3 setup
│ │ │ │ │ └── Type.kt # Typography
│ │ │ │ └── utils/
│ │ │ │ └── ScoreUtils.kt # Scoring algorithms
│ │ │ ├── utils/
│ │ │ │ └── Constants.kt # App constants
│ │ │ └── MainActivity.kt # Entry point
│ │ └── res/
│ │ ├── raw/
│ │ │ └── legitimate_domains.txt # Protected domains list
│ │ └── font/
│ │ ├── gemunulibre_regular.ttf
│ │ └── redhatdisplay_regular.ttf
├── screens/ # Screenshots
├── build.gradle.kts
└── secrets.properties # API keys (not in repo)
编辑 app/src/main/res/raw/legitimate_domains.txt:
yourbank.com
yourbank.fr
yourbusiness.com
修改 SpoofingDetector.kt 中的阈值:
private fun calculateSuspicion(...): Int {
if (distance == 1) return 90 // 非常相似 → 高风险
if (distance == 2) return 70 // 有些相似 → 中风险
if (distance == 3) return 50 // 不太相似 → 低-中风险
}
更新 ScoreUtils.kt 中的仿冒影响:
val penalty = (spoofingResult.suspicionLevel * 0.5).toInt() // 嫌疑等级的 50%
# 运行单元测试
./gradlew test
# 运行仪器测试
./gradlew connectedAndroidTest
# 生成覆盖率报告
./gradlew jacocoTestReport
使用统计偏差分析:
基础分 = 平均值(API 评分)
惩罚 = 嫌疑等级 × 0.5
最终分 = max(0, 基础分 - 惩罚)
计算字符串间的最小编辑操作(插入/删除/替换)以检测域名抢注。
本项目基于 GNU Affero General Public License v3.0 许可协议。详情请见 LICENSE。