Android Open Source - reflector Installer






From Project

Back to project page reflector.

License

The source code is released under:

Copyright (c) 2011 Hannes Romppainen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the ...

If you think the Android project reflector listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.webs.graub.reflector;
/*  w w  w.ja  va  2  s  .  c  o m*/
import java.util.ArrayList;

import android.util.Log;

public class Installer {

  static boolean install() {

    // 1. check if native is already installed
    if (Screenshot.isAvailable()) {
      return true; // yes is installed and running
    }

    Log.d("Reflector", "Screenshot service is not available, trying to install");

    // 2. check if user has root privileges
    if (!Su.testRootPrivileges()) {
      Log.w("Reflector", "Unable to install, lacking root privileges");
      return false;
    }

    // 3. install the native
    // TODO: maybe we should have several precompiled binaries ? check android version
    // here and choose and install the correct binary here???
    ArrayList<String> cmds = new ArrayList<String>();
    cmds.add("unzip -o /data/app/com.acs.screencap* *asl-native -d /data/local/tmp");
    cmds.add("mv /data/local/tmp/assets/asl-native /data/local/asl-native");
    cmds.add("chmod 0777 /data/local/asl-native");
    cmds.add("/data/local/asl-native");
    Su.execute(cmds);

    return false;
  }
}




Java Source Code List

com.webs.graub.reflector.BitmapContentAdapter.java
com.webs.graub.reflector.ControlPanel.java
com.webs.graub.reflector.Installer.java
com.webs.graub.reflector.ReflectorClient.java
com.webs.graub.reflector.ReflectorComms.java
com.webs.graub.reflector.ReflectorService.java
com.webs.graub.reflector.Screenshot.java
com.webs.graub.reflector.Su.java
com.webs.graub.reflector.TestBitmap.java
com.webs.graub.reflector.UpnpPush.java