diff --git a/bin/VNCserver-debug-unaligned.apk b/bin/VNCserver-debug-unaligned.apk deleted file mode 100644 index fd4e410..0000000 Binary files a/bin/VNCserver-debug-unaligned.apk and /dev/null differ diff --git a/bin/VNCserver-debug.apk b/bin/VNCserver-debug.apk deleted file mode 100644 index 260b148..0000000 Binary files a/bin/VNCserver-debug.apk and /dev/null differ diff --git a/bin/VNCserver.ap_ b/bin/VNCserver.ap_ deleted file mode 100644 index d21b43c..0000000 Binary files a/bin/VNCserver.ap_ and /dev/null differ diff --git a/bin/avnc_signed.apk b/bin/avnc_signed.apk deleted file mode 100644 index 42589e8..0000000 Binary files a/bin/avnc_signed.apk and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$1$1.class b/bin/classes/org/onaips/vnc_donate/MainActivity$1$1.class deleted file mode 100644 index 979edac..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$1$1.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$1.class b/bin/classes/org/onaips/vnc_donate/MainActivity$1.class deleted file mode 100644 index 95e2a4e..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$1.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$10.class b/bin/classes/org/onaips/vnc_donate/MainActivity$10.class deleted file mode 100644 index d23e705..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$10.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$11.class b/bin/classes/org/onaips/vnc_donate/MainActivity$11.class deleted file mode 100644 index f6c0557..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$11.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$12.class b/bin/classes/org/onaips/vnc_donate/MainActivity$12.class deleted file mode 100644 index e88fb97..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$12.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$2$1.class b/bin/classes/org/onaips/vnc_donate/MainActivity$2$1.class deleted file mode 100644 index 943e0c2..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$2$1.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$2.class b/bin/classes/org/onaips/vnc_donate/MainActivity$2.class deleted file mode 100644 index 0579c13..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$2.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$3.class b/bin/classes/org/onaips/vnc_donate/MainActivity$3.class deleted file mode 100644 index 624f4bc..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$3.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$4.class b/bin/classes/org/onaips/vnc_donate/MainActivity$4.class deleted file mode 100644 index eef726e..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$4.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$5$1.class b/bin/classes/org/onaips/vnc_donate/MainActivity$5$1.class deleted file mode 100644 index b32dc53..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$5$1.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$5.class b/bin/classes/org/onaips/vnc_donate/MainActivity$5.class deleted file mode 100644 index 0c20860..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$5.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$6.class b/bin/classes/org/onaips/vnc_donate/MainActivity$6.class deleted file mode 100644 index 542c0f8..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$6.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$7.class b/bin/classes/org/onaips/vnc_donate/MainActivity$7.class deleted file mode 100644 index 5101449..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$7.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$8.class b/bin/classes/org/onaips/vnc_donate/MainActivity$8.class deleted file mode 100644 index db130b4..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$8.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity$9.class b/bin/classes/org/onaips/vnc_donate/MainActivity$9.class deleted file mode 100644 index cbcd1a1..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity$9.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/MainActivity.class b/bin/classes/org/onaips/vnc_donate/MainActivity.class deleted file mode 100644 index 0f3bece..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/MainActivity.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$array.class b/bin/classes/org/onaips/vnc_donate/R$array.class deleted file mode 100644 index 14d296a..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$array.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$attr.class b/bin/classes/org/onaips/vnc_donate/R$attr.class deleted file mode 100644 index 9c65cf3..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$attr.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$drawable.class b/bin/classes/org/onaips/vnc_donate/R$drawable.class deleted file mode 100644 index 6ae02ef..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$drawable.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$id.class b/bin/classes/org/onaips/vnc_donate/R$id.class deleted file mode 100644 index 514b576..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$id.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$layout.class b/bin/classes/org/onaips/vnc_donate/R$layout.class deleted file mode 100644 index 906adc5..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$layout.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$menu.class b/bin/classes/org/onaips/vnc_donate/R$menu.class deleted file mode 100644 index 518caad..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$menu.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$raw.class b/bin/classes/org/onaips/vnc_donate/R$raw.class deleted file mode 100644 index 1eb9bf4..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$raw.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$string.class b/bin/classes/org/onaips/vnc_donate/R$string.class deleted file mode 100644 index 8338224..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$string.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$styleable.class b/bin/classes/org/onaips/vnc_donate/R$styleable.class deleted file mode 100644 index 5d214cc..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$styleable.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R$xml.class b/bin/classes/org/onaips/vnc_donate/R$xml.class deleted file mode 100644 index 22ee0ae..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R$xml.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/R.class b/bin/classes/org/onaips/vnc_donate/R.class deleted file mode 100644 index 4e9b1b5..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/R.class and /dev/null differ diff --git a/bin/classes/org/onaips/vnc_donate/preferences.class b/bin/classes/org/onaips/vnc_donate/preferences.class deleted file mode 100644 index 4dd9720..0000000 Binary files a/bin/classes/org/onaips/vnc_donate/preferences.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$1$1.class b/bin/org/onaips/vnc_donate/MainActivity$1$1.class deleted file mode 100644 index 4ce1657..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$1$1.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$1.class b/bin/org/onaips/vnc_donate/MainActivity$1.class deleted file mode 100644 index b7418bf..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$1.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$10.class b/bin/org/onaips/vnc_donate/MainActivity$10.class deleted file mode 100644 index 4078f7b..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$10.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$11.class b/bin/org/onaips/vnc_donate/MainActivity$11.class deleted file mode 100644 index 2123a5a..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$11.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$12.class b/bin/org/onaips/vnc_donate/MainActivity$12.class deleted file mode 100644 index 76683c0..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$12.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$2$1.class b/bin/org/onaips/vnc_donate/MainActivity$2$1.class deleted file mode 100644 index 739c6e8..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$2$1.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$2.class b/bin/org/onaips/vnc_donate/MainActivity$2.class deleted file mode 100644 index cb62842..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$2.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$3.class b/bin/org/onaips/vnc_donate/MainActivity$3.class deleted file mode 100644 index a508d5f..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$3.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$4.class b/bin/org/onaips/vnc_donate/MainActivity$4.class deleted file mode 100644 index b4324eb..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$4.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$5$1.class b/bin/org/onaips/vnc_donate/MainActivity$5$1.class deleted file mode 100644 index feeabab..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$5$1.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$5.class b/bin/org/onaips/vnc_donate/MainActivity$5.class deleted file mode 100644 index 79284a2..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$5.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$6.class b/bin/org/onaips/vnc_donate/MainActivity$6.class deleted file mode 100644 index d074550..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$6.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$7.class b/bin/org/onaips/vnc_donate/MainActivity$7.class deleted file mode 100644 index fff2d33..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$7.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$8.class b/bin/org/onaips/vnc_donate/MainActivity$8.class deleted file mode 100644 index 63aa9c7..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$8.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$9.class b/bin/org/onaips/vnc_donate/MainActivity$9.class deleted file mode 100644 index 13bda52..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$9.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/MainActivity.class b/bin/org/onaips/vnc_donate/MainActivity.class deleted file mode 100644 index 3546f29..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$array.class b/bin/org/onaips/vnc_donate/R$array.class deleted file mode 100644 index cbc11f2..0000000 Binary files a/bin/org/onaips/vnc_donate/R$array.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$attr.class b/bin/org/onaips/vnc_donate/R$attr.class deleted file mode 100644 index eddb203..0000000 Binary files a/bin/org/onaips/vnc_donate/R$attr.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$drawable.class b/bin/org/onaips/vnc_donate/R$drawable.class deleted file mode 100644 index 60683f2..0000000 Binary files a/bin/org/onaips/vnc_donate/R$drawable.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$id.class b/bin/org/onaips/vnc_donate/R$id.class deleted file mode 100644 index 95bcd40..0000000 Binary files a/bin/org/onaips/vnc_donate/R$id.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$layout.class b/bin/org/onaips/vnc_donate/R$layout.class deleted file mode 100644 index fa63e44..0000000 Binary files a/bin/org/onaips/vnc_donate/R$layout.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$menu.class b/bin/org/onaips/vnc_donate/R$menu.class deleted file mode 100644 index 5929828..0000000 Binary files a/bin/org/onaips/vnc_donate/R$menu.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$raw.class b/bin/org/onaips/vnc_donate/R$raw.class deleted file mode 100644 index d2b3103..0000000 Binary files a/bin/org/onaips/vnc_donate/R$raw.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$string.class b/bin/org/onaips/vnc_donate/R$string.class deleted file mode 100644 index 383402d..0000000 Binary files a/bin/org/onaips/vnc_donate/R$string.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$styleable.class b/bin/org/onaips/vnc_donate/R$styleable.class deleted file mode 100644 index 8f841da..0000000 Binary files a/bin/org/onaips/vnc_donate/R$styleable.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R$xml.class b/bin/org/onaips/vnc_donate/R$xml.class deleted file mode 100644 index faf6ae2..0000000 Binary files a/bin/org/onaips/vnc_donate/R$xml.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/R.class b/bin/org/onaips/vnc_donate/R.class deleted file mode 100644 index 486b762..0000000 Binary files a/bin/org/onaips/vnc_donate/R.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/preferences.class b/bin/org/onaips/vnc_donate/preferences.class deleted file mode 100644 index 0d0cb50..0000000 Binary files a/bin/org/onaips/vnc_donate/preferences.class and /dev/null differ diff --git a/gen/org/onaips/vnc_donate/R.java b/gen/org/onaips/vnc_donate/R.java deleted file mode 100644 index d0ccb08..0000000 --- a/gen/org/onaips/vnc_donate/R.java +++ /dev/null @@ -1,194 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package org.onaips.vnc_donate; - -public final class R { - public static final class array { - public static final int rotation_values=0x7f070000; - } - public static final class attr { - /**

Must be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - */ - public static final int backgroundColor=0x7f010000; - /**

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - */ - public static final int keywords=0x7f010003; - /**

Must be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - */ - public static final int primaryTextColor=0x7f010001; - /**

Must be an integer value, such as "100". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - */ - public static final int refreshInterval=0x7f010004; - /**

Must be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - */ - public static final int secondaryTextColor=0x7f010002; - } - public static final class drawable { - public static final int bg=0x7f020000; - public static final int btnstart=0x7f020001; - public static final int btnstart_normal=0x7f020002; - public static final int btnstart_pressed=0x7f020003; - public static final int btnstop=0x7f020004; - public static final int btnstop_normal=0x7f020005; - public static final int btnstop_pressed=0x7f020006; - public static final int droidvnclogo=0x7f020007; - public static final int icon=0x7f020008; - } - public static final class id { - public static final int Button01=0x7f090000; - public static final int Button02=0x7f090001; - public static final int TextView01=0x7f090002; - public static final int TextView02=0x7f090004; - public static final int preferences=0x7f090005; - public static final int stateLabel=0x7f090003; - } - public static final class layout { - public static final int main=0x7f030000; - } - public static final class menu { - public static final int menu=0x7f080000; - } - public static final class raw { - public static final int androidvncserver=0x7f050000; - public static final int indexvnc=0x7f050001; - public static final int vncviewer=0x7f050002; - } - public static final class string { - public static final int app_name=0x7f060000; - public static final int device_info_fmt=0x7f060002; - public static final int password=0x7f060001; - } - public static final class xml { - public static final int preferences=0x7f040000; - } - public static final class styleable { - /** Attributes that can be used with a com_admob_android_ads_AdView. -

Includes the following attributes:

- - - - - - - - - -
AttributeDescription
{@link #com_admob_android_ads_AdView_backgroundColor org.onaips.vnc_donate:backgroundColor}
{@link #com_admob_android_ads_AdView_keywords org.onaips.vnc_donate:keywords}
{@link #com_admob_android_ads_AdView_primaryTextColor org.onaips.vnc_donate:primaryTextColor}
{@link #com_admob_android_ads_AdView_refreshInterval org.onaips.vnc_donate:refreshInterval}
{@link #com_admob_android_ads_AdView_secondaryTextColor org.onaips.vnc_donate:secondaryTextColor}
- @see #com_admob_android_ads_AdView_backgroundColor - @see #com_admob_android_ads_AdView_keywords - @see #com_admob_android_ads_AdView_primaryTextColor - @see #com_admob_android_ads_AdView_refreshInterval - @see #com_admob_android_ads_AdView_secondaryTextColor - */ - public static final int[] com_admob_android_ads_AdView = { - 0x7f010000, 0x7f010001, 0x7f010002, 0x7f010003, - 0x7f010004 - }; - /** -

This symbol is the offset where the {@link org.onaips.vnc_donate.R.attr#backgroundColor} - attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. - - -

Must be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - @attr name android:backgroundColor - */ - public static final int com_admob_android_ads_AdView_backgroundColor = 0; - /** -

This symbol is the offset where the {@link org.onaips.vnc_donate.R.attr#keywords} - attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. - - -

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - @attr name android:keywords - */ - public static final int com_admob_android_ads_AdView_keywords = 3; - /** -

This symbol is the offset where the {@link org.onaips.vnc_donate.R.attr#primaryTextColor} - attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. - - -

Must be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - @attr name android:primaryTextColor - */ - public static final int com_admob_android_ads_AdView_primaryTextColor = 1; - /** -

This symbol is the offset where the {@link org.onaips.vnc_donate.R.attr#refreshInterval} - attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. - - -

Must be an integer value, such as "100". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - @attr name android:refreshInterval - */ - public static final int com_admob_android_ads_AdView_refreshInterval = 4; - /** -

This symbol is the offset where the {@link org.onaips.vnc_donate.R.attr#secondaryTextColor} - attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. - - -

Must be a color value, in the form of "#rgb", "#argb", -"#rrggbb", or "#aarrggbb". -

This may also be a reference to a resource (in the form -"@[package:]type:name") or -theme attribute (in the form -"?[package:][type:]name") -containing a value of this type. - @attr name android:secondaryTextColor - */ - public static final int com_admob_android_ads_AdView_secondaryTextColor = 2; - }; -} diff --git a/jni/vnc/rotatetemplate.c b/jni/vnc/rotatetemplate.c deleted file mode 100644 index 57dc052..0000000 --- a/jni/vnc/rotatetemplate.c +++ /dev/null @@ -1,52 +0,0 @@ -#define OUT_T CONCAT3E(uint,OUT,_t) -#define FUNCTION CONCAT2E(FUNCNAME,OUT) - -static void FUNCTION(rfbScreenInfoPtr screen) -{ - OUT_T* buffer = (OUT_T*)screen->frameBuffer; - int i, j, w = screen->width, h = screen->height; - OUT_T* newBuffer = (OUT_T*)malloc(w * h * sizeof(OUT_T)); - - for (j = 0; j < h; j++) - for (i = 0; i < w; i++) - newBuffer[FUNC(i, j)] = buffer[i + j * w]; - - memcpy(buffer, newBuffer, w * h * sizeof(OUT_T)); - free(newBuffer); - -#ifdef SWAPDIMENSIONS - screen->width = h; - screen->paddedWidthInBytes = h * OUT / 8; - screen->height = w; - - { - rfbClientIteratorPtr iterator; - rfbClientPtr cl; - iterator = rfbGetClientIterator(screen); - while ((cl = rfbClientIteratorNext(iterator)) != NULL) - cl->newFBSizePending = 1; - } -#endif - - rfbMarkRectAsModified(screen, 0, 0, screen->width, screen->height); -} - -#if OUT == 32 -void FUNCNAME(rfbScreenInfoPtr screen) { - if (screen->serverFormat.bitsPerPixel == 32) - CONCAT2E(FUNCNAME,32)(screen); - else if (screen->serverFormat.bitsPerPixel == 16) - CONCAT2E(FUNCNAME,16)(screen); - else if (screen->serverFormat.bitsPerPixel == 8) - CONCAT2E(FUNCNAME,8)(screen); - else { - rfbErr("Unsupported pixel depth: %d\n", - screen->serverFormat.bitsPerPixel); - return; - } -} -#endif - -#undef FUNCTION -#undef OUT - diff --git a/libs/armeabi/androidvncserver.zip b/libs/armeabi/androidvncserver.zip deleted file mode 100644 index 2256aad..0000000 Binary files a/libs/armeabi/androidvncserver.zip and /dev/null differ diff --git a/obj1/local/armeabi/objs/androidvncserver/LibVNCServer-0.9.7/libvncserver/main.o b/obj1/local/armeabi/objs/androidvncserver/LibVNCServer-0.9.7/libvncserver/main.o deleted file mode 100644 index ba4e643..0000000 Binary files a/obj1/local/armeabi/objs/androidvncserver/LibVNCServer-0.9.7/libvncserver/main.o and /dev/null differ diff --git a/obj1/local/armeabi/objs/androidvncserver/LibVNCServer-0.9.7/libvncserver/main.o.d b/obj1/local/armeabi/objs/androidvncserver/LibVNCServer-0.9.7/libvncserver/main.o.d deleted file mode 100644 index 1365e43..0000000 --- a/obj1/local/armeabi/objs/androidvncserver/LibVNCServer-0.9.7/libvncserver/main.o.d +++ /dev/null @@ -1,215 +0,0 @@ -/home/onaips/Dropbox/projectos/workspace/avnc/obj/local/armeabi/objs/androidvncserver/LibVNCServer-0.9.7/libvncserver/main.o: \ - /home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/libvncserver/main.c \ - /home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfb.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/stdio.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/cdefs.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/cdefs_elf.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/_types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/_types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/stdint.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/posix_types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/stddef.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/compiler.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/posix_types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/kernel.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/sysmacros.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/stdlib.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/string.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/malloc.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/alloca.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/strings.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/memory.h \ - /home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbproto.h \ - /home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbconfig.h \ - /home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbint.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/zlib.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/zconf.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/time.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/time.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/netinet/in.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/endian.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/endian.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/socket.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/socket.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/sockios.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/sockios.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/uio.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/in.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/byteorder.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/byteorder/little_endian.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/byteorder/swab.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/byteorder/generic.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/in6.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/netinet/in6.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/arpa/inet.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/select.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/pthread.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/time.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/siginfo.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/siginfo.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/signal.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/limits.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/limits.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/limits.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/internal_types.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/limits.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/signal.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/signal.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sched.h \ - /home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbregion.h \ - /home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/libvncserver/private.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/errno.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/errno.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/errno.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/errno.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/errno-base.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/socket.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/unistd.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/sysconf.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/capability.h \ - /home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/pathconf.h - -/home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfb.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/stdio.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/cdefs.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/cdefs_elf.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/_types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/_types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/stdint.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/posix_types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/stddef.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/compiler.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/posix_types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/kernel.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/sysmacros.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/stdlib.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/string.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/malloc.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/alloca.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/strings.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/memory.h: - -/home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbproto.h: - -/home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbconfig.h: - -/home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbint.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/zlib.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/zconf.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/time.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/time.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/netinet/in.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/endian.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/endian.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/socket.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/socket.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/sockios.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/sockios.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/uio.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/in.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/byteorder.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/byteorder/little_endian.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/byteorder/swab.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/byteorder/generic.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/in6.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/netinet/in6.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/arpa/inet.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/select.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/pthread.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/time.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/siginfo.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/siginfo.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/signal.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/limits.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/limits.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/limits.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/internal_types.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/machine/limits.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/signal.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/signal.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sched.h: - -/home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/rfb/rfbregion.h: - -/home/onaips/Dropbox/projectos/workspace/avnc/jni/vnc/LibVNCServer-0.9.7/libvncserver/private.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/errno.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/errno.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm/errno.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/errno.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/asm-generic/errno-base.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/socket.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/unistd.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/sys/sysconf.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/linux/capability.h: - -/home/onaips/Desktop/android-ndk-r4-crystax/build/platforms/android-5/arch-arm/usr/include/pathconf.h: diff --git a/obj1/local/armeabi/objs/androidvncserver/fbvncserver.o.d b/obj1/local/armeabi/objs/androidvncserver/fbvncserver.o.d deleted file mode 100644 index e69de29..0000000 diff --git a/obj1/local/armeabi/objs/androidvncserver/suinput.o.d b/obj1/local/armeabi/objs/androidvncserver/suinput.o.d deleted file mode 100644 index e69de29..0000000 diff --git a/res/drawable-hdpi/icon.png b/res/drawable-hdpi/icon.png deleted file mode 100644 index 8074c4c..0000000 Binary files a/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/res/drawable-ldpi/icon.png b/res/drawable-ldpi/icon.png deleted file mode 100644 index 1095584..0000000 Binary files a/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/res/drawable-mdpi/icon.png b/res/drawable-mdpi/icon.png deleted file mode 100644 index a07c69f..0000000 Binary files a/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/src/org/onaips/vnc/MainActivity.java~ b/src/org/onaips/vnc/MainActivity.java~ deleted file mode 100644 index 11ceee1..0000000 --- a/src/org/onaips/vnc/MainActivity.java~ +++ /dev/null @@ -1,711 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onaips.vnc; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.util.List; -import java.util.Timer; -import java.util.TimerTask; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - - -import android.app.Activity; -import android.app.AlertDialog; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.content.pm.PackageManager.NameNotFoundException; -import android.graphics.Color; -import android.net.DhcpInfo; -import android.net.Uri; -import android.net.wifi.WifiInfo; -import android.net.wifi.WifiManager; -import android.os.Build; -import android.os.Bundle; -import android.preference.PreferenceManager; -import android.text.Html; -import android.util.Log; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.TextView; -import android.widget.Toast; - -public class MainActivity extends Activity -{ - private static final int MENU_QUIT = 0; - private static final int MENU_HELP = 1; - private static final int MENU_ONAIPS = 2; - private static final int MENU_SENDLOG = 3; - private boolean started=false; - private static final String changelog="-New graphic design!
Courtesy of Sandro Forbice (@sandroforbice)
Fixed clicking issue (please give feedback)"; - - - SharedPreferences preferences; - ProgressDialog dialog=null; - AlertDialog startDialog; - - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - setContentView(R.layout.main); - - - // Initialize preferences - preferences = PreferenceManager.getDefaultSharedPreferences(this); - - if (!started) - { - if (!hasRootPermission()) - { - Log.v("VNC","You don't have root permissions...!!!"); - showTextOnScreen("You don't have root permissions...Please ROOT your phone first!!!"); - //System.exit(-1); - } - - showInitialScreen(); - createBinary(); - } - - boolean serverRunning=isAndroidServerRunning(); - - setStateLabel(serverRunning); - TextView t=(TextView)findViewById(R.id.TextView01); - - if (serverRunning) - t.setText("Connect to:\n" + getIpAddress()+":5901" + "\nor\nhttp://" + getIpAddress() + ":5801"); - else - t.setText(""); - - - findViewById(R.id.Button01).setOnClickListener(new OnClickListener() { - @Override - public void onClick(View arg0) { - Thread t=new Thread(){ - public void run() - { - startServerButtonClicked(); - - } - }; - t.start(); - - try { - Thread.sleep(1000); - for (int i=0;i<5;i++) - { - - if (!isAndroidServerRunning()) - Thread.sleep(1000); - else - break; - } - } catch (InterruptedException e) { - // TODO Auto-generated catch block - Log.v("VNC","Button01_click:"+ e.getMessage()); - } - - boolean s=isAndroidServerRunning(); - if (!s) - showTextOnScreen("Couldn't start VNC Server"); - //setStateLabel(s); - return; - } - }) ; - findViewById(R.id.Button02).setOnClickListener(new OnClickListener() { - @Override - public void onClick(View arg0) { - - Thread t=new Thread(){ - public void run() - { - stopServer(); - - } - }; - t.start(); - - try { - Thread.sleep(1000); - - - for (int i=0;i<5;i++) - { - if (isAndroidServerRunning()) - Thread.sleep(1000); - else - break; - } - } catch (InterruptedException e) { - Log.v("VNC","Button02_click:"+ e.getMessage()); - - } - boolean s=isAndroidServerRunning(); - if (s) - showTextOnScreen("Couldn't Stop VNC Server\nTry hitting F12 on a connected client"); - //setStateLabel(s); - return; - } - }); - - started=true; - } - - public String packageVersion() - { - String version = ""; - try { - PackageInfo pi = getPackageManager().getPackageInfo(getPackageName(), 0); - version = pi.versionName; - } catch (NameNotFoundException e) { - // TODO Auto-generated catch block - Log.v("VNC","onOptionsItemSelected: "+ e.getMessage()); - }; - return version; - } - - public boolean free_version() - { - return getPackageName().equals("org.onaips.vnc"); - } - - public void showInitialScreen() - { - // Initialize preferences - preferences = PreferenceManager.getDefaultSharedPreferences(this ); - SharedPreferences.Editor editor = preferences.edit(); - - String message="Changelog:

