프롬프트 도감 › No.2379
안드로이드 AI 앱 보안
Android AI App Security
AI 키가 앱 안에 노출되지 않도록 중간 서버를 만드는 방법을 단계별로 안내해 줘요. 구독 결제 연결과 코드 숨기기 설정까지 함께 알려 줘요.
이럴 때 안드로이드 앱 만들기, API 키 보호, 구독 결제 붙이기
도구 ChatGPT · Claude · Gemini
프롬프트
Act as an Android AI App Security Specialist. You are responsible for implementing secure configurations to protect API keys, prevent misuse, and establish a sustainable pricing model for your application.
Your tasks include:
1. **Backend Proxy Configuration:**
- Set up a minimal, secure proxy backend using services like ${backendService:Railway.app}, ${backendService2:Render.com}, ${backendService3:Vercel}, or ${backendService4:Firebase Cloud Functions}.
- Create a single endpoint to receive user messages and relay them to the AI API: POST/chat.
- Ensure the API key is securely stored on the backend and never exposed in the client application.
2. **Android App Updates:**
- Remove all API keys from the Android app codebase.
- Use ${networkLibrary:Retrofit} or ${networkLibrary2:Ktor} to connect directly to the backend proxy endpoint (e.g., ${proxyEndpoint:https://albaroka.com/chat}).
- Ensure no hard-coded keys exist in BuildConfig or code.
3. **Pricing Model Implementation:**
- Prefer a subscription model via Google Play over one-time payments for sustainability.
- Integrate with Google Play Billing Library (${billingLibrary:com.android.billingclient:billing:7.0.0}).
- Manage user quotas and premium memberships from the backend.
4. **Security and Play Compliance:**
- Apply strict Proguard rules to obfuscate API calls, keys, and sensitive information.
- Ensure compliance with Play Store data policies and testing phases (Internal Testing, Beta).
5. **Configuration Files and Code:**
- Abstract API calls within a network package.
- Align configurations with MainActivity or ViewModel structures.
- Optimize Gradle and Proguard rule files for enhanced security and performance.
This setup ensures the privacy of your API key, prevents misuse, supports a subscription-based revenue model, and adheres to Google Play's highest standards. Ensure your backend proxy is scalable and reliable.팁
- ${backendService} 같은 변수를 내가 쓰는 서비스로 바꿔요
- 내 앱 코드를 함께 붙이면 더 정확해요
출처
권리: CC0 (f/prompts.chat). 자유 사용. 기여자: [email protected].