Controlling application separation

视觉特征-自监督-掩码特征预测【2024-10】:D-JEPA【生成模型:下一Token组自回归预测(组内并行去噪),自回归合成图像】【JEPA、Diffusion损失均针对Mask处Token计算】 Dengsheng Chen1 Jie Hu2 Xiaoming Wei1 Enhua Wu2∗1Meituan 2Key Laboratory of System Software (Chinese Academy of Sciences) and State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences {chendengsheng, weixiaoming}@meituan. 阅读详情

From: http://mylifewithandroid.blogspot.com/2009/06/controlling-application-separation.html

 

I thought I knew how application separation in Android works. Then I had a little project and I realized that there is more than meets the eye. Here are my experiences.

The basic - and very efficient - separation method in Android is the multiprocess capability of the Dalvik VM. Dalvik is able to fork many instances of itself and can run applications in different Linux processes. By default, each application (the application tag in AndroidManifest.xml) has its own process. There is however another, often overlooked separation mechanism inside each VM process that provides further separation. The good old ClassLoader separation - originally designed to separate applets, used heavily in multi-module frameworks like OSGi - is also at work. Inside each VM process, each task - acitivity or service - uses in its own ClassLoader. This means that object instances created in different tasks are not visible to each other. The standard setup for Android applications is such that the classes.dex in the application's APK package is on the path of the application's own classloader. The application's own classloader delegates the loading of system classes to the boot classloader instance which is common for all the tasks in one particular VM process.

Class loading implementation in Dalvik is tied heavily to DEX files. This has visible side effects. Classes loaded by different class loaders that don't delegate to each other should be completely separated. The implementation differentiates the "initiating" and "defining" classloader (the latter is the one that managed to call defineClass() for a particular class from a particular DEX file in a particular VM process). This differentiation does not work very well and results in a glitch: once a class from a particular DEX file is defined, its static fields are visible and shared from all the class loaders that access the DEX file, even if they don't delegate to each other. This means that tasks of the same application (usually packed into the same DEX file) see each other's static fields.

As if this was not enough, Android provides control of task-VM process mapping. As said previously, usually each application goes into its own VM process. It is possible to declare, however, that applications share a process. This works like the following:

  • First we declare that applications wishing to share the same VM process belong to the same user ID. This is done by adding the sharedUserId attribute to the manifest tag in AndroidManifest.xml file like the following: android:sharedUserId="aexp.share.sharedapp" . The value of the attribute must be a unique string shared among the applications wishing to use the same VM process. This is a powerful mechanism, hence Android enforces strong check of the APKs containing the declaration. Only the first APK for a particular sharedUserId can be installed without limitation. The issuer of the digital signature of that APK is saved and further APKs with the same sharedUserId must have digital signature from the same issuer, else their installation is rejected.
  • We have to declare the alias of the process a certain task or the entire application goes into with the process attribute. This attribute can be added to application , activity or service tags in the AndroidManifest.xml file. For example: android:process="aexp.share.sharedappprocess" . VM processes are proper Linux processes identified by PIDs but Android does an additional transformation: whenever a process is started which is tagged by the process alias, the Android framework saves the Linux PID and the process alias. If some other application refers to that process alias and the VM process is still running, that process will be used.