" + changelog; - - String version=packageVersion(); - - if (!free_version()) - { - if (version.equals(preferences.getString("version", ""))) - return; - editor.putString("version", version); - editor.commit(); - } - - - startDialog = new AlertDialog.Builder(this).create(); - startDialog.setTitle("droid VNC Server " + version); - startDialog.setMessage(Html.fromHtml(message)); - startDialog.setIcon(R.drawable.icon); - - if (free_version()) - { - startDialog.setButton(AlertDialog.BUTTON1,"Wait...", new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface arg0, int arg1) { - startDialog.dismiss(); - } - }); - - - - startDialog.setButton2("Donate Version", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=org.onaips.vnc_donate")); - startActivity(myIntent); - - } - }); - - startDialog.setCancelable(false); - startDialog.show(); - - Button b=(Button)startDialog.getButton(AlertDialog.BUTTON1); - b.setEnabled(false); - - Timer t1=new Timer(); - t1.schedule(new TimerTask() { - @Override - public void run() { - runOnUiThread(new Runnable(){ - public void run() { - // ((DialogInterface) startDialog).dismiss(); - Button b=(Button)startDialog.getButton(AlertDialog.BUTTON1); - b.setEnabled(true); - b.setText("OK"); - } - }); - } - }, (long)10000); - } - else - startDialog.show(); - } - - static void writeCommand(OutputStream os, String command) throws Exception - { - os.write((command + "\n").getBytes("ASCII")); - } - - - - public void showTextOnScreen(final String t) - { - runOnUiThread(new Runnable(){ - public void run() { - Toast.makeText(MainActivity.this,t,Toast.LENGTH_LONG).show(); - } - }); - } - - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.menu, menu); - - menu.add(0,MENU_SENDLOG,0,"Send debug info"); - menu.add(0,MENU_ONAIPS,0,"About"); - menu.add(0, MENU_HELP, 0, "Help"); - menu.add(0, MENU_QUIT, 0, "Close"); - - return true; - } - - public void setStateLabel(boolean state) - { - TextView stateLabel=(TextView)findViewById(R.id.stateLabel); - stateLabel.setText(state?"Running":"Stopped"); - stateLabel.setTextColor(state?Color.GREEN:Color.RED); - } - - public String getIpAddress() - { - WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); - DhcpInfo dhcpInfo = wifiManager.getDhcpInfo(); - - - return intToIp(dhcpInfo.ipAddress); - } - - boolean wifiConnected() - { - WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); - WifiInfo info = wifi.getConnectionInfo(); - - return info.getBSSID()!=null; - } - - private String intToIp(int i) { - return ( i & 0xFF) + "." + ((i >> 8 ) & 0xFF) + "." + ((i >> 16 ) & 0xFF) + "." + ((i >> 24 ) & 0xFF); - } - - public void stopServer() - { - try{ - Process sh; - - sh = Runtime.getRuntime().exec("su"); - OutputStream os = sh.getOutputStream(); - writeCommand(os, "killall androidvncserver"); - writeCommand(os, "killall -KILL androidvncserver"); - writeCommand(os, "exit"); - - os.flush(); - os.close(); - } catch (IOException e) { - showTextOnScreen("stopServer()" + e.getMessage()); - Log.v("VNC","stopServer()" + e.getMessage()); - } catch (Exception e) { - Log.v("VNC","stopServer()" + e.getMessage()); - } - - } - - public void startServerButtonClicked() - { - if (isAndroidServerRunning()) - { - new AlertDialog.Builder(this) - .setTitle("Alert") - .setMessage(Html.fromHtml("There is another daemon already running, do you want to kill it?")) - .setPositiveButton("Yes", new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface arg0, int arg1) { - stopServer(); - startServer(); - } - }) - .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - return; - } - }) - .show(); - } - else - startServer(); - } - - - public void startServer() - { - try{ - Process sh; - - String password=preferences.getString("password", ""); - String password_check=""; - - String rotation=preferences.getString("rotation", "0"); - if (!password.equals("")) - password_check="-p " + password; - - rotation="-r " + rotation; - - sh = Runtime.getRuntime().exec("su"); - OutputStream os = sh.getOutputStream(); - writeCommand(os, "chmod 777 /data/data/"+getPackageName()+"/androidvncserver"); - writeCommand(os, "/data/data/"+getPackageName()+"/androidvncserver "+ password_check + " " + rotation); - - - } catch (IOException e) { - Log.v("VNC","startServer():" + e.getMessage()); - showTextOnScreen("startServer():" + e.getMessage()); - } catch (Exception e) { - Log.v("VNC","startServer():" + e.getMessage()); - showTextOnScreen("startServer():" + e.getMessage()); - } - - } - - - - public void copyBinary(int id,String path) - { - try { - InputStream ins = getResources().openRawResource(id); - int size = ins.available(); - - // Read the entire resource into a local byte buffer. - byte[] buffer = new byte[size]; - ins.read(buffer); - ins.close(); - - FileOutputStream fos = new FileOutputStream(path); - fos.write(buffer); - fos.close(); - } - catch (Exception e) - { - Log.v("VNC","public void createBinary(): " + e.getMessage()); - } - - - } - public void createBinary() - { - copyBinary(R.raw.androidvncserver, "/data/data/" + getPackageName() + "/androidvncserver"); - copyBinary(R.raw.vncviewer, "/data/data/"+getPackageName()+"/VncViewer.jar"); - copyBinary(R.raw.indexvnc, "/data/data/"+getPackageName()+"/index.vnc"); - } - - public void showHelp() - { - new AlertDialog.Builder(this) - .setTitle("Help") - .setMessage(Html.fromHtml("Mouse Mappings:

Right Click -> Back
Middle Click -> End Call
Left Click -> Touch

Keyboard Mappings

" + - "Home Key -> Home
Escape -> Back
Page Up ->Menu
Left Ctrl -> Search
PgDown -> Start Call
" + - "End Key -> End Call
F4 -> Rotate
F11 -> Disconnect Server
F12 -> Stop Server Daemon")) - .setPositiveButton("Fechar", null) - .setNegativeButton("Open Website", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://onaips.blogspot.com")); - startActivity(myIntent); - } - }) - .show(); - } - - // This method is called once the menu is selected - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - // We have only one menu option - case R.id.preferences: - // Launch Preference activity - Intent i = new Intent(MainActivity.this, preferences.class); - startActivity(i); - - showTextOnScreen("Don't forget to stop/start the server after changes"); - - break; - case MENU_QUIT: - System.exit(1); - break; - case MENU_HELP: - showHelp(); - break; - case MENU_SENDLOG: - collectAndSendLog(); - break; - case MENU_ONAIPS: - - new AlertDialog.Builder(this) - .setTitle("About") - .setMessage(Html.fromHtml("version " + packageVersion() + "

