اعتبارًا من 27 آذار (مارس) 2025، ننصحك باستخدام android-latest-release
بدلاً من aosp-main
لإنشاء AOSP والمساهمة فيه. لمزيد من المعلومات، يُرجى الاطّلاع على التغييرات في AOSP.
عمليات OTA المستندة إلى الحظر
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يمكنك تفعيل التحديثات عبر الهواء (OTA) المستندة إلى الحِزم للأجهزة الجديدة التي تعمل بنظام التشغيل Android 5.0. التحديث عبر شبكة غير سلكية
هي الآلية التي يستخدمها المصنّعون الأصليون للأجهزة لتعديل قسم النظام في الجهاز عن بُعد:
-
يستخدم الإصدار Android 5.0 والإصدارات الأحدث ميزة حظر التحديثات عبر الهواء لضمان استخدام كل جهاز
للقسم نفسه بالضبط. بدلاً من مقارنة الملفات الفردية وحساب التعديلات الثنائية
، يتعامل نظام OTA للأجهزة الجوّالة مع القسم بأكمله كملف واحد ويحسب تعديلًا ثنائيًا واحدًا
، ما يضمن أن يحتوي القسم الناتج على الوحدات المطلوبة بالضبط. يتيح ذلك
لصورة نظام الجهاز الوصول إلى الحالة نفسها من خلال Fastboot أو OTA.
-
كان نظام التشغيل Android 4.4 والإصدارات الأقدم يستخدم تحديثات الملفات عبر الهواء، ما كان يضمن أن تحتوي الأجهزة
على محتويات ملفات وأذونات وأوضاع مشابهة، ولكن كان يسمح للبيانات الوصفية مثل
الطوابع الزمنية وتنسيق مساحة التخزين الأساسية بالاختلاف بين الأجهزة استنادًا إلى
طريقة التحديث.
بما أنّ ميزة "التحديثات التلقائية عبر الهواء (OTA)" للأجهزة غير القابلة للإزالة تضمن أنّ كل جهاز يستخدم القسم نفسه، فإنّها تتيح استخدام dm-verity للتوقيع المشفّر على قسم النظام. لمعرفة التفاصيل حول dm-verity، يُرجى الاطّلاع على
التشغيل المُتحقّق منه.
ملاحظة: يجب أن يكون لديك نظام حظر تحديثات البرامج التلقائية صالح قبل استخدام dm-verity.
الاقتراحات
بالنسبة إلى الأجهزة التي تعمل بنظام التشغيل Android 5.0 أو إصدار أحدث، يمكنك حظر تحديثات OTA في نظام التشغيل الثابت (ROM) التلقائي. ل
إنشاء تحديث OTA يستند إلى الحِزم للتحديثات اللاحقة، نقْل الخيار --block
إلى
ota_from_target_files
.
بالنسبة إلى الأجهزة التي تم طرحها مع الإصدار 4.4 من Android أو الإصدارات الأقدم، استخدِم تحديثات الملفات عبر شبكة غير سلكية. على الرغم من أنّه
من الممكن نقل البيانات على الأجهزة من خلال إرسال حزمة OTA كاملة لنظام التشغيل Android 5.0 أو إصدار أحدث، إلا أنّه
يتطلب إرسال حزمة OTA كاملة أكبر بكثير من حزمة OTA المتزايدة (ولذلك
لا يُنصح باستخدامها).
بما أنّ ميزة dm-verity تتطلّب توفُّر برنامج إقلاع متوافق، وهو لا يتوفّر إلا في الأجهزة الجديدة التي تعمل بالإصدار
5.0 من نظام التشغيل Android أو الإصدارات الأحدث، لا يمكنك تفعيل ميزة dm-verity على الأجهزة الحالية.
يمكن للمطوّرين الذين يعملون على نظام Android OTA (صورة الاسترداد والنصوص البرمجية التي تُنشئ
عمليات OTA) مواكبة التغييرات من خلال الاشتراك في القائمة البريدية
android-ota@googlegroups.com.
عمليات نقل البيانات عبر الهواء (OTA) للملفّات مقابل عمليات نقل البيانات عبر الهواء للبيانات المحظورة
أثناء عملية التحديث عبر الهواء المستندة إلى الملفات، يحاول نظام Android تغيير محتوى قسم النظام في
طبقة نظام الملفات (ملف تلو الآخر). لا يمكن ضمان أن يكتب التحديث الملفات في ترتيب متناسق، أو أن يكون لديه وقت تعديل أو ملف superblock متسقان، أو حتى يضع وحدات التخزين في الموقع نفسه على جهاز التخزين. لهذا السبب، لا تنجح عمليات التحديث عبر الهواء المستندة إلى الملفات على
جهاز تم تفعيل ميزة dm-verity عليه، ولا يتم تشغيل الجهاز بعد محاولة التحديث عبر الهواء.
أثناء عملية التحديث عبر الهواء المستندة إلى الحِزم، يعرض نظام Android على الجهاز الفرق بين الصورتَين المكوّنتَين من الحِزم (بدلاً من مجموعتَين من الملفات). يتحقّق التحديث من إصدار الجهاز مقارنةً
بخادم الإصدار المقابل على مستوى الكتلة (أسفل نظام الملفات) باستخدام إحدى
الطريقتَين التاليتَين:
-
تحديث كامل: إنّ نسخ صورة النظام بالكامل أمر بسيط ويسهّل إنشاء الرقع، ولكنه ينشئ أيضًا صورًا كبيرة يمكن أن تجعل تطبيق الرقع عملية مكلفة.
-
التحديث المتزايد يؤدي استخدام أداة مقارنة الثنائيات إلى إنشاء صور أصغر حجمًا وتسهيل
تطبيق التصحيح، ولكنّها تستهلك ذاكرة كبيرة عند إنشاء التصحيح نفسه.
ملاحظة: تضع adb fastboot
الوحدات نفسها تمامًا على الجهاز كملف
OTA كامل، لذا يكون التفليش متوافقًا مع حظر OTA.
تعديل الأنظمة غير المعدَّلة
بالنسبة إلى الأجهزة التي تعمل بنظام Android 5.0 وتحتوي على أقسام نظام غير معدَّلة، تظل عملية تنزيل ملف التحديث OTA و
تثبيته متطابقة مع عملية تنزيل ملف التحديث OTA. ومع ذلك، قد يتضمّن تحديث OTA
نفسه واحدًا أو أكثر من الاختلافات التالية:
-
حجم التنزيل:
يكون حجم تحديثات OTA للكتلة الكاملة مماثلاً تقريبًا لحجم تحديثات OTA للملف الكامل، ويمكن أن يكون حجم التحديثات المتزايدة أكبر ببضع ميغابايت فقط.
الشكل 1: مقارنة أحجام تحديثات OTA لجهاز Nexus 6 بين إصدارَي Android 5.0 وAndroid
5.1 (تغييرات مختلفة في الإصدار المستهدف)
بوجه عام، تكون تحديثات OTA المتزايدة للوحدات أكبر من تحديثات OTA المتزايدة للملفات بسبب:
-
الحفاظ على البيانات: تحتفظ عمليات التحديث عبر الهواء المستندة إلى الكتل بمزيد من البيانات (بيانات تعريف الملفات وبيانات dm-verity
ومخطط ext4 وما إلى ذلك) مقارنةً بعمليات التحديث عبر الهواء المستندة إلى الملفات.
-
الاختلافات في خوارزمية الحساب: في تحديث OTA للملف، إذا كان مسار الملف
مطابقًا في كلا الإصدارَين، لا تحتوي حزمة OTA على أي بيانات لهذا الملف. في تحديث OTA
الحِزم، يعتمد تحديد التغييرات الطفيفة أو عدم حدوث أي تغيير في ملف على جودة خوارزمية احتساب التصحيح
وتنسيق بيانات الملف في كل من النظام المصدر والنظام المستهدَف.
-
الحساسية لأعطال ذاكرة الفلاش وذاكرة الوصول العشوائي إذا كان الملف تالفًا، تنجح عملية تحديث الملفات عبر الهواء ما دامت لا تؤثر في الملف التالف، ولكن يتعذّر إجراء عملية تحديث عبر الهواء للنظام إذا رصدت أي تالف
في قسم النظام.
تعديل الأنظمة المعدَّلة
بالنسبة إلى الأجهزة التي تعمل بالإصدار 5.0 من نظام التشغيل Android وتحتوي على أقسام نظام معدَّلة:
-
تعذُّر إجراء تحديثات OTA للأجهزة المحظورة تدريجيًا قد يتم تعديل قسم نظام أثناء
adb remount
أو نتيجةً لبرامج ضارة. تتيح ميزة File OTA إجراء بعض التغييرات على القسم
، مثل إضافة ملفات ليست جزءًا من الإصدار المصدر أو الإصدار المستهدف.
ومع ذلك، لا يسمح حظر التحديثات عبر الهواء بإضافة أي عناصر إلى القسم، لذا على المستخدمين
تثبيت تحديث OTA كامل يتجاهل أي تعديلات على قسم النظام) أو إعادة تحميل ملف التمهيد لنظام
جديد لتفعيل التحديثات عبر الهواء المستقبلية.
-
تؤدي محاولات تغيير الملفات المعدَّلة إلى تعذُّر التحديث. بالنسبة إلى كل من تحديثات الملفات والوحدات عن طريق OTA
، إذا حاولت عملية التحديث عن طريق OTA تغيير ملف تم تعديله، ستتعذّر عملية التحديث.
-
تؤدي محاولات الوصول إلى الملفات المعدَّلة إلى ظهور أخطاء (dm-verity فقط). بالنسبة إلى تحديثات
الملفات والحِزم عبر شبكة غير سلكيّة، إذا كان dm-verity مفعّلاً وحاولت عملية التحديث عبر شبكة غير سلكيّة الوصول إلى أجزاء
معدَّلة من نظام ملفات النظام، ستُنشئ عملية التحديث عبر شبكة غير سلكيّة خطأً.
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Block-based OTAs\n\nYou can enable block-based over-the-air (OTA) updates for new devices running Android 5.0. OTA\nis the mechanism by which OEMs remotely update the system partition of a device:\n\n- **Android 5.0** and later versions use block OTA updates to ensure that each device uses the exact same partition. Instead of comparing individual files and computing binary patches, block OTA handles the entire partition as one file and computes a single binary patch, ensuring the resultant partition contains exactly the intended bits. This allows the device system image to achieve the same state via fastboot or OTA.\n- **Android 4.4** and earlier versions used file OTA updates, which ensured devices contained similar file contents, permissions, and modes, but allowed metadata such as timestamps and the layout of the underlying storage to vary between devices based on the update method.\n\n\nBecause block OTA ensures that each device uses the same partition, it enables the use of\ndm-verity to cryptographically sign the system partition. For details on dm-verity, see\n[Verified Boot](/docs/security/features/verifiedboot).\n\n\n**Note:** You must have a working block OTA system before using dm-verity.\n\nRecommendations\n---------------\n\n\nFor devices launching with Android 5.0 or later, use block OTA updates in the factory ROM. To\ngenerate a block-based OTA for subsequent updates, pass the `--block` option to\n`ota_from_target_files`.\n\n\nFor devices that launched with Android 4.4 or earlier, use file OTA updates. While it is\npossible to transition devices by sending a full block OTA of Android 5.0 or later, it\nrequires sending out a full OTA that is significantly larger than an incremental OTA (and is\ntherefore discouraged).\n\n\nBecause dm-verity requires bootloader support found only in new devices shipping with Android\n5.0 or later, you *cannot* enable dm-verity for existing devices.\n\n\nDevelopers working on the Android OTA system (the recovery image and the scripts that generate\nOTAs) can keep up with changes by subscribing to the\n[android-ota@googlegroups.com](https://groups.google.com/forum/#!forum/android-ota)\nmailing list.\n\nFile versus block OTAs\n----------------------\n\n\nDuring a file-based OTA, Android attempts to change the contents of the system partition at\nthe filesystem layer (on a file-by-file basis). The update is not guaranteed to write files in\na consistent order, have a consistent last modified time or superblock, or even place the\nblocks in the same location on the block device. For this reason, file-based OTAs fail on a\ndm-verity-enabled device; after the OTA attempt, the device does not boot.\n\n\nDuring a block-based OTA, Android serves the device the difference between the two block\nimages (rather than two sets of files). The update checks a device build against the\ncorresponding build server at the block level (below the filesystem) using one of the\nfollowing methods:\n\n- **Full update**. Copying the full system image is simple and makes patch generation easy but also generates large images that can make applying patches expensive.\n- **Incremental update**. Using a binary differ tool generates smaller images and makes patch application easy, but is memory-intensive when generating the patch itself.\n\n\n**Note:** `adb fastboot` places the exact same bits on the device as a\nfull OTA, so flashing is compatible with block OTA.\n\n### Update unmodified systems\n\n\nFor devices with *unmodified* system partitions running Android 5.0, the download and\ninstall process for a block OTA remains the same as for a file OTA. However, the OTA update\nitself might include one or more of the following differences:\n\n- **Download size** .\n\n\n Full block OTA updates are approximately the same size as full file OTA updates, and\n incremental updates can be just a few megabytes larger.\n\n\n **Figure 1.** Compare Nexus 6 OTA sizes between Android 5.0 and Android 5.1\n releases (varying target build changes)\n\n\n In general, incremental block OTA updates are larger than incremental file OTA updates due\n to:\n - *Data preservation*. Block-based OTAs preserve more data (file metadata, dm-verity data, ext4 layout, etc.) than file-based OTA.\n - *Computation algorithm differences*. In a file OTA update, if a file path is identical in both builds, the OTA package contains no data for that file. In a block OTA update, determining little or no change in a file depends on the quality of the patch computation algorithm and layout of file data in both source and target system.\n- **Sensitivity to faulty flash and RAM**. If a file is corrupted, a file OTA succeeds as long as it doesn't touch the corrupted file, but a block OTA fails if it detects any corruption on the system partition.\n\n### Update modified systems\n\nFor devices with *modified* system partitions running Android 5.0:\n\n- **Incremental block OTA updates fail** . A system partition might be modified during an `adb remount` or as a result of malware. File OTA tolerates some changes to the partition, such as the addition of files that are not part of the source or target build. However, block OTA does not tolerate additions to the partition, so users will need to install a full OTA overwriting any system partition modifications) or flash a new system image to enable future OTAs.\n- **Attempts to change modified files cause update failure**. For both file and block OTA updates, if the OTA attempts to change a file that has been modified, the OTA update fails.\n- **Attempts to access modified files generate errors** *(dm-verity only)*. For both file and block OTA updates, if dm-verity is enabled and the OTA attempts to access modified parts of the system filesystem, the OTA generates an error."]]