How can we exploit this mechanism? We can create ordinary, well-behaving Android applications and place them into the same process. Android IPC is such that the usual binder-based communication is much faster in this case. The other approach is that we exploit our knowledge about class loaders. If we place two applications into the same process, they not only have different class loaders but also come from different DEX files. This means that the Android class loading glitch about the static fields cannot be exploited (I don't recommend it anyway as it is a clear bug and I believe, it will be corrected soon). We know, however, that each class loader in the same VM process delegates the resolution of the system classes to the boot class loader. If we find a system class that allows us to store and retrieve data, we win.

 

Click here to download the example program .

 

Our two example programs demonstrate the techniques described below. SharedApp1 allows the user to enter a string and it shares that string in different ways. With its own popup, it shares the string by means of a static field of SharedApp1 activity class. SharedApp2 is another application, having its own APK file but is placed into the same process as SharedApp1. SharedApp1 and SharedApp2 communicate through the good old System.getProperty/setProperty mechanism. Observe, that this works only if the sharedUserId/process mechanism is properly used, if you remove e.g. the process attribute from the manifest file of any of the apps, the property set by SharedApp1 is not visible anymore to SharedApp2 because they run in different VM processes. Also note that I compiled these applications with the debug option which means that they are both signed with the debug key. That key is common for both applications therefore they can have the same sharedUserIds. If you use a proper signing key, take care of using the same key when you sign applications that depend on the sharedUserId mechanism.

sharedApp2

 

【信息科学与工程学】【制造工程】第三十六篇 机械工程与自动化101 本系统通过多模型集成、知识增强、主动学习和持续优化等关键技术,实现了高效、高质量的自动化文本语料标注。系统采用模块化设计,支持灵活扩展,能够处理不同类型的文本数据,适应多样的标注需求。 阅读详情

相关推荐

RK3576-Android15-Android16-免root 方案-客户免root方案实现su 相关操作

最近自己在做开机动画相关需求时候,涉及到一个权限问题。对于App 测和adb 命令侧一定要su 情况下才能够进行相关操作。有的时候甚至需要才能操作。这里暂不分析为什么这么改,有兴趣自行分析这个拿来直接用,对开发调试 释放权限,针对客户友好开发非常好。

十年饮冰,难凉热血 233

基于web学院科研与实现 毕业设计---附源码53213

系统面向科研用户、学院领导和管理员三个角色。科研用户可以在线提出项目申请、登记科研成果、发起经费报销申请、管理实验设备,根据科研规划来制定个人的研究进度,学院领导通过科研排行和项目追踪模块实时查看全院的科研情况,用进度监督和规划管理功能来统筹重点项目的安排,管理员对场地信息、耗材库存、设备台账等基础数据进行维护,对申报和登记进行最终审核。各个模块之间互相沟通,形成起从项目立项、过程监督到成果归档的闭环管理流程。

yuyuxun的博客 198

RK3576-Android16-实现开机动画自定义-动态替换bootanimation.zip

开机动画本身分三个不分:uboot 、 kernel 、 Android 三个部分开机动画。我们这里只讲Android层的开机动画,开机动画本身打包到镜像里面去,现在需求就是可以动态替换开机动画实现开机动画自定义、客户可控的功能。平台是RK3576 Android16 方案这里核心是其它根据个人需求,无关紧要代码在Android16 平台上,动态替换开机动画的一次尝试折腾了固化的只读分区,暂未成功,但是自己的方案data 分区也是一个尝试,可以完美解决实际需求。

十年饮冰,难凉热血 245

Rebuttal to the KCC v1.0 Code Audit(Rebuttal Page No.2)

The auditor claims that KCC’s AND-gate fluid model assumes a “vacuum” (no cross-traffic) and that the DRAIN timeout “推翻严格最优性证明” (overturns the strict optimality proof). Both claims are incorrect.

liulilittle的博客 844

LiveGBS流媒体平台GB/T28181实战指南:海康NVR物联网卡摄像头注册失败全链路排查与抓包技巧

本文详细解析了LiveGBS流媒体平台中海康NVR物联网卡摄像头注册失败的常见问题及解决方案。通过全链路排查与抓包技巧,包括物联网卡配置、多网卡冲突处理、防火墙设置等,帮助用户快速定位并解决GB/T28181协议下的设备注册难题,提升流媒体平台部署效率。

weixin_29290947的博客 498

Windows 10/11下R与RStudio最新版安装避坑指南(含镜像加速配置)

本文提供了Windows 10/11系统下R与RStudio最新版的详细安装指南,包含镜像加速配置和常见问题解决方案。通过分步教程帮助用户避开安装陷阱,优化开发环境设置,特别适合国内用户快速搭建高效的数据分析平台。

weixin_29065959的博客 1022

High-Resolution Image Synthesis with Latent Diffusion Models # 基于潜在扩散模型的高分辨率图像合成

Robin Rombach 1 * Andreas Blattmann1 * Dominik Lorenz 1 Patrick Esser ® Björn Ommer 1 1 Ludwig Maximilian University of Munich & IWR, Heidelberg University, Germany ° Runway ML慕尼黑路德维希-马克西米利安大学 & 德国海德堡大学 IWR ° Runway MLhttps://github.com/CompVis/latent-diff

u013250861的博客 98

Wi-Fi Sigma测试系统

Wi-Fi Sigma测试系统是Wi-Fi联盟(WFA)提出的一套全自动的WiFi认证测试系统,几乎涵盖的所有Wi-Fi的功能及性能(throughput)的自动化测试。该系统正逐步取代以前的WiFi认证测试系统。

Ke8323的博客 1万+

PointWorld: 动作条件的全场景3D点flow 预测(用同一种3D物理空间模态来表示状态和动作)

PointWorld: Scaling 3D World Models for In-The-Wild Robotic Manipulation

u013250861的博客 352

过程挖掘(Process Mining)1——始于颜值

下周开始每周1-2篇的过程挖掘分享 过程挖掘是什么? 过程挖掘与过程管理的关系? 过程挖掘与数据挖掘的关系? 管理学还是计算机科学?

hyhy12580的博客 6242

Angular 相关的知识点和项目汇总

Angular 知识点和项目汇总

weixin_45428910的博客 586

High-Resolution Image Synthesis with Latent Diffusion Models 基于潜在扩散模型的高分辨率图像合成

Robin Rombach 1 * Andreas Blattmann1 * Dominik Lorenz 1 Patrick Esser ® Björn Ommer 1 1 Ludwig Maximilian University of Munich & IWR, Heidelberg University, Germany ° Runway ML慕尼黑路德维希-马克西米利安大学 & 德国海德堡大学 IWR ° Runway MLhttps://github.com/CompVis/latent-diff

u013250861的博客 152

人工智能训练师三级考试大纲深度解读|理论+实操分值分布+六大模块占比

三级人工智能训练师考试分为理论和实操两大模块(各100分,合格线60分)。理论考试包含AI基础(30%)、数据标注(25%)、模型训练(20%)、测试(15%)和系统运维(10%),题型为客观题;实操考核侧重数据标注(40%)、模型测试(35%)和系统运维(25%),采用现场操作形式。复习应优先关注AI基础和数据标注等高分值模块,实操需重点掌握标准流程和结果准确性(占评分70%)。考试要求两模块均达标,理论侧重概念理解,实操强调规范执行与文档完整。

白话机器学习 1153

MySQL 分片集群的备份别堆本地盘:用 Vitess 把备份落进 RustFS

Vitess 把 MySQL 拆成很多分片,一个分片跑在一台 tablet 上。备份要是还落在每台 tablet 自己的本地盘里,分片一多就散成一地,真要恢复的时候还得挨个去找哪台机器存了哪份。更现实的麻烦是本地盘一旦坏掉,那份备份跟着就没了,分片越密,单点越稠。Vitess 自带一套 S3 兼容的备份存储实现,能把每个分片的备份直接写进对象存储。用 RustFS 当这个 S3 后端,所有分片的…

分布式存储与RustFS的博客 906

一文搞懂 JavaScript 模块化规范:CommonJS、AMD、ES6 Module

在现代 JavaScript 开发中,模块化是提升代码组织性和可维护性的关键。本文深入解析三种主流的模块化规范——CommonJS、AMD 和 ES6 Module。

Allen- 3486

clock min pulse width检查

高电平脉宽 = clock fall edge到达FF/CK的时间 - clock rise edge到达FF/CK的时间;低电平脉宽 = 下一T clock rise edge到达FF/CK的时间 - clock fall edge到达FF/CK的时间。而required pulse width是根据FF/CK处的transition,根据查找表计算得到的。为什么clock transition越大,会导致required pulse width越大呢?5、 降低clock上的串扰。

芯冰乐 589

CRMEB Pro 秒杀库存:高并发下的扣减写法

秒杀二开别只改活动价。三处要一起减,且必须在创单事务里。

weixin_39475803的博客 215

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

MySQL 备份恢复(日志管理和备份)

MySQL日志用于排错、性能分析及数据恢复。主要日志包括错误日志(记录启动、关闭及运行错误)、通用查询日志(记录客户端所有操作)。通过配置文件my.cnf可指定日志路径,如log_error = error.log。使用SHOW VARIABLES LIKE 'log_error'查看错误日志位置。通用查询日志需开启general_log = ON并指定文件路径。日志对故障排查和数据恢复至关重要。

Y_P_W的博客 207

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Android的APK 集成到 AOSP 源码的方法和流程介绍

1. 目录# 3. device.mk 中添加# 4. 编译编译完成后,APK 就会出现在下,烧录镜像后系统自带该应用。

ZZXTIANMING的博客 270

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

RK3588边缘计算:YOLOv8 使用Android NDK部署_笔记1

RKNN Model Zoo基于 RKNPU SDK 工具链开发, 提供了目前主流算法的部署例程. 例程包含导出RKNN模型, 使用 Python API, CAPI 推理 RKNN 模型的流程.支持RK3562RK3566RK3568RK3576RK3588RV1126B平台。部分支持RV1103RV1106支持RV1109RV1126RK1808平台。1、rknn_model_zoo官网地址。

m0_60657960的博客 198

Android 玩机进阶:刀盾环境 ROOT 工具箱(ADB隐藏/免授权)与 Zygisk / Vector / HMA-OSS 配置教程

本文基于「刀盾环境 App」实拍,详解刷入内核后配置ROOT工具箱(含深度隐藏调试、ADB免弹授权等6大功能)及模块中心六大入口,手把手演示通过Zygisk+Vector+HMA-OSS在线安装与激活全流程,四步完成双模块部署,重启后三界面核验确保生效,助力高效实现系统级定制与风控规避。

专注安卓前沿科技 213

MySQL 基本查询(下)

注意:8.0 的窗口函数在 5.7 中没有直接等价写法,通常要用自连接或用户变量模拟,迁移成本较高,需单独评估。注意:下面所涉及到的SQL代码都是兼容5.7版本,其字符集和校验规则是兼容5.7和8.0的写法。是原子操作,新旧表在一条语句内完成替换,避免“先删后插”中途失败导致数据不一致。CRUD 的操作对象是表,所以先给出完整、可直接执行的建表脚本。聚合,是为了满足 5.7/8.0 默认开启的。案例:删除表中的重复记录,重复数据只保留一份。作用:对查询到的结果进行列值更新。的查询结果直接插入到目标表中。

qq_73640809的博客 225

侧载 APK 后台服务起不来排查:Android 14 foregroundServiceType 与前台服务类型权限

有一类闪退很有迷惑性:应用能装、能打开、主界面一切正常,但只要点「开始录音」「后台同步」「开启导航」「投屏」「连接手表」,立刻闪退或者功能静默失效。卸载重装、清缓存、换下载源都没用。看日志才会发现,崩的不是界面代码,而是系统把一次前台服务(Foreground Service,简称 FGS)启动拦下来了。这个问题在侧载 APK 上格外高发,原因有三个:一是侧载包的常常比商店版旧,或者被改包者动过;二是 Android 14 起系统对 FGS 的类型声明与权限做了强校验,改包时删掉一行就会直接崩;

qq362196705的专栏 145

安卓APK资源混淆加密重签名工具2.1.0更新说明

安卓APK资源混淆加密重签名工具2.1.0版全面强化应用保护,支持代码与资源全方位加固,涵盖DEX加壳、字符串加密、类名混淆、SO/Assets加密、防调试反编译等。新增垃圾代码注入、随机资源干扰、Manifest伪造、DEX垃圾信息等抗AI逆向功能,支持批量处理与自定义签名。优化重命名速度与命名合理性,提升稳定性,修复多处兼容性及崩溃问题,操作简便,无需环境配置,适合开发者高效防护应用安全。

H5开发技术 192

安卓demo-自定义tab indicator

本组件是组合式自定义 view按模式构建子 view根据 tab 数量决定等分(contentContainer 直接挂 FrameLayout)或侧滑(HorizontalScrollView 包裹),每次 setTabList 全量重建;indicator 复用(首次创建后不 new,背景保留避免重建闪白),重建前保存旧 leftMargin 设回避免从 0 闪。等分用 weight / 侧滑固定宽:等分模式 tab 用;侧滑模式 tab 用固定宽,加防文字挤。

mix39的博客 247

文件包含漏洞

这题就是典型原理:PHP 的直接接收用户可控参数,没有过滤file://伪协议,直接读取服务器根下/flag文件。

qq_73552461的博客 166
下一篇: About binders
CodeJoker
博客等级 码龄18年 50粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址