Package Installer

Discussion in 'Android' started by Castiel, May 30, 2014.

  1. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    So, I currently have a Motorola Razr XT925 HD. I rooted it and was deleting some stuff. I may have kind of possibly not so accidentally deleted the package installer, so now I can't install anything onto my phone. I was reading somewhere a little while ago that there should be a way to install stuff directly from your computer but you need specific programs, yada yada yada. If someone could walk me through that, or if someone has a much easier way of making it so I can install things onto my phone again that would be fantastic!
     


  2. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    There are a couple ways to do it, actually. You can put the packagerinstaller.apk on your SD card then use a root explorer (like ES File Explorer) to move it to /system/app. Then just restart your phone, and it should work from there. Done it hundreds of times with Trebuchet launcher on non-CM ROMs, works fine.

    You can also use ADB on PC to push the apk file directly to /system/app as well.
     
  3. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    Sorry, but I'm a little confused on how that works. Don't .apk files have to be installed onto your phone before they can be moved to system apps?
     
  4. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    It's a bit complicated, really, and I know I probably won't explain it right...but....Think of APKs like .jar files, they're archives that hold all the resources and assets and such all in one file that can be run from the system. Generally when you install an app, it'll move the APK to /data/apps and will then create a data directory in /data/data that holds all the settings and any other file generated by the APK. Large games like...Half Life or something require separate resources that must be downloaded with the APK, generally the APK will be small and then the app itself will download and move the files to /sdcard/Android/obb (or /data).

    System apps are generally small, and don't require any additional files (since they're usually packaged with Android itself). Here's a screenshot of the /system/app directory on my Shield:

    Warning: Spoilers inside!

    Just a bunch of APK files.
     
  5. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    Gotcha. So, if I have downloaded the packageinstaller.apk, how would I use the ADT program to move it directly to system/apps?
     
  6. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    ADB* There are some adb standalone installs, so you don't need to install the entire Android SDK, so that's an option to get ADB as well.

    Download the drivers for your phone.
    Turn USB Debugging mode on (it's in Developer Mode in the settings, if Dev mode isn't there go to Settings->About and find "Build Number" and tap it until Dev mode is enabled).
    Plug your phone into your PC.
    Open CMD prompt, cd to where adb.exe is in the Android SDK install folder (should be in x/Android/android-sdk/platform-tools), move the packageinstaller.apk to the same directory.
    Type in "adb devices", it should attempt to connect to your phone.
    Once it does, type "adb push packageinstaller.apk /system/app" .
    It'll then send the apk to your /system/app directory. After that, restart your phone and it should be back again.
     
  7. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    When I type adb devices it says adb is not a recognized as an internal or external command.

    I don't want you to go to too much work. I'm trying to do this on Windows. But a step-by-step process would be nice. I am really confused :/
     
  8. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    The only time that would happen is if you weren't in the directory of adb.exe in the CMD prompt.

    Try holding shift, right clicking in the same directory as adb.exe, and pick "Open a command line window here", then continue with the ADB stuff. The above is literally the step by step.
     
  9. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    Okay, wait. I got most of it. I understand. This is the last issue I'm having. It says it failed to copy packageinstaller.apk because it's a read-only file system.
     
  10. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    Try "adb root", make sure it's running as root, then try again
     
  11. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    "adb cannot run as root in production builds"
     
  12. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    Interesting...try adb shell, then adb su. :unsure: If that doesn't work, I'm sort of out of ideas for adb...do you not have any kind of file explorer able to access /?
     
  13. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    All I got is /system/app Mover, and App Master. As far as I'm aware anyways.
     
  14. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    Ok, try pushing the apk to /sdcard/Download, then try using /system/app Mover to move the apk to the /system/app directory on your phone.
     
  15. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    One second. I typed adb root and then adb su and now it's not able to find my device. Should I just close the cmd prompt and try again? This is the messages I have right now:
    Warning: Spoilers inside!
     
  16. cracker

    cracker Nyah!

    Member
    3,143
    411
    Aug 24, 2005
    United States
    Do you have any terminal or file explorer with root access installed? Either one will do the job.
     
  17. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se


    The problem with that is, as far as I can tell, /system/app Mover doesn't access the SD card.
     
  18. cracker

    cracker Nyah!

    Member
    3,143
    411
    Aug 24, 2005
    United States
    Ok I thought up another way around your problem. Put this zip on the root of your internal storage and rename it update.zip. Next reboot into recovery (CWM or TWRP) and install the zip from there and reboot. It should then reinstall the apk during boot up.
     
  19. Castiel
    OP

    Castiel GBAtemp Advanced Fan

    Member
    500
    476
    Oct 15, 2010
    Canada
    Ba Sing Se
    The link doesn't lead me to a download. Just to a black screen that says there should be a packageinstaller.zip.
     
  20. Tom Bombadildo

    Tom Bombadildo Honk!

    pip Contributor
    GBAtemp Patron
    Tom Bombadildo is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    10,563
    10,499
    Jul 11, 2009
    United States
    I forgot
    http://filetrip.net/dl?s6J6Aojrs7 Try this instead, should lead to the download page instead of the embedded one.