developed by oNaiPs

Graphics: Sandro Forbice (@sandroforbice)

Open-Source Software")) - .setPositiveButton("Close", null) - .setNegativeButton("Open Website", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://onaips.blogspot.com")); - startActivity(myIntent); - - } - }) - .show(); - } - return true; - } - - public boolean isAndroidServerRunning() - { - String result=""; - Process sh; - try { - sh = Runtime.getRuntime().exec("ps"); - - - InputStream is=sh.getInputStream(); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - String line; - - while ((line = br.readLine()) != null) { - result+=line; - if (result.indexOf("androidvncserver")>0) - return true; - } - OutputStream os = sh.getOutputStream(); - writeCommand(os, "exit"); - os.flush(); - os.close(); - } catch (IOException e) { - Log.v("VNC"," isAndroidServerRunning():" + e.getMessage()); - } catch (Exception e) { - Log.v("VNC"," isAndroidServerRunning():" + e.getMessage()); - } - - //Log.v("VNC",result); - - return false; - } - - - public boolean hasRootPermission() { - boolean rooted = true; - try { - File su = new File("/system/bin/su"); - if (su.exists() == false) { - su = new File("/system/xbin/su"); - if (su.exists() == false) { - rooted = false; - } - } - } catch (Exception e) { - Log.v("VNC", "Can't obtain root - Here is what I know: "+e.getMessage()); - rooted = false; - } - Process sh; - try { - String result=""; - - sh = Runtime.getRuntime().exec("whoami"); - - InputStream is=sh.getInputStream(); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - String line; - - while ((line = br.readLine()) != null) { - result+=line; - if (result.indexOf("androidvncserver")>0) - return true; - } - - Process sh1=Runtime.getRuntime().exec("su"); - - //Log.v("aaaaaa","chgrp -R " + result + " /data/data/org.onaips.vnc/"); - - OutputStream os = sh1.getOutputStream(); - - writeCommand(os, "chown -R " + result + " /data/data/" + getPackageName() + "/"); - writeCommand(os, "chgrp -R " + result + " /data/data/" + getPackageName() + "/"); - os.flush(); - os.close(); - isr.close(); - is.close(); - - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - }catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return rooted; - } - - public static final String LOG_COLLECTOR_PACKAGE_NAME = "com.xtralogic.android.logcollector";//$NON-NLS-1$ - public static final String ACTION_SEND_LOG = "com.xtralogic.logcollector.intent.action.SEND_LOG";//$NON-NLS-1$ - public static final String EXTRA_SEND_INTENT_ACTION = "com.xtralogic.logcollector.intent.extra.SEND_INTENT_ACTION";//$NON-NLS-1$ - public static final String EXTRA_DATA = "com.xtralogic.logcollector.intent.extra.DATA";//$NON-NLS-1$ - public static final String EXTRA_ADDITIONAL_INFO = "com.xtralogic.logcollector.intent.extra.ADDITIONAL_INFO";//$NON-NLS-1$ - public static final String EXTRA_SHOW_UI = "com.xtralogic.logcollector.intent.extra.SHOW_UI";//$NON-NLS-1$ - public static final String EXTRA_FILTER_SPECS = "com.xtralogic.logcollector.intent.extra.FILTER_SPECS";//$NON-NLS-1$ - public static final String EXTRA_FORMAT = "com.xtralogic.logcollector.intent.extra.FORMAT";//$NON-NLS-1$ - public static final String EXTRA_BUFFER = "com.xtralogic.logcollector.intent.extra.BUFFER";//$NON-NLS-1$ - - void collectAndSendLog(){ - final PackageManager packageManager = getPackageManager(); - final Intent intent = new Intent(ACTION_SEND_LOG); - List list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); - final boolean isInstalled = list.size() > 0; - - if (!isInstalled){ - new AlertDialog.Builder(this) - .setTitle(getString(R.string.app_name)) - .setIcon(android.R.drawable.ic_dialog_info) - .setMessage("Please install Log Collector application to collect the device log and send it to dev.") - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){ - public void onClick(DialogInterface dialog, int whichButton){ - Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + LOG_COLLECTOR_PACKAGE_NAME)); - marketIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(marketIntent); - } - }) - .setNegativeButton(android.R.string.cancel, null) - .show(); - } - else{ - new AlertDialog.Builder(this) - .setTitle(getString(R.string.app_name)) - .setIcon(android.R.drawable.ic_dialog_info) - .setMessage("Do you want to send debug info to the dev? Please specify what problem is ocurring.\n\nMake sure you started/stopped the server before submitting") - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){ - public void onClick(DialogInterface dialog, int whichButton){ - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(EXTRA_SEND_INTENT_ACTION, Intent.ACTION_SENDTO); - final String email = "onaips@gmail.com"; - intent.putExtra(EXTRA_DATA, Uri.parse("mailto:" + email)); - intent.putExtra(EXTRA_ADDITIONAL_INFO,"Problem Description: \n\n\n\n---------DEBUG--------\n" + getString(R.string.device_info_fmt,getVersionNumber(getApplicationContext()),Build.MODEL,Build.VERSION.RELEASE, getFormattedKernelVersion(), Build.DISPLAY)); - - intent.putExtra(Intent.EXTRA_SUBJECT, "droid VNC server: Debug Info"); - - intent.putExtra(EXTRA_FORMAT, "time"); - - //The log can be filtered to contain data relevant only to your app - String[] filterSpecs = new String[4]; - filterSpecs[0] = "VNC:I"; - filterSpecs[1] = "VNC:D"; - filterSpecs[2] = "VNC:V"; - filterSpecs[3] = "*:S"; - intent.putExtra(EXTRA_FILTER_SPECS, filterSpecs); - - startActivity(intent); - } - }) - .setNegativeButton(android.R.string.cancel, null) - .show(); - } - } - - private String getFormattedKernelVersion() - { - String procVersionStr; - - try { - BufferedReader reader = new BufferedReader(new FileReader("/proc/version"), 256); - try { - procVersionStr = reader.readLine(); - } finally { - reader.close(); - } - - final String PROC_VERSION_REGEX = - "\\w+\\s+" + /* ignore: Linux */ - "\\w+\\s+" + /* ignore: version */ - "([^\\s]+)\\s+" + /* group 1: 2.6.22-omap1 */ - "\\(([^\\s@]+(?:@[^\\s.]+)?)[^)]*\\)\\s+" + /* group 2: (xxxxxx@xxxxx.constant) */ - "\\([^)]+\\)\\s+" + /* ignore: (gcc ..) */ - "([^\\s]+)\\s+" + /* group 3: #26 */ - "(?:PREEMPT\\s+)?" + /* ignore: PREEMPT (optional) */ - "(.+)"; /* group 4: date */ - - Pattern p = Pattern.compile(PROC_VERSION_REGEX); - Matcher m = p.matcher(procVersionStr); - - if (!m.matches()) { - Log.e("VNC", "Regex did not match on /proc/version: " + procVersionStr); - return "Unavailable"; - } else if (m.groupCount() < 4) { - Log.e("VNC", "Regex match on /proc/version only returned " + m.groupCount() - + " groups"); - return "Unavailable"; - } else { - return (new StringBuilder(m.group(1)).append("\n").append( - m.group(2)).append(" ").append(m.group(3)).append("\n") - .append(m.group(4))).toString(); - } - } catch (IOException e) { - Log.e("VNC", "IO Exception when getting kernel version for Device Info screen", e); - - return "Unavailable"; - } - } - - private static String getVersionNumber(Context context) - { - String version = "?"; - try - { - PackageInfo packagInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); - version = packagInfo.versionName; - } - catch (PackageManager.NameNotFoundException e){}; - - return version; - } -} - diff --git a/src/org/onaips/vnc_donate/MainActivity.java b/src/org/onaips/vnc_donate/MainActivity.java deleted file mode 100644 index d6accc0..0000000 --- a/src/org/onaips/vnc_donate/MainActivity.java +++ /dev/null @@ -1,711 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onaips.vnc_donate; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.util.List; -import java.util.Timer; -import java.util.TimerTask; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - - -import android.app.Activity; -import android.app.AlertDialog; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.content.pm.PackageManager.NameNotFoundException; -import android.graphics.Color; -import android.net.DhcpInfo; -import android.net.Uri; -import android.net.wifi.WifiInfo; -import android.net.wifi.WifiManager; -import android.os.Build; -import android.os.Bundle; -import android.preference.PreferenceManager; -import android.text.Html; -import android.util.Log; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.TextView; -import android.widget.Toast; - -public class MainActivity extends Activity -{ - private static final int MENU_QUIT = 0; - private static final int MENU_HELP = 1; - private static final int MENU_ONAIPS = 2; - private static final int MENU_SENDLOG = 3; - private boolean started=false; - private static final String changelog="-New icon
Courtesy of Sandro Forbice (@sandroforbice)
- [Fix] Double buffering now supported
- [Add] Low CPU on idle screen while connected
- [Fix] Update while rotated"; - - - SharedPreferences preferences; - ProgressDialog dialog=null; - AlertDialog startDialog; - - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) - { - super.onCreate(savedInstanceState); - - setContentView(R.layout.main); - - - // Initialize preferences - preferences = PreferenceManager.getDefaultSharedPreferences(this); - - if (!started) - { - if (!hasRootPermission()) - { - Log.v("VNC","You don't have root permissions...!!!"); - showTextOnScreen("You don't have root permissions...Please ROOT your phone first!!!"); - //System.exit(-1); - } - - showInitialScreen(); - createBinary(); - } - - boolean serverRunning=isAndroidServerRunning(); - - setStateLabel(serverRunning); - TextView t=(TextView)findViewById(R.id.TextView01); - - if (serverRunning) - t.setText("Connect to:\n" + getIpAddress()+":5901" + "\nor\nhttp://" + getIpAddress() + ":5801"); - else - t.setText(""); - - - findViewById(R.id.Button01).setOnClickListener(new OnClickListener() { - @Override - public void onClick(View arg0) { - Thread t=new Thread(){ - public void run() - { - startServerButtonClicked(); - - } - }; - t.start(); - - try { - Thread.sleep(1000); - for (int i=0;i<5;i++) - { - - if (!isAndroidServerRunning()) - Thread.sleep(1000); - else - break; - } - } catch (InterruptedException e) { - // TODO Auto-generated catch block - Log.v("VNC","Button01_click:"+ e.getMessage()); - } - - boolean s=isAndroidServerRunning(); - if (!s) - showTextOnScreen("Couldn't start VNC Server"); - //setStateLabel(s); - return; - } - }) ; - findViewById(R.id.Button02).setOnClickListener(new OnClickListener() { - @Override - public void onClick(View arg0) { - - Thread t=new Thread(){ - public void run() - { - stopServer(); - - } - }; - t.start(); - - try { - Thread.sleep(1000); - - - for (int i=0;i<5;i++) - { - if (isAndroidServerRunning()) - Thread.sleep(1000); - else - break; - } - } catch (InterruptedException e) { - Log.v("VNC","Button02_click:"+ e.getMessage()); - - } - boolean s=isAndroidServerRunning(); - if (s) - showTextOnScreen("Couldn't Stop VNC Server\nTry hitting F12 on a connected client"); - //setStateLabel(s); - return; - } - }); - - started=true; - } - - public String packageVersion() - { - String version = ""; - try { - PackageInfo pi = getPackageManager().getPackageInfo(getPackageName(), 0); - version = pi.versionName; - } catch (NameNotFoundException e) { - // TODO Auto-generated catch block - Log.v("VNC","onOptionsItemSelected: "+ e.getMessage()); - }; - return version; - } - - public boolean free_version() - { - return getPackageName().equals("org.onaips.vnc"); - } - - public void showInitialScreen() - { - // Initialize preferences - preferences = PreferenceManager.getDefaultSharedPreferences(this ); - SharedPreferences.Editor editor = preferences.edit(); - - String message="Changelog:

" + changelog; - - String version=packageVersion(); - - if (!free_version()) - { - if (version.equals(preferences.getString("version", ""))) - return; - editor.putString("version", version); - editor.commit(); - } - - - startDialog = new AlertDialog.Builder(this).create(); - startDialog.setTitle("droid VNC Server " + version); - startDialog.setMessage(Html.fromHtml(message)); - startDialog.setIcon(R.drawable.icon); - - if (free_version()) - { - startDialog.setButton(AlertDialog.BUTTON1,"Wait...", new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface arg0, int arg1) { - startDialog.dismiss(); - } - }); - - - - startDialog.setButton2("Donate Version", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=org.onaips.vnc_donate")); - startActivity(myIntent); - - } - }); - - startDialog.setCancelable(false); - startDialog.show(); - - Button b=(Button)startDialog.getButton(AlertDialog.BUTTON1); - b.setEnabled(false); - - Timer t1=new Timer(); - t1.schedule(new TimerTask() { - @Override - public void run() { - runOnUiThread(new Runnable(){ - public void run() { - // ((DialogInterface) startDialog).dismiss(); - Button b=(Button)startDialog.getButton(AlertDialog.BUTTON1); - b.setEnabled(true); - b.setText("OK"); - } - }); - } - }, (long)10000); - } - else - startDialog.show(); - } - - static void writeCommand(OutputStream os, String command) throws Exception - { - os.write((command + "\n").getBytes("ASCII")); - } - - - - public void showTextOnScreen(final String t) - { - runOnUiThread(new Runnable(){ - public void run() { - Toast.makeText(MainActivity.this,t,Toast.LENGTH_LONG).show(); - } - }); - } - - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.menu, menu); - - menu.add(0,MENU_SENDLOG,0,"Send debug info"); - menu.add(0,MENU_ONAIPS,0,"About"); - menu.add(0, MENU_HELP, 0, "Help"); - menu.add(0, MENU_QUIT, 0, "Close"); - - return true; - } - - public void setStateLabel(boolean state) - { - TextView stateLabel=(TextView)findViewById(R.id.stateLabel); - stateLabel.setText(state?"Running":"Stopped"); - stateLabel.setTextColor(state?Color.GREEN:Color.RED); - } - - public String getIpAddress() - { - WifiManager wifiManager = (WifiManager) getSystemService(WIFI_SERVICE); - DhcpInfo dhcpInfo = wifiManager.getDhcpInfo(); - - - return intToIp(dhcpInfo.ipAddress); - } - - boolean wifiConnected() - { - WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); - WifiInfo info = wifi.getConnectionInfo(); - - return info.getBSSID()!=null; - } - - private String intToIp(int i) { - return ( i & 0xFF) + "." + ((i >> 8 ) & 0xFF) + "." + ((i >> 16 ) & 0xFF) + "." + ((i >> 24 ) & 0xFF); - } - - public void stopServer() - { - try{ - Process sh; - - sh = Runtime.getRuntime().exec("su"); - OutputStream os = sh.getOutputStream(); - writeCommand(os, "killall androidvncserver"); - writeCommand(os, "killall -KILL androidvncserver"); - writeCommand(os, "exit"); - - os.flush(); - os.close(); - } catch (IOException e) { - showTextOnScreen("stopServer()" + e.getMessage()); - Log.v("VNC","stopServer()" + e.getMessage()); - } catch (Exception e) { - Log.v("VNC","stopServer()" + e.getMessage()); - } - - } - - public void startServerButtonClicked() - { - if (isAndroidServerRunning()) - { - new AlertDialog.Builder(this) - .setTitle("Alert") - .setMessage(Html.fromHtml("There is another daemon already running, do you want to kill it?")) - .setPositiveButton("Yes", new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface arg0, int arg1) { - stopServer(); - startServer(); - } - }) - .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - return; - } - }) - .show(); - } - else - startServer(); - } - - - public void startServer() - { - try{ - Process sh; - - String password=preferences.getString("password", ""); - String password_check=""; - - String rotation=preferences.getString("rotation", "0"); - if (!password.equals("")) - password_check="-p " + password; - - rotation="-r " + rotation; - - sh = Runtime.getRuntime().exec("su"); - OutputStream os = sh.getOutputStream(); - writeCommand(os, "chmod 777 /data/data/"+getPackageName()+"/androidvncserver"); - writeCommand(os, "/data/data/"+getPackageName()+"/androidvncserver "+ password_check + " " + rotation); - - - } catch (IOException e) { - Log.v("VNC","startServer():" + e.getMessage()); - showTextOnScreen("startServer():" + e.getMessage()); - } catch (Exception e) { - Log.v("VNC","startServer():" + e.getMessage()); - showTextOnScreen("startServer():" + e.getMessage()); - } - - } - - - - public void copyBinary(int id,String path) - { - try { - InputStream ins = getResources().openRawResource(id); - int size = ins.available(); - - // Read the entire resource into a local byte buffer. - byte[] buffer = new byte[size]; - ins.read(buffer); - ins.close(); - - FileOutputStream fos = new FileOutputStream(path); - fos.write(buffer); - fos.close(); - } - catch (Exception e) - { - Log.v("VNC","public void createBinary(): " + e.getMessage()); - } - - - } - public void createBinary() - { - copyBinary(R.raw.androidvncserver, "/data/data/" + getPackageName() + "/androidvncserver"); - copyBinary(R.raw.vncviewer, "/data/data/"+getPackageName()+"/VncViewer.jar"); - copyBinary(R.raw.indexvnc, "/data/data/"+getPackageName()+"/index.vnc"); - } - - public void showHelp() - { - new AlertDialog.Builder(this) - .setTitle("Help") - .setMessage(Html.fromHtml("Mouse Mappings:

Right Click -> Back
Middle Click -> End Call
Left Click -> Touch

Keyboard Mappings

" + - "Home Key -> Home
Escape -> Back
Page Up ->Menu
Left Ctrl -> Search
PgDown -> Start Call
" + - "End Key -> End Call
F4 -> Rotate
F11 -> Disconnect Server
F12 -> Stop Server Daemon")) - .setPositiveButton("Fechar", null) - .setNegativeButton("Open Website", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://onaips.blogspot.com")); - startActivity(myIntent); - } - }) - .show(); - } - - // This method is called once the menu is selected - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - // We have only one menu option - case R.id.preferences: - // Launch Preference activity - Intent i = new Intent(MainActivity.this, preferences.class); - startActivity(i); - - showTextOnScreen("Don't forget to stop/start the server after changes"); - - break; - case MENU_QUIT: - System.exit(1); - break; - case MENU_HELP: - showHelp(); - break; - case MENU_SENDLOG: - collectAndSendLog(); - break; - case MENU_ONAIPS: - - new AlertDialog.Builder(this) - .setTitle("About") - .setMessage(Html.fromHtml("version " + packageVersion() + "

