4

在后台安装 APK

Git Hub:源代码

google-certificate.keystore存在于证书文件夹中[参见上面的 git 链接]

第 1 步:我在模拟器中运行代码,它工作正常 [但我需要将该google-certificate.keystore位置放在自定义调试密钥库中 [它存在于 Eclipse -> Windows -> Preference -> Android -> bulit]

第2步:如果我没有把它给出的位置java.lang.reflect.InvocationTargetException

如果我连接开发人员电缆并将其运行到 Android 设备

如果我按照步骤 1 它 Installation error: INSTALL_FAILED_INVALID_INSTALL_LOCATION在控制台窗口中给出

如果我按照第 2 步操作,它会安装在设备中,但会给出相同的异常

编辑:

签名的 APK 指南

这是创建为 apk 文件的步骤,但我不应该在哪里输入该命令

编辑:添加 Manifest.xml

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.yal"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />

    <uses-permission android:name="android.permission.INSTALL_PACKAGES"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".InstallInBackgroundSample"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
4

1 回答 1

1

博客人自己在评论中发布了这个:

Hi guys, I found the problem and unfortunately my news is not good. I discovered that this technique only works for me because I use the security certificate of the simulator (the same certificate used by my device in my case). I researched and saw that there are two ways to use the API hidden: - Put your application pre-installed into a system folder on the ROM - Compile your application using the manufacturer’s security certificate So this will just be useful for you if you will make an application to a specific device and you have the certificate of it, just like me. I apologize for not notifying it before, but I did not know that. I’ll update my post and I’ll warn about it at first. Thank you for the feedback.

What you want is not possible anymore without the phone manufacturers certificate or a rooted device.

于 2012-11-27T16:58:00.437 回答