title: Building an Android APK with same certificate as the system
body: <p>I'm trying to make a system app work. Here's what I have:</p>
  
  <p>An OEM OMAP platform with full 4.4.2 source code. I've built the system and loaded on my platform using Ubuntu 14.04. That all works.</p>
  
  <p>Now, there is an app from the OEM which directly accesses the hardware (DSP, I2C, UART) etc. The original APK that came from the OEM works on my platform.</p>
  
  <p>I built the exact same app using <code>make</code> command (not using Eclipse); It builds and I can install on the platform. But when I try to launch the app, it gets stuck in an eternal wait state.</p>
  
  <p>I am not sure, but I suspect my locally built app tries to initialize a hardware component on the board and then gets blocked there.</p>
  
  <p>I've been reading articles all over, and seems like it has something to do with the app signing and certificate. I think the general idea is the app needs to be signed with the same certificate with the system itself. I thought, since I built both the app and the system on the same machine using same commands, they would have a same certificate. </p>
  
  <p>If it helps, the manifest file has this line:</p>
  
  <pre><code>android:sharedUserId="android.uid.system"
  </code></pre>
  
  <p>And the project make file <code>Android.mk</code> has this line:</p>
  
  <pre><code>LOCAL_CERTIFICATE := platform
  </code></pre>
  
  <p>Can anyone show me how can I make the app work? I am not sure, seems like I have to rebuild the app with proper certificates so that it can access all the hardware resources.</p>
  
  <p>Thanks.</p>