# 安卓自动打包 **Repository Path**: Marthkoper/android-automatic-packaging ## Basic Information - **Project Name**: 安卓自动打包 - **Description**: 安卓自动打包 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-03 - **Last Updated**: 2025-10-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: 安卓, 安卓自动打包 ## README # Android Auto Build System This is an Android auto build system based on Spring Boot, supporting Android information upload, data point generation, and asynchronous processing through the Kafka message queue. The system features comprehensive logging, rate limiting, JWT authentication, and global exception handling mechanisms. ## Features - **Android Information Upload**: Upload APK package name, icon, path, and other information via API. - **Data Point Generation**: Supports management of data points and data types. - **Kafka Message Processing**: Implements asynchronous message processing using Kafka, including APK information processing and key generation. - **Rate Limiting**: Prevents API abuse, supports rate limiting based on UUID. - **JWT Authentication**: Token-based user authentication mechanism. - **Log Filter**: Logs request and response content for debugging and monitoring. - **QR Code Generation**: Supports generating QR codes with icons for APK download link sharing. - **Global Exception Handling**: Unified exception response format to enhance system robustness. ## Technology Stack - Spring Boot - MyBatis Plus - Kafka - JWT - Java Mail Sender - Swagger (supports via `@Tag` annotations) - Redis (rate limiting dependency) ## Module Structure - **Controller Layer**: Handles HTTP requests, such as `AndroidInfoController`. - **Service Layer**: Handles business logic, such as `AndroidInfoServiceImpl`. - **Mapper Layer**: Database operation interfaces, such as `AndroidInfoMapper`. - **Domain Layer**: Entity class definitions, such as `AndroidInfo`. - **Config Layer**: System configuration classes, such as `KafkaConfig`, `FilterConfig`. - **Utils Layer**: Utility classes, such as `QRCodeUtils`, `MD5Utils`. - **Kafka Consumers**: Listens to Kafka messages and processes them, such as `SimpleListener`. - **Exception Handling**: Global exception handler `GlobalExceptionHandler`. ## Installation and Deployment 1. **Required Dependencies** - JDK 1.8+ - Maven 3.5+ - Kafka 2.0+ - MySQL 5.7+ - Redis (for rate limiting) 2. **Build the Project** ```bash mvn clean package ``` 3. **Configure the Database** Modify the database connection information in `application.yml`. 4. **Start Kafka** Ensure the Kafka service is running and create the following Topics: - `android` - `android_generate` 5. **Start the Application** ```bash java -jar target/your-app.jar ``` ## Usage Instructions ### Upload Android Information **API Endpoint**: `POST /Upload_A_info` **Request Body**: ```json { "packageName": "com.example.app", "url": "http://example.com/app.apk", "appName": "Example App", "iconName": "icon.png" } ``` **Response Example**: ```json { "code": "200", "message": "Upload successful", "data": { "uuid": "abc123xyz" } } ``` ### Retrieve Android Information **API Endpoint**: `GET /get_A_info?uuid=abc123xyz` **Response Example**: ```json { "packageName": "com.example.app", "url": "http://example.com/app.apk", "appName": "Example App", "iconName": "icon.png", "uuid": "abc123xyz" } ``` ### Generate Keystore **API Endpoint**: `GET /generate?userId=12345` **Response Example**: ```json { "code": "200", "message": "Generation successful", "data": { "keystorePath": "/path/to/keystore.jks" } } ``` ## Logging and Monitoring - **Log Paths**: System runtime logs are recorded under the `logs/info/` and `logs/error/` directories. - **Rate Limiting Logs**: Interface rate limiting is implemented via the `@Limit` annotation, and rate limiting trigger events are logged. - **Kafka Consumer Logs**: Kafka message consumption is logged in `SimpleListener`. ## Contribution Guidelines Pull Requests and Issue submissions are welcome. Please follow these guidelines: - Ensure unit tests pass before submission. - Maintain consistent code style. - Include clear commit messages when submitting. ## License This project is licensed under the MIT License.