In the last few years, the amount of smart devices in domestic environments has incredibly increased. Nowadays, a smart home is usually managed via a gateway offering valueadded applications by connecting devices to the cloud. Every new device comes with its own features and protocols or cloud services. There is, consequently, a strong need for constantly modifying the gateway's behavior by deploying, removing or updating applications. However, there is no software architecture ensuring enough flexibility and trust to sustain this need. We consequently propose in this article a framework that allows to easily compose modular and context-aware software architectures intending to host third-party applications. This frameworkcalled AOLOA (Another OSGi-Like On Another)-is based on OSGi and Java permissions. It ensures applications isolation, separates business-logic (higher level) and platform (lower level) layers and allows their trusted management.