diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 664113d..cb470f8 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,6 +1,6 @@ + android:versionCode="43" android:versionName="0.92 DroidX sliding fixed (must confirm),Seach was not working in Ctrl button,system notification when client connects" package="org.onaips.vnc"> @@ -11,7 +11,7 @@ - + @@ -22,10 +22,10 @@ - + - + @@ -34,6 +34,14 @@ + + + + + + + + diff --git a/bin/avnc.apk b/bin/avnc.apk index 73da014..43be2ab 100644 Binary files a/bin/avnc.apk and b/bin/avnc.apk differ diff --git a/bin/avnc_signed.apk b/bin/avnc_signed.apk index bf2bfd2..dc15bd6 100644 Binary files a/bin/avnc_signed.apk and b/bin/avnc_signed.apk differ diff --git a/bin/avnc_signed_free.apk b/bin/avnc_signed_free.apk deleted file mode 100644 index e86e68f..0000000 Binary files a/bin/avnc_signed_free.apk and /dev/null differ diff --git a/bin/classes.dex b/bin/classes.dex index 20552c9..85956a7 100644 Binary files a/bin/classes.dex and b/bin/classes.dex differ diff --git a/bin/ndk/local/armeabi/androidvncserver b/bin/ndk/local/armeabi/androidvncserver index 3f6393a..f92d537 100755 Binary files a/bin/ndk/local/armeabi/androidvncserver and b/bin/ndk/local/armeabi/androidvncserver differ diff --git a/bin/ndk/local/armeabi/libjpeg.a b/bin/ndk/local/armeabi/libjpeg.a index d5d66a4..fe3eaa2 100644 Binary files a/bin/ndk/local/armeabi/libjpeg.a and b/bin/ndk/local/armeabi/libjpeg.a differ diff --git a/bin/ndk/local/armeabi/objs/androidvncserver/fbvncserver.o b/bin/ndk/local/armeabi/objs/androidvncserver/fbvncserver.o index 1cd332f..8856097 100644 Binary files a/bin/ndk/local/armeabi/objs/androidvncserver/fbvncserver.o and b/bin/ndk/local/armeabi/objs/androidvncserver/fbvncserver.o differ diff --git a/bin/org/onaips/vnc/DaemonCommunication$1.class b/bin/org/onaips/vnc/DaemonCommunication$1.class new file mode 100644 index 0000000..8da6c13 Binary files /dev/null and b/bin/org/onaips/vnc/DaemonCommunication$1.class differ diff --git a/bin/org/onaips/vnc/DaemonCommunication$2.class b/bin/org/onaips/vnc/DaemonCommunication$2.class new file mode 100644 index 0000000..fc7a566 Binary files /dev/null and b/bin/org/onaips/vnc/DaemonCommunication$2.class differ diff --git a/bin/org/onaips/vnc/DaemonCommunication.class b/bin/org/onaips/vnc/DaemonCommunication.class new file mode 100644 index 0000000..d63f4fc Binary files /dev/null and b/bin/org/onaips/vnc/DaemonCommunication.class differ diff --git a/bin/org/onaips/vnc/MainActivity$1.class b/bin/org/onaips/vnc/MainActivity$1.class new file mode 100644 index 0000000..89f2b7a Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$1.class differ diff --git a/bin/org/onaips/vnc/MainActivity$10.class b/bin/org/onaips/vnc/MainActivity$10.class new file mode 100644 index 0000000..3e41a3e Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$10.class differ diff --git a/bin/org/onaips/vnc/MainActivity$11.class b/bin/org/onaips/vnc/MainActivity$11.class new file mode 100644 index 0000000..57f5360 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$11.class differ diff --git a/bin/org/onaips/vnc_donate/MainActivity$11.class b/bin/org/onaips/vnc/MainActivity$12.class similarity index 69% rename from bin/org/onaips/vnc_donate/MainActivity$11.class rename to bin/org/onaips/vnc/MainActivity$12.class index 554922a..df75844 100644 Binary files a/bin/org/onaips/vnc_donate/MainActivity$11.class and b/bin/org/onaips/vnc/MainActivity$12.class differ diff --git a/bin/org/onaips/vnc/MainActivity$2.class b/bin/org/onaips/vnc/MainActivity$2.class new file mode 100644 index 0000000..7f900bf Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$2.class differ diff --git a/bin/org/onaips/vnc/MainActivity$3$1.class b/bin/org/onaips/vnc/MainActivity$3$1.class new file mode 100644 index 0000000..2f01824 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$3$1.class differ diff --git a/bin/org/onaips/vnc/MainActivity$3.class b/bin/org/onaips/vnc/MainActivity$3.class new file mode 100644 index 0000000..caebebf Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$3.class differ diff --git a/bin/org/onaips/vnc/MainActivity$4.class b/bin/org/onaips/vnc/MainActivity$4.class new file mode 100644 index 0000000..abd421b Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$4.class differ diff --git a/bin/org/onaips/vnc/MainActivity$5.class b/bin/org/onaips/vnc/MainActivity$5.class new file mode 100644 index 0000000..1c0f289 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$5.class differ diff --git a/bin/org/onaips/vnc/MainActivity$6.class b/bin/org/onaips/vnc/MainActivity$6.class new file mode 100644 index 0000000..08ab84c Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$6.class differ diff --git a/bin/org/onaips/vnc/MainActivity$7$1.class b/bin/org/onaips/vnc/MainActivity$7$1.class new file mode 100644 index 0000000..0f156e2 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$7$1.class differ diff --git a/bin/org/onaips/vnc/MainActivity$7.class b/bin/org/onaips/vnc/MainActivity$7.class new file mode 100644 index 0000000..e50da55 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$7.class differ diff --git a/bin/org/onaips/vnc/MainActivity$8.class b/bin/org/onaips/vnc/MainActivity$8.class new file mode 100644 index 0000000..31da3e0 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$8.class differ diff --git a/bin/org/onaips/vnc/MainActivity$9.class b/bin/org/onaips/vnc/MainActivity$9.class new file mode 100644 index 0000000..793cbb7 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$9.class differ diff --git a/bin/org/onaips/vnc/MainActivity$mReceiver.class b/bin/org/onaips/vnc/MainActivity$mReceiver.class new file mode 100644 index 0000000..32bbe97 Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity$mReceiver.class differ diff --git a/bin/org/onaips/vnc/MainActivity.class b/bin/org/onaips/vnc/MainActivity.class new file mode 100644 index 0000000..e9622ff Binary files /dev/null and b/bin/org/onaips/vnc/MainActivity.class differ diff --git a/bin/org/onaips/vnc_donate/MainApplication.class b/bin/org/onaips/vnc/MainApplication.class similarity index 92% rename from bin/org/onaips/vnc_donate/MainApplication.class rename to bin/org/onaips/vnc/MainApplication.class index 830dc92..d76f19e 100644 Binary files a/bin/org/onaips/vnc_donate/MainApplication.class and b/bin/org/onaips/vnc/MainApplication.class differ diff --git a/bin/org/onaips/vnc/R$array.class b/bin/org/onaips/vnc/R$array.class new file mode 100644 index 0000000..a53f4c8 Binary files /dev/null and b/bin/org/onaips/vnc/R$array.class differ diff --git a/bin/org/onaips/vnc/R$attr.class b/bin/org/onaips/vnc/R$attr.class new file mode 100644 index 0000000..942efc3 Binary files /dev/null and b/bin/org/onaips/vnc/R$attr.class differ diff --git a/bin/org/onaips/vnc/R$drawable.class b/bin/org/onaips/vnc/R$drawable.class new file mode 100644 index 0000000..11819b0 Binary files /dev/null and b/bin/org/onaips/vnc/R$drawable.class differ diff --git a/bin/org/onaips/vnc/R$id.class b/bin/org/onaips/vnc/R$id.class new file mode 100644 index 0000000..b08ebf8 Binary files /dev/null and b/bin/org/onaips/vnc/R$id.class differ diff --git a/bin/org/onaips/vnc/R$layout.class b/bin/org/onaips/vnc/R$layout.class new file mode 100644 index 0000000..c92703b Binary files /dev/null and b/bin/org/onaips/vnc/R$layout.class differ diff --git a/bin/org/onaips/vnc/R$menu.class b/bin/org/onaips/vnc/R$menu.class new file mode 100644 index 0000000..a0941fe Binary files /dev/null and b/bin/org/onaips/vnc/R$menu.class differ diff --git a/bin/org/onaips/vnc/R$raw.class b/bin/org/onaips/vnc/R$raw.class new file mode 100644 index 0000000..2217189 Binary files /dev/null and b/bin/org/onaips/vnc/R$raw.class differ diff --git a/bin/org/onaips/vnc/R$string.class b/bin/org/onaips/vnc/R$string.class new file mode 100644 index 0000000..bef15d8 Binary files /dev/null and b/bin/org/onaips/vnc/R$string.class differ diff --git a/bin/org/onaips/vnc/R$styleable.class b/bin/org/onaips/vnc/R$styleable.class new file mode 100644 index 0000000..8c0717b Binary files /dev/null and b/bin/org/onaips/vnc/R$styleable.class differ diff --git a/bin/org/onaips/vnc/R$xml.class b/bin/org/onaips/vnc/R$xml.class new file mode 100644 index 0000000..5db20e7 Binary files /dev/null and b/bin/org/onaips/vnc/R$xml.class differ diff --git a/bin/org/onaips/vnc/R.class b/bin/org/onaips/vnc/R.class new file mode 100644 index 0000000..151bceb Binary files /dev/null and b/bin/org/onaips/vnc/R.class differ diff --git a/bin/org/onaips/vnc/StartAtBootService.class b/bin/org/onaips/vnc/StartAtBootService.class new file mode 100644 index 0000000..f4e2f2c Binary files /dev/null and b/bin/org/onaips/vnc/StartAtBootService.class differ diff --git a/bin/org/onaips/vnc/StartAtBootServiceReceiver.class b/bin/org/onaips/vnc/StartAtBootServiceReceiver.class new file mode 100644 index 0000000..241b866 Binary files /dev/null and b/bin/org/onaips/vnc/StartAtBootServiceReceiver.class differ diff --git a/bin/org/onaips/vnc_donate/preferences.class b/bin/org/onaips/vnc/preferences.class similarity index 55% rename from bin/org/onaips/vnc_donate/preferences.class rename to bin/org/onaips/vnc/preferences.class index 0d0cb50..818b744 100644 Binary files a/bin/org/onaips/vnc_donate/preferences.class and b/bin/org/onaips/vnc/preferences.class 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 e8d4d7b..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 01b0818..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$2$1.class b/bin/org/onaips/vnc_donate/MainActivity$2$1.class deleted file mode 100644 index 848ed1d..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 d120152..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 65a2bb4..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 c2268dd..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.class b/bin/org/onaips/vnc_donate/MainActivity$5.class deleted file mode 100644 index a53527f..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$1.class b/bin/org/onaips/vnc_donate/MainActivity$6$1.class deleted file mode 100644 index fba9820..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$6$1.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 0cf442d..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 ce5a7ad..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 a9e662a..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 fe2a877..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$mReceiver.class b/bin/org/onaips/vnc_donate/MainActivity$mReceiver.class deleted file mode 100644 index c709f50..0000000 Binary files a/bin/org/onaips/vnc_donate/MainActivity$mReceiver.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 69ca3cf..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 6d9833c..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 fa53e1d..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 925f46c..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 e79b2f0..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 5bf7a36..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 04e4ea5..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 fd39985..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 879b410..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 480e3bd..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 fccea0f..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/StartAtBootService.class b/bin/org/onaips/vnc_donate/StartAtBootService.class deleted file mode 100644 index 5b97075..0000000 Binary files a/bin/org/onaips/vnc_donate/StartAtBootService.class and /dev/null differ diff --git a/bin/org/onaips/vnc_donate/StartAtBootServiceReceiver.class b/bin/org/onaips/vnc_donate/StartAtBootServiceReceiver.class deleted file mode 100644 index 8f4a1b3..0000000 Binary files a/bin/org/onaips/vnc_donate/StartAtBootServiceReceiver.class and /dev/null differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ index 406038e..afe8298 100644 Binary files a/bin/resources.ap_ and b/bin/resources.ap_ differ diff --git a/gen/org/onaips/vnc_donate/R.java b/gen/org/onaips/vnc/R.java similarity index 93% rename from gen/org/onaips/vnc_donate/R.java rename to gen/org/onaips/vnc/R.java index ec66fad..0f8c5db 100644 --- a/gen/org/onaips/vnc_donate/R.java +++ b/gen/org/onaips/vnc/R.java @@ -5,7 +5,7 @@ * should not be modified by hand. */ -package org.onaips.vnc_donate; +package org.onaips.vnc; public final class R { public static final class array { @@ -78,7 +78,8 @@ containing a value of this type. 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 banner_adview=0x7f090005; + public static final int preferences=0x7f090006; public static final int stateLabel=0x7f090003; } public static final class layout { @@ -107,11 +108,11 @@ containing a value of this type. 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} + {@link #com_admob_android_ads_AdView_backgroundColor org.onaips.vnc:backgroundColor} + {@link #com_admob_android_ads_AdView_keywords org.onaips.vnc:keywords} + {@link #com_admob_android_ads_AdView_primaryTextColor org.onaips.vnc:primaryTextColor} + {@link #com_admob_android_ads_AdView_refreshInterval org.onaips.vnc:refreshInterval} + {@link #com_admob_android_ads_AdView_secondaryTextColor org.onaips.vnc:secondaryTextColor} @see #com_admob_android_ads_AdView_backgroundColor @see #com_admob_android_ads_AdView_keywords @@ -124,7 +125,7 @@ containing a value of this type. 0x7f010004 }; /** -

This symbol is the offset where the {@link org.onaips.vnc_donate.R.attr#backgroundColor} +

This symbol is the offset where the {@link org.onaips.vnc.R.attr#backgroundColor} attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. @@ -139,7 +140,7 @@ containing a value of this type. */ 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} +

This symbol is the offset where the {@link org.onaips.vnc.R.attr#keywords} attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. @@ -153,7 +154,7 @@ containing a value of this type. */ 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} +

This symbol is the offset where the {@link org.onaips.vnc.R.attr#primaryTextColor} attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. @@ -168,7 +169,7 @@ containing a value of this type. */ 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} +

This symbol is the offset where the {@link org.onaips.vnc.R.attr#refreshInterval} attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. @@ -182,7 +183,7 @@ containing a value of this type. */ 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} +

This symbol is the offset where the {@link org.onaips.vnc.R.attr#secondaryTextColor} attribute's value can be found in the {@link #com_admob_android_ads_AdView} array. diff --git a/jni/vnc/Android.mk b/jni/vnc/Android.mk index 6c2f228..28c0500 100755 --- a/jni/vnc/Android.mk +++ b/jni/vnc/Android.mk @@ -1,7 +1,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_CFLAGS += -DDONATE_VERSION LOCAL_CFLAGS += -Wall diff --git a/jni/vnc/Android.mk~ b/jni/vnc/Android.mk~ index 28afae9..6c2f228 100755 --- a/jni/vnc/Android.mk~ +++ b/jni/vnc/Android.mk~ @@ -1,7 +1,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -#LOCAL_CFLAGS += -DDONATE_VERSION +LOCAL_CFLAGS += -DDONATE_VERSION LOCAL_CFLAGS += -Wall diff --git a/jni/vnc/fbvncserver.c b/jni/vnc/fbvncserver.c index a26cdde..4cd481e 100755 --- a/jni/vnc/fbvncserver.c +++ b/jni/vnc/fbvncserver.c @@ -73,7 +73,7 @@ static unsigned int *cmpbuf; static rfbScreenInfoPtr vncscr; -int idle=0,standby=0,change=0; +int idle=0,standby=0,change=0,donate_version=0; static int rotation=0,scaling=0; /*****************************************************************************/ @@ -95,9 +95,8 @@ void update_fb_info() } -#define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i) -// #define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i+scrinfo.xoffset) - +// #define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i) +#define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i+scrinfo.xoffset) #define OUT 32 #include "update_screen.c" #define OUT 8 @@ -112,7 +111,6 @@ inline size_t roundUpToPageSize(size_t x) { static void init_fb(void) { - size_t pixels; size_t bytespp; if ((fbfd = open(framebuffer_device, O_RDWR)) == -1) @@ -130,7 +128,6 @@ static void init_fb(void) exit(EXIT_FAILURE); } - pixels = scrinfo.xres * scrinfo.yres; bytespp = scrinfo.bits_per_pixel /CHAR_BIT; __android_log_print(ANDROID_LOG_INFO,"VNC", "line_lenght=%d xres=%d, yres=%d, xresv=%d, yresv=%d, xoffs=%d, yoffs=%d, bpp=%d\n", @@ -139,9 +136,16 @@ static void init_fb(void) (int)scrinfo.xoffset, (int)scrinfo.yoffset, (int)scrinfo.bits_per_pixel); - printf("AKII\n"); - size_t fbSize = roundUpToPageSize(fscrinfo.line_length * scrinfo.yres_virtual); + + size_t size=scrinfo.yres_virtual; + if (sizeclientGoneHook=clientGone; + return RFB_CLIENT_ACCEPT; } @@ -237,11 +268,12 @@ static void init_fb_server(int argc, char **argv) vncscr->passwordCheck = rfbCheckPasswordByList; } -#ifdef DONATE_VERSION + +if (donate_version) vncscr->httpDir="/data/data/org.onaips.vnc_donate/files/"; -#else +else vncscr->httpDir="/data/data/org.onaips.vnc/files/"; -#endif + vncscr->serverFormat.redShift=scrinfo.red.offset; vncscr->serverFormat.greenShift=scrinfo.green.offset; @@ -292,7 +324,7 @@ static void keyevent(rfbBool down, rfbKeySym key, rfbClientPtr cl) { int code; - __android_log_print(ANDROID_LOG_INFO,"VNC","Got keysym: %04x (down=%d)\n", (unsigned int)key, (int)down); +// __android_log_print(ANDROID_LOG_INFO,"VNC","Got keysym: %04x (down=%d)\n", (unsigned int)key, (int)down); int sh = 0; int alt = 0; @@ -300,7 +332,7 @@ static void keyevent(rfbBool down, rfbKeySym key, rfbClientPtr cl) if ((code = keysym2scancode(down, key, cl,&sh,&alt))) { - int ret; + int ret=0; if (key && down) { @@ -316,7 +348,7 @@ static void keyevent(rfbBool down, rfbKeySym key, rfbClientPtr cl) else ;//ret=suinput_release(inputfd,code); - __android_log_print(ANDROID_LOG_INFO,"VNC","injectKey (%d, %d) ret=%d\n", code , down,ret); +// __android_log_print(ANDROID_LOG_INFO,"VNC","injectKey (%d, %d) ret=%d\n", code , down,ret); } } @@ -396,6 +428,7 @@ static int keysym2scancode(rfbBool down, rfbKeySym c, rfbClientPtr cl, int *sh, case 0xffff: return 158;// del -> back case 0xff55: return 229;// PgUp -> menu case 0xffcf: return 127;// F2 -> search + case 0xffe3: return 127;// left ctrl -> search case 0xff56: return 61;// PgUp -> call case 0xff57: return 107;// End -> endcall case 0xffc2: return 211;// F5 -> focus @@ -705,6 +738,9 @@ int main(int argc, char **argv) i++; VNC_PORT=atoi(argv[i]); break; + case 'd': + donate_version=1; + break; case 'r': i++; r=atoi(argv[i]); @@ -754,7 +790,6 @@ int main(int argc, char **argv) else rfbProcessEvents(vncscr, 10000); - update_screen(); } diff --git a/jni/vnc/fbvncserver.c~ b/jni/vnc/fbvncserver.c~ index 17d3c4f..4cd481e 100755 --- a/jni/vnc/fbvncserver.c~ +++ b/jni/vnc/fbvncserver.c~ @@ -73,7 +73,7 @@ static unsigned int *cmpbuf; static rfbScreenInfoPtr vncscr; -int idle=0,standby=0,change=0; +int idle=0,standby=0,change=0,donate_version=0; static int rotation=0,scaling=0; /*****************************************************************************/ @@ -95,9 +95,8 @@ void update_fb_info() } -#define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i) -// #define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i+scrinfo.xoffset) - +// #define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i) +#define PIXEL_TO_VIRTUALPIXEL(i,j) ((j+scrinfo.yoffset)*scrinfo.xres_virtual+i+scrinfo.xoffset) #define OUT 32 #include "update_screen.c" #define OUT 8 @@ -112,7 +111,6 @@ inline size_t roundUpToPageSize(size_t x) { static void init_fb(void) { - size_t pixels; size_t bytespp; if ((fbfd = open(framebuffer_device, O_RDWR)) == -1) @@ -130,7 +128,6 @@ static void init_fb(void) exit(EXIT_FAILURE); } - pixels = scrinfo.xres * scrinfo.yres; bytespp = scrinfo.bits_per_pixel /CHAR_BIT; __android_log_print(ANDROID_LOG_INFO,"VNC", "line_lenght=%d xres=%d, yres=%d, xresv=%d, yresv=%d, xoffs=%d, yoffs=%d, bpp=%d\n", @@ -139,9 +136,16 @@ static void init_fb(void) (int)scrinfo.xoffset, (int)scrinfo.yoffset, (int)scrinfo.bits_per_pixel); - printf("AKII\n"); - size_t fbSize = roundUpToPageSize(fscrinfo.line_length * scrinfo.yres_virtual); + + size_t size=scrinfo.yres_virtual; + if (sizeclientGoneHook=clientGone; + return RFB_CLIENT_ACCEPT; } @@ -237,11 +268,13 @@ static void init_fb_server(int argc, char **argv) vncscr->passwordCheck = rfbCheckPasswordByList; } -#ifdef DONATE_VERSION + +if (donate_version) vncscr->httpDir="/data/data/org.onaips.vnc_donate/files/"; -#else +else vncscr->httpDir="/data/data/org.onaips.vnc/files/"; -#endif + + vncscr->serverFormat.redShift=scrinfo.red.offset; vncscr->serverFormat.greenShift=scrinfo.green.offset; vncscr->serverFormat.blueShift=scrinfo.blue.offset; @@ -291,7 +324,7 @@ static void keyevent(rfbBool down, rfbKeySym key, rfbClientPtr cl) { int code; - __android_log_print(ANDROID_LOG_INFO,"VNC","Got keysym: %04x (down=%d)\n", (unsigned int)key, (int)down); +// __android_log_print(ANDROID_LOG_INFO,"VNC","Got keysym: %04x (down=%d)\n", (unsigned int)key, (int)down); int sh = 0; int alt = 0; @@ -299,7 +332,7 @@ static void keyevent(rfbBool down, rfbKeySym key, rfbClientPtr cl) if ((code = keysym2scancode(down, key, cl,&sh,&alt))) { - int ret; + int ret=0; if (key && down) { @@ -315,7 +348,7 @@ static void keyevent(rfbBool down, rfbKeySym key, rfbClientPtr cl) else ;//ret=suinput_release(inputfd,code); - __android_log_print(ANDROID_LOG_INFO,"VNC","injectKey (%d, %d) ret=%d\n", code , down,ret); +// __android_log_print(ANDROID_LOG_INFO,"VNC","injectKey (%d, %d) ret=%d\n", code , down,ret); } } @@ -395,6 +428,7 @@ static int keysym2scancode(rfbBool down, rfbKeySym c, rfbClientPtr cl, int *sh, case 0xffff: return 158;// del -> back case 0xff55: return 229;// PgUp -> menu case 0xffcf: return 127;// F2 -> search + case 0xffe3: return 127;// left ctrl -> search case 0xff56: return 61;// PgUp -> call case 0xff57: return 107;// End -> endcall case 0xffc2: return 211;// F5 -> focus @@ -704,6 +738,9 @@ int main(int argc, char **argv) i++; VNC_PORT=atoi(argv[i]); break; + case 'd': + donate_version=1; + break; case 'r': i++; r=atoi(argv[i]); @@ -753,7 +790,6 @@ int main(int argc, char **argv) else rfbProcessEvents(vncscr, 10000); - update_screen(); } diff --git a/jni/vnc/suinput.c~ b/jni/vnc/suinput.c~ deleted file mode 100644 index 364a551..0000000 --- a/jni/vnc/suinput.c~ +++ /dev/null @@ -1,225 +0,0 @@ -/* -suinput - Simple C-API to the Linux uinput-system. -Copyright (C) 2009 Tuomas Räsänen - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 3 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include -#include -#include -#include -#include -#include -#include "suinput.h" - -char* UINPUT_FILEPATHS[] = { - "/android/dev/uinput", - "/dev/uinput", - "/dev/input/uinput", - "/dev/misc/uinput", -}; -#define UINPUT_FILEPATHS_COUNT (sizeof(UINPUT_FILEPATHS) / sizeof(char*)) - -int suinput_write(int uinput_fd, - uint16_t type, uint16_t code, int32_t value) -{ - struct input_event event; - memset(&event, 0, sizeof(event)); - gettimeofday(&event.time, 0); /* This should not be able to fail ever.. */ - event.type = type; - event.code = code; - event.value = value; - if (write(uinput_fd, &event, sizeof(event)) != sizeof(event)) - return -1; - return 0; -} - -int suinput_write_syn(int uinput_fd, - uint16_t type, uint16_t code, int32_t value) -{ - if (suinput_write(uinput_fd, type, code, value)) - return -1; - return suinput_write(uinput_fd, EV_SYN, SYN_REPORT, 0); -} - -int suinput_open(const char* device_name, const struct input_id* id) -{ - int original_errno = 0; - int uinput_fd = -1; - struct uinput_user_dev user_dev; - int i; - - for (i = 0; i < UINPUT_FILEPATHS_COUNT; ++i) { - uinput_fd = open(UINPUT_FILEPATHS[i], O_WRONLY | O_NONBLOCK); - if (uinput_fd != -1) - break; - } - - if (uinput_fd == -1) - return -1; - - - - /* Set device to handle following types of events: */ - - /* Key and button events */ - if (ioctl(uinput_fd, UI_SET_EVBIT, EV_KEY) == -1) - goto err; -// -// /* Key and button repetition events */ - if (ioctl(uinput_fd, UI_SET_EVBIT, EV_REP) == -1) - goto err; -// -// /* Relative pointer motions */ -// if (ioctl(uinput_fd, UI_SET_EVBIT, EV_REL) == -1) -// goto err; - - /* Absolute pointer motions */ - - if (ioctl(uinput_fd, UI_SET_EVBIT, EV_ABS) == -1) - goto err; - - /* Synchronization events, this is probably set implicitely too. */ - if (ioctl(uinput_fd, UI_SET_EVBIT, EV_SYN) == -1) - goto err; - - - - /* Configure device to handle relative x and y axis. */ -// if (ioctl(uinput_fd, UI_SET_RELBIT, REL_X) == -1) -// goto err; -// if (ioctl(uinput_fd, UI_SET_RELBIT, REL_Y) == -1) -// goto err; - - /* Configure device to handle absolute x and y axis. */ - if (ioctl(uinput_fd, UI_SET_ABSBIT, ABS_X) == -1) - goto err; - if (ioctl(uinput_fd, UI_SET_ABSBIT, ABS_Y) == -1) - goto err; - - - - /* Configure device to handle all keys, see linux/input.h. */ - for (i = 0; i < KEY_MAX; i++) { - if (ioctl(uinput_fd, UI_SET_KEYBIT, i) == -1) - goto err; - } - - /* Set device-specific information. */ - memset(&user_dev, 0, sizeof(user_dev)); - strncpy(user_dev.name, device_name, UINPUT_MAX_NAME_SIZE); - user_dev.id.bustype = id->bustype; - user_dev.id.vendor = id->vendor; - user_dev.id.product = id->product; - user_dev.id.version = id->version; - - //minor tweak to support ABSolute events - user_dev.absmin[ABS_X] = -2047; - user_dev.absmax[ABS_X] = 2048; - user_dev.absfuzz[ABS_X] = 0; - user_dev.absflat[ABS_X] = 0; - - user_dev.absmin[ABS_Y] = -2047; - user_dev.absmax[ABS_Y] = 2048; - user_dev.absfuzz[ABS_Y] = 0; - user_dev.absflat[ABS_Y] = 0; - - if (write(uinput_fd, &user_dev, sizeof(user_dev)) != sizeof(user_dev)) - goto err; - - - if (ioctl(uinput_fd, UI_DEV_CREATE) == -1) - goto err; - - /* - The reason for generating a small delay is that creating succesfully - an uinput device does not guarantee that the device is ready to process - input events. It's probably due the asynchronous nature of the udev. - However, my experiments show that the device is not ready to process input - events even after a device creation event is received from udev. - */ - - //sleep(2); - - return uinput_fd; - - err: - - /* - At this point, errno is set for some reason. However, cleanup-actions - can also fail and reset errno, therefore we store the original one - and reset it before returning. - */ - original_errno = errno; - - /* Cleanup. */ - close(uinput_fd); /* Might fail, but we don't care anymore at this point. */ - - errno = original_errno; - return -1; -} - -int suinput_close(int uinput_fd) -{ - /* - Sleep before destroying the device because there still can be some - unprocessed events. This is not the right way, but I am still - looking for better ways. The question is: how to know whether there - are any unprocessed uinput events? - */ - sleep(2); - - if (ioctl(uinput_fd, UI_DEV_DESTROY) == -1) { - close(uinput_fd); - return -1; - } - - if (close(uinput_fd) == -1) - return -1; - - return 0; -} - -int suinput_move_pointer(int uinput_fd, int32_t x, int32_t y) -{ - if (suinput_write(uinput_fd, EV_REL, REL_X, x)) - return -1; - return suinput_write_syn(uinput_fd, EV_REL, REL_Y, y); -} - -int suinput_set_pointer(int uinput_fd, int32_t x, int32_t y) -{ - if (suinput_write(uinput_fd, EV_ABS, ABS_X, x)) - return -1; - return suinput_write_syn(uinput_fd, EV_ABS, ABS_Y, y); -} - -int suinput_press(int uinput_fd, uint16_t code) -{ - return suinput_write_syn(uinput_fd, EV_KEY, code, 1); -} - -int suinput_release(int uinput_fd, uint16_t code) -{ - return suinput_write_syn(uinput_fd, EV_KEY, code, 0); -} - -int suinput_click(int uinput_fd, uint16_t code) -{ - if (suinput_press(uinput_fd, code)) - return -1; - return suinput_release(uinput_fd, code); -} diff --git a/jni/vnc/update_screen.c~ b/jni/vnc/update_screen.c~ deleted file mode 100644 index e791324..0000000 --- a/jni/vnc/update_screen.c~ +++ /dev/null @@ -1,165 +0,0 @@ -#define OUT_T CONCAT3E(uint,OUT,_t) -#define FUNCTION CONCAT2E(update_screen_,OUT) - - - - -void FUNCTION(void) -{ - static int i,j; - - update_fb_info(); - -// // detect active buffer -// offset= (scrinfo.xoffset) * (scrinfo.bits_per_pixel/8) + -// (scrinfo.yoffset) * scrinfo.xres; -// if (scrinfo.yoffset) -// offset=scrinfo.xres*scrinfo.yoffset; -// else -// offset=0; -// offset = scrinfo.xres * scrinfo.yoffset + scrinfo.xoffset * scrinfo.bits_per_pixel / CHAR_BIT; - - - OUT_T* a = (OUT_T*)cmpbuf; - OUT_T* b = (OUT_T*)fbmmap; - - int max_x=-1,max_y=-1, min_x=9999, min_y=9999; - idle=1; - - if (rotation==0) - { - //memcpy(vncbuf,fbmmap,vncscr->width*vncscr->height*scrinfo.bits_per_pixel/CHAR_BIT); - for (j = 0; j < scrinfo.yres; j++) - { - for (i = 0; i < scrinfo.xres; i++) - { - if (a[i + j * scrinfo.xres]!=b[PIXEL_TO_VIRTUALPIXEL(i,j)]) - { - a[i + j * scrinfo.xres]=b[PIXEL_TO_VIRTUALPIXEL(i,j)]; - - if (i>max_x) - max_x=i; - if (imax_y) - max_y=j; - if (jmax_y) - max_y=i; - if (i max_x) - max_x=scrinfo.yres-j; - - if (idle) - idle=0; - } - } - } - } - else if (rotation==180) - { - for (j = 0; j < scrinfo.yres; j++) - { - for (i = 0; i < scrinfo.xres; i++) - { - if (a[((scrinfo.xres - 1 - i) + (scrinfo.yres - 1 - j) * scrinfo.xres)]!=b[PIXEL_TO_VIRTUALPIXEL(i,j)]) - { - a[((scrinfo.xres - 1 - i) + (scrinfo.yres - 1 - j) * scrinfo.xres)]=b[PIXEL_TO_VIRTUALPIXEL(i,j)]; - - - if (i>max_x) - max_x=i; - if (i max_y) - max_y=scrinfo.yres-j; - - if (idle) - idle=0; - } - } - } - } - else if (rotation==270) - { - for (j = 0; j < scrinfo.yres; j++) - { - - for (i = 0; i < scrinfo.xres; i++) - { - if(a[j + (scrinfo.xres - 1 - i) * scrinfo.yres] != b[PIXEL_TO_VIRTUALPIXEL(i,j)]) - { - a[j + (scrinfo.xres - 1 - i) * scrinfo.yres] = b[PIXEL_TO_VIRTUALPIXEL(i,j)]; - - if (i>max_y) - max_y=i; - if (i max_x) - max_x=j; - - if (idle) - idle=0; - } - } - } - -} - -memcpy(vncbuf,a,vncscr->width*vncscr->height*scrinfo.bits_per_pixel/CHAR_BIT); - - if (min_x!=9999 && min_y!=9999 && max_x!=-1 && max_y!=-1) - { - max_x++; - max_y++; - - rfbMarkRectAsModified(vncscr, min_x, min_y, max_x, max_y); - rfbProcessEvents(vncscr, 100000); - } - - if (idle) - { - standby=standby+1; -//__android_log_print(ANDROID_LOG_INFO,"VNC","standby %d xoff=%d yoff=%d offset=%d\n",standby,scrinfo.xoffset,scrinfo.yoffset,PIXEL_TO_VIRTUALPIXEL(i,j)); - change=0; - } - else - { - change=change+1; - standby=0; -// __android_log_print(ANDROID_LOG_INFO,"VNC","change %d\tmin_x=%d max_x=%d min_y=%d max_y=%d xoff=%d yoff=%d offset=%d\n",change,min_x,max_x,min_y,max_y,scrinfo.xoffset,scrinfo.yoffset,PIXEL_TO_VIRTUALPIXEL(i,j)); - } -} diff --git a/libs/armeabi/androidvncserver b/libs/armeabi/androidvncserver index 754ab5a..03fd8d2 100755 Binary files a/libs/armeabi/androidvncserver and b/libs/armeabi/androidvncserver differ diff --git a/res/layout/main.xml b/res/layout/main.xml index 1746d5f..f9bc791 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -57,7 +57,6 @@ - +/> diff --git a/res/raw/androidvncserver b/res/raw/androidvncserver index 754ab5a..03fd8d2 100755 Binary files a/res/raw/androidvncserver and b/res/raw/androidvncserver differ diff --git a/res/values/strings.xml b/res/values/strings.xml index 98cb73b..78f3f71 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -39,11 +39,11 @@ On Off - + droid VNC version: %s\n Device model: %s\n Firmware version: %s\n Kernel version: %s\n Build number: %s\n - + diff --git a/src/org/onaips/vnc/DaemonCommunication.java b/src/org/onaips/vnc/DaemonCommunication.java new file mode 100644 index 0000000..bcbc289 --- /dev/null +++ b/src/org/onaips/vnc/DaemonCommunication.java @@ -0,0 +1,55 @@ +package org.onaips.vnc; + +import android.app.Activity; +import android.app.NotificationManager; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentSender.SendIntentException; +import android.util.Log; + +public class DaemonCommunication extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + + Log.v("VNC","daemoncom" + action); + + if (action.equalsIgnoreCase("org.onaips.vnc.intent.action.DaemonCommunication.ClientConnected")) + { + // String ns = Context.NOTIFICATION_SERVICE; + //NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); + Log.v("VNC","daemoncom"); + Intent i = new Intent("org.onaips.vnc.CLIENTCONNECTED"); + context.sendOrderedBroadcast(i, null, new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + int result = getResultCode(); + if (result != Activity.RESULT_CANCELED) { + Log.d("VNC", "Activity caught the broadcast, result "+result); + return; // Activity caught it + } + Log.d("VNC", "Activity did not catch the broadcast"); + } + }, null, Activity.RESULT_CANCELED, null, null); } + else if (action.equalsIgnoreCase("org.onaips.vnc.intent.action.DaemonCommunication.ClientDisconnected")) + { + Log.v("VNC","daemoncom"); + Intent i = new Intent("org.onaips.vnc.CLIENTDISCONNECTED"); + context.sendOrderedBroadcast(i, null, new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + int result = getResultCode(); + if (result != Activity.RESULT_CANCELED) { + Log.d("VNC", "Activity caught the broadcast, result "+result); + return; // Activity caught it + } + Log.d("VNC", "Activity did not catch the broadcast"); + } + }, null, Activity.RESULT_CANCELED, null, null); + } + } +} + + diff --git a/src/org/onaips/vnc_donate/MainActivity.java b/src/org/onaips/vnc/MainActivity.java similarity index 89% rename from src/org/onaips/vnc_donate/MainActivity.java rename to src/org/onaips/vnc/MainActivity.java index ba02b8a..6f0034e 100644 --- a/src/org/onaips/vnc_donate/MainActivity.java +++ b/src/org/onaips/vnc/MainActivity.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.onaips.vnc_donate; +package org.onaips.vnc; import java.io.BufferedReader; import java.io.File; @@ -37,6 +37,9 @@ import java.util.regex.Pattern; import android.app.Activity; import android.app.AlertDialog; +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; import android.app.ProgressDialog; import android.content.BroadcastReceiver; import android.content.Context; @@ -72,13 +75,14 @@ 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 static final int MENU_CHANGELOG = 4; - private static final String changelog="(i'm looking for someone to write a tutorial for vnc server)

- [Fix] Everything working again :D
- [Fix] Now contains busybox binary for better device compatibility
- [Fix] FC on preferences menu, for real this time (thanks Piki for the hints)"; + private static final int APP_ID = 123; + private static final String changelog="(i'm looking for someone to write a tutorial for vnc server)

- DroidX not sliding now (must confirm)
- [Fix] Seach was not working in Ctrl
- [Add] System notification when client connects"; private PowerManager.WakeLock wakeLock = null; private Timer watchdogTimer=null; @@ -87,7 +91,7 @@ public class MainActivity extends Activity ProgressDialog dialog=null; AlertDialog startDialog; - + /** Called when the activity is first created. */ @Override @@ -132,7 +136,11 @@ public class MainActivity extends Activity // register wifi event receiver mReceiver receiver=new mReceiver(); - this.registerReceiver(receiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); + registerReceiver(receiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); + registerReceiver(receiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); + registerReceiver(activityReceiver, new IntentFilter("org.onaips.vnc.CLIENTCONNECTED")); + registerReceiver(activityReceiver, new IntentFilter("org.onaips.vnc.CLIENTDISCONNECTED")); + setStateLabels(isAndroidServerRunning()); @@ -150,7 +158,7 @@ public class MainActivity extends Activity { showTextOnScreen("Server is not running"); return; - } + } prepareWatchdog("Stopping server. Please wait...","Couldn't Stop server",false); @@ -330,7 +338,7 @@ public class MainActivity extends Activity else t.setText(Html.fromHtml("Connect to:
" + ip+":" + port + "
or
http://" + ip + ":" + httpport + "
")); - + } else t.setText(""); @@ -379,6 +387,11 @@ public class MainActivity extends Activity os.flush(); os.close(); + + //lets clear notifications + String ns = Context.NOTIFICATION_SERVICE; + NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); + mNotificationManager.cancel(APP_ID); } catch (IOException e) { showTextOnScreen("stopServer()" + e.getMessage()); Log.v("VNC","stopServer()" + e.getMessage()); @@ -422,11 +435,13 @@ public class MainActivity extends Activity rotation="-r " + rotation; String scaling=preferences.getString("scale", "100"); - + String scaling_string=""; if (!scaling.equals("0")) scaling_string="-s " + scaling; + String donate=free_version()?"":" -d "; + String port=preferences.getString("port", "5901"); try { @@ -442,7 +457,7 @@ public class MainActivity extends Activity sh = Runtime.getRuntime().exec("su"); OutputStream os = sh.getOutputStream(); - writeCommand(os, getFilesDir().getAbsolutePath() + "/androidvncserver "+ password_check + " " + rotation + " " + scaling_string + " " + port_string); + writeCommand(os, getFilesDir().getAbsolutePath() + "/androidvncserver "+ password_check + " " + rotation + " " + scaling_string + " " + port_string + donate); } catch (IOException e) { @@ -704,4 +719,40 @@ public class MainActivity extends Activity } } }; + + public BroadcastReceiver activityReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context1, Intent intent) { + final int HELLO_ID = 1; + if (intent.getAction().equalsIgnoreCase("org.onaips.vnc.CLIENTCONNECTED")) + { + String ns = Context.NOTIFICATION_SERVICE; + NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); + + int icon = R.drawable.icon; + CharSequence tickerText = "Client connected to VNC server"; + long when = System.currentTimeMillis(); + + Notification notification = new Notification(icon, tickerText, when); + + Context context = getApplicationContext(); + CharSequence contentTitle = "Droid VNC Server"; + CharSequence contentText = "Client Connected"; + Intent notificationIntent = new Intent(); + PendingIntent contentIntent = PendingIntent.getActivity(context1, 0, notificationIntent, 0); + + notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent); + + + mNotificationManager.notify(APP_ID, notification); + + } + else if (intent.getAction().equalsIgnoreCase("org.onaips.vnc.CLIENTDISCONNECTED")) + { + String ns = Context.NOTIFICATION_SERVICE; + NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); + mNotificationManager.cancel(APP_ID); + } + } + }; } \ No newline at end of file diff --git a/src/org/onaips/vnc_donate/MainApplication.java b/src/org/onaips/vnc/MainApplication.java similarity index 98% rename from src/org/onaips/vnc_donate/MainApplication.java rename to src/org/onaips/vnc/MainApplication.java index db2fc17..ca50c18 100644 --- a/src/org/onaips/vnc_donate/MainApplication.java +++ b/src/org/onaips/vnc/MainApplication.java @@ -1,4 +1,4 @@ -package org.onaips.vnc_donate; +package org.onaips.vnc; import java.io.FileOutputStream; import java.io.IOException; diff --git a/src/org/onaips/vnc_donate/StartAtBootService.java b/src/org/onaips/vnc/StartAtBootService.java similarity index 89% rename from src/org/onaips/vnc_donate/StartAtBootService.java rename to src/org/onaips/vnc/StartAtBootService.java index f5dad2d..de85622 100644 --- a/src/org/onaips/vnc_donate/StartAtBootService.java +++ b/src/org/onaips/vnc/StartAtBootService.java @@ -1,4 +1,4 @@ -package org.onaips.vnc_donate; +package org.onaips.vnc; import java.io.IOException; import java.io.OutputStream; @@ -29,6 +29,12 @@ public class StartAtBootService extends Service { } + public boolean free_version() + { + return getPackageName().equals("org.onaips.vnc"); + } + + public void startServer() { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); @@ -43,6 +49,7 @@ public class StartAtBootService extends Service { try{ Process sh; + String password=preferences.getString("password", ""); String password_check=""; if (!password.equals("")) @@ -50,14 +57,16 @@ public class StartAtBootService extends Service { String rotation=preferences.getString("rotation", "0"); - rotation="-r " + rotation; + rotation="-r " + rotation; String scaling=preferences.getString("scale", "100"); - - String scaling_string=""; + + String scaling_string=""; if (!scaling.equals("0")) scaling_string="-s " + scaling; + String donate=free_version()?"":" -d "; + String port=preferences.getString("port", "5901"); try { @@ -73,7 +82,8 @@ public class StartAtBootService extends Service { sh = Runtime.getRuntime().exec("su"); OutputStream os = sh.getOutputStream(); - writeCommand(os, getFilesDir().getAbsolutePath() + "/androidvncserver "+ password_check + " " + rotation + " " + scaling_string + " " + port_string); + writeCommand(os, getFilesDir().getAbsolutePath() + "/androidvncserver "+ password_check + " " + rotation + " " + scaling_string + " " + port_string + donate); + } catch (IOException e) { Log.v("VNC","startServer():" + e.getMessage()); diff --git a/src/org/onaips/vnc_donate/StartAtBootServiceReceiver.java b/src/org/onaips/vnc/StartAtBootServiceReceiver.java similarity index 79% rename from src/org/onaips/vnc_donate/StartAtBootServiceReceiver.java rename to src/org/onaips/vnc/StartAtBootServiceReceiver.java index 0ef9005..61022ab 100644 --- a/src/org/onaips/vnc_donate/StartAtBootServiceReceiver.java +++ b/src/org/onaips/vnc/StartAtBootServiceReceiver.java @@ -1,4 +1,4 @@ -package org.onaips.vnc_donate; +package org.onaips.vnc; import android.content.BroadcastReceiver; import android.content.Context; @@ -11,7 +11,7 @@ public class StartAtBootServiceReceiver extends BroadcastReceiver { if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) { Intent i = new Intent(); - i.setAction(context.getPackageName() + ".StartAtBootService"); + i.setAction("org.onaips.vnc.StartAtBootService"); context.startService(i); } } diff --git a/src/org/onaips/vnc_donate/preferences.java b/src/org/onaips/vnc/preferences.java similarity index 91% rename from src/org/onaips/vnc_donate/preferences.java rename to src/org/onaips/vnc/preferences.java index dcf4bf8..472d438 100644 --- a/src/org/onaips/vnc_donate/preferences.java +++ b/src/org/onaips/vnc/preferences.java @@ -1,4 +1,4 @@ -package org.onaips.vnc_donate; +package org.onaips.vnc;