شناسایی تکرار سوء استفاده با استفاده از فراخوان دستگاه (بتا)
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این صفحه نحوه استفاده از فراخوانی دستگاه برای ذخیره و بازیابی داده های سفارشی با دستگاه های خاص را شرح می دهد. بعداً وقتی برنامهتان روی همان دستگاه نصب شد، حتی پس از بازنشانی دستگاه، میتوانید بهطور قابل اعتمادی دادههای سفارشی را دوباره به خاطر بیاورید. این به شما امکان میدهد با حفظ حریم خصوصی کاربر، بر اساس عملکرد یا رفتاری که مشخص کردهاید، دستگاه را شناسایی کرده و از استفاده مجدد آن جلوگیری کنید.
فراخوانی دستگاه چگونه کار می کند؟
فراخوانی دستگاه به برنامهها این امکان را میدهد که دادههای سفارشی مرتبط با یک دستگاه خاص را به گونهای که حریم خصوصی کاربر حفظ شود، ذخیره و فراخوانی کنند. دادهها در سرورهای Google ذخیره میشوند و به برنامه شما امکان میدهند حتی پس از نصب مجدد برنامه یا بازنشانی دستگاه، دادههای سفارشی شما را بهطور قابلاعتماد به یاد بیاورد. به عنوان مثال، میتوانید از این ویژگی برای یادآوری دستگاههایی استفاده کنید که در آنها شواهدی مبنی بر سوء استفاده شدید پیدا کردهاید، دستگاههایی که قبلاً موارد با ارزش بالا را بازخرید کردهاند (مانند نسخه آزمایشی رایگان)، یا دستگاههایی که مکرراً برای ایجاد حسابهای جدید برای اهداف سوء استفاده میشوند. فراخوانی دستگاه حریم خصوصی کاربر را حفظ میکند، زیرا برنامه درخواستکننده فقط میتواند دادههای محدودی را که با دستگاهها مرتبط کرده است، بدون دسترسی به هیچ دستگاه یا شناسههای کاربری، فراخوانی کند. پس از اینکه فراخوانی دستگاه را روشن کردید، می توانید کارهای زیر را انجام دهید:
خواندن دادههای هر دستگاه : میتوانید سه مقدار یا بیت سفارشی را برای هر دستگاه بخوانید هنگامی که حکم یکپارچگی را دریافت میکنید. شما می توانید معنای خود را برای این مقادیر تعریف کنید. به عنوان مثال، می توانید مقادیر را به عنوان سه پرچم جداگانه در نظر بگیرید یا می توانید آنها را برای نمایش هشت برچسب سفارشی ترکیب کنید.
اصلاح دادههای هر دستگاه : پس از به دست آوردن یک رمز یکپارچگی، میتوانید از آن رمز برای برقراری تماس سمت سرور با سرور Google Play برای تغییر یک یا چند مقدار استفاده کنید. شما حداکثر 14 روز فرصت دارید تا از رمز استفاده کنید. این به شما امکان میدهد یک مقدار را تغییر دهید، برای مثال، اگر سوءاستفاده تنها در دوره دو هفتهای پس از اولین بررسی یکپارچگی آشکار شود. وقتی مقداری را تغییر میدهید، ماه و سالی که اصلاح انجام شده است نیز ذخیره میشود.
پیش نیازها و ملاحظات فراخوانی دستگاه
فراخوانی دستگاه فقط برای ذخیره و فراخوانی اطلاعات برای محافظت از امنیت برنامه و کاهش سوء استفاده، کلاهبرداری و دسترسی غیرمجاز ممکن است استفاده شود. نمیتوانید از فراخوانی دستگاه برای اثر انگشت یا ردیابی کاربران یا دستگاهها استفاده کنید و نمیتوانید از فراخوانی دستگاه برای پیگیری ویژگیهای حساس کاربر یا دستگاه مانند جنسیت، سن یا دادههای مکان استفاده کنید.
فراخوانی دستگاه دارای پیش نیازهای زیر است:
فراخوانی دستگاه را میتوان در تلفنها، تبلتها، دستگاههای تاشو، تلویزیون، خودکار و Wear OS استفاده کرد. در Wear، فراخوانی دستگاه فقط در دستگاههایی که با Wear OS 5 یا بالاتر عرضه میشوند در دسترس است. فراخوانی دستگاه در شبیه سازها پشتیبانی نمی شود.
برای فراخوانی دستگاه نیاز است که نسخههای اخیر فروشگاه Google Play و سرویسهای Google Play روی دستگاه نصب و فعال شوند.
برای فراخوانی دستگاه نیاز است که حساب کاربری دارای مجوز Play باشد، در غیر این صورت حکم مورد ارزیابی قرار نخواهد گرفت.
فراخوانی دستگاه دارای ملاحظات زمان بندی زیر است:
پس از تأیید یک توکن یکپارچگی، حداکثر 14 روز فرصت دارید تا از آن برای ذخیره دادههای فراخوان سفارشی دستگاه استفاده کنید.
فراخوانی دستگاه شامل مُهرهای زمانی است تا بتوانید دادههای اصلاحشده اخیر را نسبت به دادههایی که مدتها پیش اصلاح شدهاند اولویت بالاتری در نظر بگیرید. نادیده گرفتن یا بازنشانی دادهها را پس از یک دوره زمانی طولانی در نظر بگیرید تا در نظر بگیرید که دستگاهها میتوانند تغییر کنند یا بازسازی شوند و دوباره بفروشند.
بیت های فراخوان برای یک دستگاه به مدت 3 سال پس از آخرین دسترسی خواندن یا نوشتن ذخیره می شوند.
اگر نیاز به حذف همه دادههای مرتبط با یک دستگاه دارید، برنامه شما میتواند هر سه مقدار آن دستگاه را به false بازنشانی کند. این به طور خودکار مهرهای زمانی را بازنشانی می کند.
برای توسعه دهندگان با چندین برنامه و توسعه دهندگانی که برنامه ها را انتقال می دهند، فراخوانی دستگاه به صورت زیر عمل می کند:
همه برنامههای موجود در حساب توسعهدهنده Google Play شما به سه مقدار مشابه در هر دستگاه دسترسی دارند. به عبارت دیگر، اگر یکی از برنامههای شما یکی از مقادیر را تغییر دهد، همه برنامههای شما وقتی روی یک دستگاه نصب میشوند، مقدار تغییر یافته را میخوانند.
اگر برنامهای از یک حساب توسعهدهنده به حساب دیگر منتقل شود، فراخوانی دستگاه، دادههای هر دستگاه حساب توسعهدهنده جدید را نشان میدهد، نه دادههای هر دستگاه حساب توسعهدهنده قدیمی.
فراخوانی دستگاه را روشن کنید
وقتی آماده شدید، فراخوانی دستگاه را در Play Console روشن کنید:
وارد کنسول Play شوید.
برنامه ای را انتخاب کنید که از فراخوانی دستگاه استفاده می کند.
در بخش Release در منوی سمت چپ، به App integrity بروید.
در کنار Play Integrity API، روی تنظیمات کلیک کنید.
در بخش پاسخهای صفحه، روی تغییر پاسخها کلیک کنید.
فراخوانی دستگاه را روشن کنید.
روی ذخیره تغییرات کلیک کنید.
وقتی فراخوانی دستگاه را روشن یا خاموش میکنید، همه پاسخهای آزمایشی Play Integrity API که در Play Console تنظیم کردهاید حذف میشوند و باید دوباره آنها را ایجاد کنید.
مقادیر فراخوان دستگاه را بخوانید
فراخوانی دستگاه در هر دو درخواست Play Integrity API کلاسیک و استاندارد کار می کند. در درخواستهای استاندارد، فراخوانی دستگاه در تماس گرمکننده بهروزرسانی میشود. به عبارت دیگر، پس از اینکه دادههای هر دستگاه را تغییر دادید، برای مشاهده مقدار بهروزرسانی شده، باید یک گرم کردن دیگر انجام دهید. هنگامی که فراخوانی دستگاه فعال شد، می توانید مقادیر فراخوان دستگاه را در احکام یکپارچگی خود بخوانید .
تغییر مقادیر فراخوان دستگاه
میتوانید مقادیر فراخوانی دستگاه را با برقراری تماس API سرور به سرور مشابه رمزگشایی حکم یکپارچگی تغییر دهید. تنظیم یک بیت روی true تاریخ نوشتن آن را نیز به روز می کند (حتی اگر قبلاً true بود). تنظیم یک بیت روی false تاریخ نوشتن آن را به خالی بازنشانی می کند. هر بیتی که در یک درخواست مشخص نشده باشد، بدون تغییر باقی خواهد ماند. بین نوشتن بیت ها و توانایی بازخوانی آنها در حکم، انتشار کمی تأخیر وجود دارد. این تأخیر میتواند تا 30 ثانیه طول بکشد، اگرچه معمولاً بسیار کوتاهتر است. درخواستهای نوشتن فراخوان دستگاه باید کمتر از درخواستهای توکن یکپارچگی شما باشد. آنها در سهمیه درخواست توکن یکپارچگی شما محاسبه نمیشوند، اما مشمول محدودیتهای غیرعمومی و تدافعی هستند.
newValues.BitFirst=true// ForceSendFields optional for value truenewValues.BitSecond=false// ForceSendFields required for value falsenewValues.BitThird=nil// do not set ForceSendFields for unspecified bitsnewValues.ForceSendFields=[]string{"BitSecond"}
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Detect repeat abuse using device recall (beta)\n\n| **Important:** Device recall is a new feature in Play Integrity API that is available in beta and subject to change. [Express interest](https://forms.gle/2d24B4gNyoVrqztG6) in joining the beta program.\n\nThis page describes how to use device recall to store and retrieve custom data\nwith specific devices. You can reliably recall the custom data again later when\nyour app is installed on the same device, even after the device is reset. This\nlets you detect and prevent a device from being re-used based on an action or\nbehavior that you specify, while preserving user privacy.\n\nHow does device recall work?\n----------------------------\n\nDevice recall gives apps the ability to store and recall custom data associated\nwith a specific device in a way that preserves user privacy. The data is stored\non Google's servers, allowing your app to reliably recall your custom data even\nafter your app is reinstalled or the device is reset. For example, you could use\nthe feature to recall devices where you found evidence of severe abuse,\ndevices that already redeemed high-value items (such as a free trial), or\ndevices that are being used repeatedly to create new accounts for abusive\npurposes. Device recall preserves user privacy because the requesting app can\nonly recall the limited data that it associated with devices, without accessing\nany device or user identifiers. After you turn on device recall, you can do the\nfollowing:\n\n- **Read per-device data** : You can read three custom values or *bits* for each device when you obtain an integrity verdict. You can define your own meaning to these values; for example, you can treat the values as three separate flags or you could combine them to represent eight custom labels.\n- **Modify per-device data**: After you obtain an integrity token, you can use that token to make a server-side call to Google Play's server to modify one or more of the values. You have up to 14 days to use the token. This lets you modify a value if, for example, abuse only becomes evident in the two week period after you first perform an integrity check. When you modify a value, the month and year when the modification was made is also stored.\n\nDevice recall prerequisites and considerations\n----------------------------------------------\n\nDevice recall may only be used to store and recall information to protect app\nsecurity and to mitigate abuse, fraud, and unauthorized access. You may not use\ndevice recall to fingerprint or track individual users or devices and you may\nnot use device recall to keep track of sensitive user or device characteristics\nlike gender, age, or location data.\n\nDevice recall has the following prerequisites:\n\n- Device recall can be used on phones, tablets, foldables, TV, Auto, and Wear OS. On Wear, device recall is only available on devices that ship with Wear OS 5 or higher. Device recall is not supported on emulators.\n- Device recall requires recent versions of both Google Play Store and Google Play services to be installed and enabled on the device.\n- Device recall requires the user account to be Play licensed, otherwise the verdict will be unevaluated.\n\nDevice recall has the following timing considerations:\n\n- After you verify an integrity token, you have up to 14 days to use it to store custom device recall data.\n- Device recall includes timestamps so that you can consider recently modified data as higher priority than data that was modified a long time ago. Consider ignoring or resetting the data after a long enough time period to take into account that devices can change hands or be refurbished and resold.\n- The recall bits for a device will be stored for 3 years after the last read or write access.\n- If you need to delete all data associated with a device, your app can reset all three values on that device to false. This will automatically reset the time stamps.\n\nFor developers with multiple apps and developers transferring apps, device\nrecall works as follows:\n\n- All the apps in your Google Play developer account have access to the same three values per device. In other words, if one of your apps modifies one of the values, then all of your apps will read the modified value when they're installed on the same device.\n- If an app is transferred from one developer account to another, device recall will reflect the new developer account's per-device data, not the old developer account's per-device data.\n\nTurn on device recall\n---------------------\n\n| **Note:** To turn on device recall, you must first complete the [device recall beta\n| interest form](https://forms.gle/2d24B4gNyoVrqztG6). Once approved, you will be able to turn on device recall in the Play Console.\n\nWhen you are ready, turn on device recall in the Play Console:\n\n1. Sign in to the Play Console.\n2. Select the app that will use device recall.\n3. In the **Release** section of the left menu, go to **App integrity**.\n4. Next to Play Integrity API, click **Settings**.\n5. In the Responses section of the page, click **Change responses**.\n6. Turn Device recall on.\n7. Click Save changes.\n\nWhen you turn on or off device recall, any [Play Integrity API test\nresponses](/google/play/integrity/additional-tools#test-different) that you've\nset up in the Play Console will be deleted and you will need to create them\nagain.\n\nRead device recall values\n-------------------------\n\nDevice recall works in both Play Integrity API classic and standard requests. In\nstandard requests, device recall is refreshed in the warmup call. In other\nwords, after you modify per-device data, you will need to perform another warm\nup to see the updated value. Once device recall is enabled, you will be able to\n[read device recall values](/google/play/integrity/verdicts#device-recall) in your integrity verdicts.\n\nModify device recall values\n---------------------------\n\nYou can modify device recall values by making a server-to-server API call\nsimilar to [decoding the integrity\nverdict](/google/play/integrity/classic#decrypt-verify-google-servers). Setting\na bit to `true` will also update its write date (even if it was already `true`).\nSetting a bit to `false` will reset its write date to empty. Any bits that are\nunspecified in a request will remain unchanged. There is a small propagation\ndelay between writing bits and being able to read them back in the verdict. This\ndelay can be as long as 30 seconds, though it is generally much shorter. Device\nrecall write requests should be less frequent than your integrity token\nrequests. They are not counted in your integrity token request quota but are\nsubject to non-public, defensive rate limits. \n\n```\nplayintegrity.googleapis.com/v1/PACKAGE_NAME/deviceRecall:write -d \\\n'{\n \"integrityToken\": \"INTEGRITY_TOKEN\",\n \"newValues\": {\n \"bitFirst\": true,\n \"bitThird\": false\n }\n}'\n```\n| **Note:** The integrity token should be validated during a user action (i.e. you should verify the nonce or request hash) and then used for writing recall bits. It will be valid for up to 14 days.\n\u003e **Tip:** If you are using the [Golang library for the Play Integrity API](https://pkg.go.dev/google.golang.org/api/playintegrity/v1), remember to add the field name to [ForceSendFields](https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields) when setting a bit value to false, as in the following snippet. \n\u003e\n\u003e newValues.BitFirst = true // ForceSendFields optional for value true\n\u003e newValues.BitSecond = false // ForceSendFields required for value false\n\u003e newValues.BitThird = nil // do not set ForceSendFields for unspecified bits\n\u003e newValues.ForceSendFields = []string{\"BitSecond\"}"]]