developed by oNaiPs

Graphics: Sandro Forbice (@sandroforbice)

Open-Source Software")) - .setPositiveButton("Close", null) - .setNegativeButton("Open Website", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface arg0, int arg1) { - Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://onaips.blogspot.com")); - startActivity(myIntent); - - } - }) - .show(); - } - return true; - } - - public boolean isAndroidServerRunning() - { - String result=""; - Process sh; - try { - sh = Runtime.getRuntime().exec("ps"); - - - InputStream is=sh.getInputStream(); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - String line; - - while ((line = br.readLine()) != null) { - result+=line; - if (result.indexOf("androidvncserver")>0) - return true; - } - OutputStream os = sh.getOutputStream(); - writeCommand(os, "exit"); - os.flush(); - os.close(); - } catch (IOException e) { - Log.v("VNC"," isAndroidServerRunning():" + e.getMessage()); - } catch (Exception e) { - Log.v("VNC"," isAndroidServerRunning():" + e.getMessage()); - } - - //Log.v("VNC",result); - - return false; - } - - - public boolean hasRootPermission() { - boolean rooted = true; - try { - File su = new File("/system/bin/su"); - if (su.exists() == false) { - su = new File("/system/xbin/su"); - if (su.exists() == false) { - rooted = false; - } - } - } catch (Exception e) { - Log.v("VNC", "Can't obtain root - Here is what I know: "+e.getMessage()); - rooted = false; - } - Process sh; - try { - String result=""; - - sh = Runtime.getRuntime().exec("whoami"); - - InputStream is=sh.getInputStream(); - InputStreamReader isr = new InputStreamReader(is); - BufferedReader br = new BufferedReader(isr); - String line; - - while ((line = br.readLine()) != null) { - result+=line; - if (result.indexOf("androidvncserver")>0) - return true; - } - - Process sh1=Runtime.getRuntime().exec("su"); - - //Log.v("aaaaaa","chgrp -R " + result + " /data/data/org.onaips.vnc/"); - - OutputStream os = sh1.getOutputStream(); - - writeCommand(os, "chown -R " + result + " /data/data/" + getPackageName() + "/"); - writeCommand(os, "chgrp -R " + result + " /data/data/" + getPackageName() + "/"); - os.flush(); - os.close(); - isr.close(); - is.close(); - - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - }catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return rooted; - } - - public static final String LOG_COLLECTOR_PACKAGE_NAME = "com.xtralogic.android.logcollector";//$NON-NLS-1$ - public static final String ACTION_SEND_LOG = "com.xtralogic.logcollector.intent.action.SEND_LOG";//$NON-NLS-1$ - public static final String EXTRA_SEND_INTENT_ACTION = "com.xtralogic.logcollector.intent.extra.SEND_INTENT_ACTION";//$NON-NLS-1$ - public static final String EXTRA_DATA = "com.xtralogic.logcollector.intent.extra.DATA";//$NON-NLS-1$ - public static final String EXTRA_ADDITIONAL_INFO = "com.xtralogic.logcollector.intent.extra.ADDITIONAL_INFO";//$NON-NLS-1$ - public static final String EXTRA_SHOW_UI = "com.xtralogic.logcollector.intent.extra.SHOW_UI";//$NON-NLS-1$ - public static final String EXTRA_FILTER_SPECS = "com.xtralogic.logcollector.intent.extra.FILTER_SPECS";//$NON-NLS-1$ - public static final String EXTRA_FORMAT = "com.xtralogic.logcollector.intent.extra.FORMAT";//$NON-NLS-1$ - public static final String EXTRA_BUFFER = "com.xtralogic.logcollector.intent.extra.BUFFER";//$NON-NLS-1$ - - void collectAndSendLog(){ - final PackageManager packageManager = getPackageManager(); - final Intent intent = new Intent(ACTION_SEND_LOG); - List list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); - final boolean isInstalled = list.size() > 0; - - if (!isInstalled){ - new AlertDialog.Builder(this) - .setTitle(getString(R.string.app_name)) - .setIcon(android.R.drawable.ic_dialog_info) - .setMessage("Please install Log Collector application to collect the device log and send it to dev.") - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){ - public void onClick(DialogInterface dialog, int whichButton){ - Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + LOG_COLLECTOR_PACKAGE_NAME)); - marketIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(marketIntent); - } - }) - .setNegativeButton(android.R.string.cancel, null) - .show(); - } - else{ - new AlertDialog.Builder(this) - .setTitle(getString(R.string.app_name)) - .setIcon(android.R.drawable.ic_dialog_info) - .setMessage("Do you want to send debug info to the dev? Please specify what problem is ocurring.\n\nMake sure you started/stopped the server before submitting") - .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){ - public void onClick(DialogInterface dialog, int whichButton){ - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - intent.putExtra(EXTRA_SEND_INTENT_ACTION, Intent.ACTION_SENDTO); - final String email = "onaips@gmail.com"; - intent.putExtra(EXTRA_DATA, Uri.parse("mailto:" + email)); - intent.putExtra(EXTRA_ADDITIONAL_INFO,"Problem Description: \n\n\n\n---------DEBUG--------\n" + getString(R.string.device_info_fmt,getVersionNumber(getApplicationContext()),Build.MODEL,Build.VERSION.RELEASE, getFormattedKernelVersion(), Build.DISPLAY)); - - intent.putExtra(Intent.EXTRA_SUBJECT, "droid VNC server: Debug Info"); - - intent.putExtra(EXTRA_FORMAT, "time"); - - //The log can be filtered to contain data relevant only to your app - String[] filterSpecs = new String[4]; - filterSpecs[0] = "VNC:I"; - filterSpecs[1] = "VNC:D"; - filterSpecs[2] = "VNC:V"; - filterSpecs[3] = "*:S"; - intent.putExtra(EXTRA_FILTER_SPECS, filterSpecs); - - startActivity(intent); - } - }) - .setNegativeButton(android.R.string.cancel, null) - .show(); - } - } - - private String getFormattedKernelVersion() - { - String procVersionStr; - - try { - BufferedReader reader = new BufferedReader(new FileReader("/proc/version"), 256); - try { - procVersionStr = reader.readLine(); - } finally { - reader.close(); - } - - final String PROC_VERSION_REGEX = - "\\w+\\s+" + /* ignore: Linux */ - "\\w+\\s+" + /* ignore: version */ - "([^\\s]+)\\s+" + /* group 1: 2.6.22-omap1 */ - "\\(([^\\s@]+(?:@[^\\s.]+)?)[^)]*\\)\\s+" + /* group 2: (xxxxxx@xxxxx.constant) */ - "\\([^)]+\\)\\s+" + /* ignore: (gcc ..) */ - "([^\\s]+)\\s+" + /* group 3: #26 */ - "(?:PREEMPT\\s+)?" + /* ignore: PREEMPT (optional) */ - "(.+)"; /* group 4: date */ - - Pattern p = Pattern.compile(PROC_VERSION_REGEX); - Matcher m = p.matcher(procVersionStr); - - if (!m.matches()) { - Log.e("VNC", "Regex did not match on /proc/version: " + procVersionStr); - return "Unavailable"; - } else if (m.groupCount() < 4) { - Log.e("VNC", "Regex match on /proc/version only returned " + m.groupCount() - + " groups"); - return "Unavailable"; - } else { - return (new StringBuilder(m.group(1)).append("\n").append( - m.group(2)).append(" ").append(m.group(3)).append("\n") - .append(m.group(4))).toString(); - } - } catch (IOException e) { - Log.e("VNC", "IO Exception when getting kernel version for Device Info screen", e); - - return "Unavailable"; - } - } - - private static String getVersionNumber(Context context) - { - String version = "?"; - try - { - PackageInfo packagInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); - version = packagInfo.versionName; - } - catch (PackageManager.NameNotFoundException e){}; - - return version; - } -} - diff --git a/src/org/onaips/vnc_donate/preferences.java b/src/org/onaips/vnc_donate/preferences.java deleted file mode 100644 index da99b0c..0000000 --- a/src/org/onaips/vnc_donate/preferences.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.onaips.vnc_donate; - - - - -import android.os.Bundle; -import android.preference.PreferenceActivity; - -public class preferences extends PreferenceActivity { - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - addPreferencesFromResource(R.xml.preferences); - } -}