Google에서 내 앱을 거부했으며 앱을 프로덕션 릴리스로 제출할 때 표시되는 이 보안 오류로 인해 문제가 발생했습니다.
암시적인 내부 의도
앱에 암시적 내부 의도 취약점이 있습니다. 제발 자세한 내용은 이 Google 도움말 센터 문서를 참조하세요.
com.mypackage.name.sync.SyncService.onHandleIntent
여기에 나열된 모든 권장 사항을 적용했습니다. 암시적 PendingIntent 취약점에 대한 수정
하지만 오류가 계속 발생합니다.
내 서비스:
public class SyncService extends IntentService {
protected void onHandleIntent(Intent intent) {
...
Intent i= new Intent("com.mypackage.name.REFRESH");
app.sendBroadcast(i);
...
}
}
매니페스트:
<service
android:name=".sync.SyncService"
android:exported="false" ></service>
서비스는 다음과 같은 3가지 방법으로 여러 곳에서 시작되었습니다. (Google에서 권장하는 대로 PendingIntent.FLAG_IMMUTABLE을 추가했습니다)
방법 1:
Intent intent= new Intent(this, SyncService.class);
PendingIntent pIntent= PendingIntent.getService(this, 0, intent,
PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager alarmMgr= (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
alarmMgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, triggerAtMillis,
SYNC_FREQUENCY, pIntent);
방법 2:
Intent intent= new Intent("com.mypackage.name.REFRESH");
intent= new Intent(getApplicationContext(), SyncService.class);
intent.putExtra("notification_unassigned_sync", true);
startService(intent);
방법 3:
Intent intent= new Intent(getApplicationContext(), SyncService.class);
startService(intent);
내 code에 문제가 있습니까? 추천 사항이 있습니까?