Merge branch 'master' of github.com:FreeRDP/FreeRDP
This commit is contained in:
commit
0276b095eb
@ -536,7 +536,11 @@ endif()
|
||||
|
||||
if (IOS)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
|
||||
set(CMAKE_OSX_SYSROOT "iphoneos")
|
||||
if (IOS_PLATFORM MATCHES "SIMULATOR")
|
||||
set(CMAKE_OSX_SYSROOT "iphonesimulator")
|
||||
else()
|
||||
set(CMAKE_OSX_SYSROOT "iphoneos")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CLIENT)
|
||||
|
@ -4,7 +4,6 @@ set(OPTION_CLIENT_DEFAULT ON)
|
||||
set(OPTION_SERVER_DEFAULT ON)
|
||||
|
||||
if(ANDROID)
|
||||
set(OPTION_CLIENT_DEFAULT OFF)
|
||||
set(OPTION_SERVER_DEFAULT OFF)
|
||||
endif()
|
||||
|
||||
|
@ -4,4 +4,6 @@
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
</classpath>
|
||||
|
@ -28,6 +28,14 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/project.properties.cmake
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ant.properties.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ant.properties @ONLY)
|
||||
|
||||
# Generate a Java class with static members set to the CMake
|
||||
# configuration properties.
|
||||
set(JAVA_CFG "src/com/freerdp/freerdpcore/utils/BuildConfiguration.java")
|
||||
set(JAVA_CFG_OUT "${CMAKE_CURRENT_BINARY_DIR}/${JAVA_CFG}")
|
||||
set(JAVA_CFG_IN "${CMAKE_CURRENT_SOURCE_DIR}/${JAVA_CFG}.in")
|
||||
|
||||
CONFIGURE_FILE(${JAVA_CFG_IN} ${JAVA_CFG_OUT})
|
||||
|
||||
file(COPY res DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
if (ANDROID_SDK)
|
||||
|
@ -22,6 +22,7 @@
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView android:id="@+id/bookmark_icon1"
|
||||
android:contentDescription="@+id/bookmark_icon1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
@ -46,6 +47,7 @@
|
||||
/>
|
||||
|
||||
<ImageView android:id="@+id/bookmark_icon2"
|
||||
android:contentDescription="@+id/bookmark_icon2"
|
||||
android:layout_marginTop="9dip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/session_screenshot"
|
||||
android:contentDescription="@+id/session_screenshot"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="48dp"
|
||||
android:scaleType="fitXY"
|
||||
@ -51,6 +52,7 @@
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/session_disconnect"
|
||||
android:contentDescription="@+id/session_disconnect"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -32,8 +32,8 @@
|
||||
<!-- List placeholder labels -->
|
||||
<string name="list_placeholder_login">Login</string>
|
||||
<string name="list_placeholder_no_servers">No Servers</string>
|
||||
<string name="list_placeholder_connecting">Connecting ...</string>
|
||||
<string name="list_placeholder_disconnecting">Disconnecting ...</string>
|
||||
<string name="list_placeholder_connecting">Connecting …</string>
|
||||
<string name="list_placeholder_disconnecting">Disconnecting …</string>
|
||||
<string name="list_placeholder_connection_error">Connection Lost</string>
|
||||
<string name="list_placeholder_wrong_password">Wrong Password</string>
|
||||
<string name="list_placeholder_invalid_username">Invalid Username</string>
|
||||
@ -178,8 +178,8 @@
|
||||
<string name="dlg_title_credentials">Please enter your credentials</string>
|
||||
<string name="dlg_title_create_shortcut">Create Shortcut</string>
|
||||
<string name="dlg_msg_create_shortcut">Shortcut name:</string>
|
||||
<string name="dlg_msg_connecting">Connecting ...</string>
|
||||
<string name="dlg_msg_logging_in">Logging in ...</string>
|
||||
<string name="dlg_msg_connecting">Connecting …</string>
|
||||
<string name="dlg_msg_logging_in">Logging in …</string>
|
||||
<string name="dlg_title_about">About aFreeRDP</string>
|
||||
<string name="dlg_msg_about">Version: %1$s\n\u00A9 2012 Thinstuff Technologies GmbH</string>
|
||||
<string name="dlg_title_create_bookmark_after_qc">Save Connection Settings?</string>
|
||||
@ -191,4 +191,6 @@
|
||||
<string name="dlg_msg_exit">Are you sure you want to exit the application?</string>
|
||||
<string name="dlg_title_clear_cert_cache">Delete Certificates?</string>
|
||||
<string name="dlg_msg_clear_cert_cache">Are you sure you want to delete all your cached Certificates?</string>
|
||||
<string name="debug_level">Debug Level</string>
|
||||
<string name="settings_debug">Debug Settings</string>
|
||||
</resources>
|
||||
|
@ -26,7 +26,9 @@
|
||||
</PreferenceScreen>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/settings_cat_settings">
|
||||
<PreferenceCategory
|
||||
android:key="category.settings"
|
||||
android:title="@string/settings_cat_settings">
|
||||
|
||||
<PreferenceScreen android:key="bookmark.screen" android:title="@string/settings_screen">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
@ -49,6 +51,13 @@
|
||||
android:data="preferences://advanced_settings" />
|
||||
</PreferenceScreen>
|
||||
|
||||
</PreferenceCategory>
|
||||
<PreferenceScreen android:key="bookmark.debug" android:title="@string/settings_debug">
|
||||
<intent android:action="android.intent.action.VIEW"
|
||||
android:targetPackage="*"
|
||||
android:targetClass="com.freerdp.freerdpcore.presentation.BookmarkActivity"
|
||||
android:data="preferences://debug_settings" />
|
||||
</PreferenceScreen>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
35
client/Android/FreeRDPCore/res/xml/debug_settings.xml
Normal file
35
client/Android/FreeRDPCore/res/xml/debug_settings.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
Debug Settings Layout
|
||||
|
||||
Copyright 2013 Thinstuff Technologies GmbH
|
||||
Copyright 2013 Armin Novak <anovak@thinstuff.at>
|
||||
|
||||
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.
|
||||
*/
|
||||
-->
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:freerdp="http://schemas.android.com/apk/res-auto">
|
||||
<PreferenceCategory android:title="@string/settings_debug">
|
||||
<com.freerdp.freerdpcore.utils.IntEditTextPreference
|
||||
android:key="bookmark.debug_level"
|
||||
android:title="@string/debug_level"
|
||||
android:summary="Debug level, 0 to disable."
|
||||
android:numeric="integer"
|
||||
android:inputType="number"
|
||||
freerdp:bounds_min="0"
|
||||
freerdp:bounds_max="10"
|
||||
freerdp:bounds_default="0" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
@ -5,27 +5,27 @@
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
*/
|
||||
|
||||
package com.freerdp.freerdpcore.domain;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import com.freerdp.freerdpcore.application.GlobalApp;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class BookmarkBase implements Parcelable, Cloneable
|
||||
{
|
||||
public class BookmarkBase implements Parcelable, Cloneable {
|
||||
public static final int TYPE_INVALID = -1;
|
||||
public static final int TYPE_MANUAL = 1;
|
||||
public static final int TYPE_QUICKCONNECT = 2;
|
||||
public static final int TYPE_PLACEHOLDER = 3;
|
||||
public static final int TYPE_CUSTOM_BASE = 1000;
|
||||
|
||||
|
||||
// performance flags
|
||||
public static class PerformanceFlags implements Parcelable
|
||||
{
|
||||
public static class PerformanceFlags implements Parcelable {
|
||||
private boolean remotefx;
|
||||
private boolean wallpaper;
|
||||
private boolean theming;
|
||||
@ -33,7 +33,7 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
private boolean menuAnimations;
|
||||
private boolean fontSmoothing;
|
||||
private boolean desktopComposition;
|
||||
|
||||
|
||||
public PerformanceFlags() {
|
||||
remotefx = false;
|
||||
wallpaper = false;
|
||||
@ -43,13 +43,13 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
fontSmoothing = false;
|
||||
desktopComposition = false;
|
||||
}
|
||||
|
||||
|
||||
public PerformanceFlags(Parcel parcel) {
|
||||
remotefx = (parcel.readInt() == 1) ? true : false;
|
||||
wallpaper = (parcel.readInt() == 1) ? true : false;
|
||||
theming = (parcel.readInt() == 1) ? true : false;
|
||||
fullWindowDrag = (parcel.readInt() == 1) ? true : false;
|
||||
menuAnimations = (parcel.readInt() == 1) ? true : false;
|
||||
wallpaper = (parcel.readInt() == 1) ? true : false;
|
||||
theming = (parcel.readInt() == 1) ? true : false;
|
||||
fullWindowDrag = (parcel.readInt() == 1) ? true : false;
|
||||
menuAnimations = (parcel.readInt() == 1) ? true : false;
|
||||
fontSmoothing = (parcel.readInt() == 1) ? true : false;
|
||||
desktopComposition = (parcel.readInt() == 1) ? true : false;
|
||||
}
|
||||
@ -57,7 +57,7 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public boolean getRemoteFX() {
|
||||
return remotefx;
|
||||
}
|
||||
|
||||
|
||||
public void setRemoteFX(boolean remotefx) {
|
||||
this.remotefx = remotefx;
|
||||
}
|
||||
@ -65,15 +65,15 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public boolean getWallpaper() {
|
||||
return wallpaper;
|
||||
}
|
||||
|
||||
|
||||
public void setWallpaper(boolean wallpaper) {
|
||||
this.wallpaper = wallpaper;
|
||||
}
|
||||
|
||||
|
||||
public boolean getTheming() {
|
||||
return theming;
|
||||
}
|
||||
|
||||
|
||||
public void setTheming(boolean theming) {
|
||||
this.theming = theming;
|
||||
}
|
||||
@ -81,7 +81,7 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public boolean getFullWindowDrag() {
|
||||
return fullWindowDrag;
|
||||
}
|
||||
|
||||
|
||||
public void setFullWindowDrag(boolean fullWindowDrag) {
|
||||
this.fullWindowDrag = fullWindowDrag;
|
||||
}
|
||||
@ -89,7 +89,7 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public boolean getMenuAnimations() {
|
||||
return menuAnimations;
|
||||
}
|
||||
|
||||
|
||||
public void setMenuAnimations(boolean menuAnimations) {
|
||||
this.menuAnimations = menuAnimations;
|
||||
}
|
||||
@ -97,21 +97,20 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public boolean getFontSmoothing() {
|
||||
return fontSmoothing;
|
||||
}
|
||||
|
||||
|
||||
public void setFontSmoothing(boolean fontSmoothing) {
|
||||
this.fontSmoothing = fontSmoothing;
|
||||
}
|
||||
|
||||
|
||||
public boolean getDesktopComposition() {
|
||||
return desktopComposition;
|
||||
}
|
||||
|
||||
|
||||
public void setDesktopComposition(boolean desktopComposition) {
|
||||
this.desktopComposition = desktopComposition;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<PerformanceFlags> CREATOR = new Parcelable.Creator<PerformanceFlags>()
|
||||
{
|
||||
public static final Parcelable.Creator<PerformanceFlags> CREATOR = new Parcelable.Creator<PerformanceFlags>() {
|
||||
public PerformanceFlags createFromParcel(Parcel in) {
|
||||
return new PerformanceFlags(in);
|
||||
}
|
||||
@ -128,26 +127,24 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags)
|
||||
{
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(remotefx ? 1 : 0);
|
||||
out.writeInt(wallpaper ? 1 : 0);
|
||||
out.writeInt(theming ? 1 : 0);
|
||||
out.writeInt(fullWindowDrag ? 1 : 0);
|
||||
out.writeInt(menuAnimations ? 1 : 0);
|
||||
out.writeInt(wallpaper ? 1 : 0);
|
||||
out.writeInt(theming ? 1 : 0);
|
||||
out.writeInt(fullWindowDrag ? 1 : 0);
|
||||
out.writeInt(menuAnimations ? 1 : 0);
|
||||
out.writeInt(fontSmoothing ? 1 : 0);
|
||||
out.writeInt(desktopComposition ? 1 : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Screen Settings class
|
||||
public static class ScreenSettings implements Parcelable
|
||||
{
|
||||
public static class ScreenSettings implements Parcelable {
|
||||
public static final int FITSCREEN = -2;
|
||||
public static final int AUTOMATIC = -1;
|
||||
public static final int CUSTOM = 0;
|
||||
public static final int PREDEFINED = 1;
|
||||
|
||||
|
||||
private int resolution;
|
||||
private int colors;
|
||||
private int width;
|
||||
@ -163,67 +160,58 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
width = parcel.readInt();
|
||||
height = parcel.readInt();
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
resolution = AUTOMATIC;
|
||||
colors = 16;
|
||||
width = 0;
|
||||
height = 0;
|
||||
}
|
||||
|
||||
public void setResolution(int resolution)
|
||||
{
|
||||
|
||||
public void setResolution(int resolution) {
|
||||
this.resolution = resolution;
|
||||
|
||||
|
||||
if (resolution == AUTOMATIC || resolution == FITSCREEN) {
|
||||
width = 0;
|
||||
height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setResolution(String resolution, int width, int height)
|
||||
{
|
||||
|
||||
public void setResolution(String resolution, int width, int height) {
|
||||
if (resolution.contains("x")) {
|
||||
String[] dimensions = resolution.split("x");
|
||||
this.width = Integer.valueOf(dimensions[0]);
|
||||
this.height = Integer.valueOf(dimensions[1]);
|
||||
this.resolution = PREDEFINED;
|
||||
}
|
||||
else if (resolution.equalsIgnoreCase("custom"))
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
} else if (resolution.equalsIgnoreCase("custom")) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.resolution = CUSTOM;
|
||||
}
|
||||
else if (resolution.equalsIgnoreCase("fitscreen"))
|
||||
{
|
||||
} else if (resolution.equalsIgnoreCase("fitscreen")) {
|
||||
this.width = this.height = 0;
|
||||
this.resolution = FITSCREEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.width = this.height = 0;
|
||||
this.resolution = AUTOMATIC;
|
||||
}
|
||||
}
|
||||
|
||||
public int getResolution()
|
||||
{
|
||||
public int getResolution() {
|
||||
return resolution;
|
||||
}
|
||||
|
||||
public String getResolutionString()
|
||||
{
|
||||
|
||||
public String getResolutionString() {
|
||||
if (isPredefined())
|
||||
return (width + "x" + height);
|
||||
|
||||
return (isFitScreen() ? "fitscreen" : isAutomatic() ? "automatic" : "custom");
|
||||
return (isFitScreen() ? "fitscreen" : isAutomatic() ? "automatic"
|
||||
: "custom");
|
||||
}
|
||||
|
||||
public boolean isPredefined() {
|
||||
return (resolution == PREDEFINED);
|
||||
return (resolution == PREDEFINED);
|
||||
}
|
||||
|
||||
|
||||
public boolean isAutomatic() {
|
||||
return (resolution == AUTOMATIC);
|
||||
}
|
||||
@ -239,29 +227,28 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
|
||||
public void setColors(int colors) {
|
||||
this.colors = colors;
|
||||
}
|
||||
|
||||
|
||||
public int getColors() {
|
||||
return colors;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<ScreenSettings> CREATOR = new Parcelable.Creator<ScreenSettings>()
|
||||
{
|
||||
|
||||
public static final Parcelable.Creator<ScreenSettings> CREATOR = new Parcelable.Creator<ScreenSettings>() {
|
||||
public ScreenSettings createFromParcel(Parcel in) {
|
||||
return new ScreenSettings(in);
|
||||
}
|
||||
@ -278,19 +265,61 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags)
|
||||
{
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(resolution);
|
||||
out.writeInt(colors);
|
||||
out.writeInt(width);
|
||||
out.writeInt(height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static class DebugSettings implements Parcelable {
|
||||
private int debug;
|
||||
|
||||
public DebugSettings() {
|
||||
init();
|
||||
}
|
||||
|
||||
public DebugSettings(Parcel parcel) {
|
||||
debug = parcel.readInt();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
debug = 0;
|
||||
}
|
||||
|
||||
public int getDebugLevel() {
|
||||
return debug;
|
||||
}
|
||||
|
||||
public void setDebugLevel(int debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<DebugSettings> CREATOR = new Parcelable.Creator<DebugSettings>() {
|
||||
public DebugSettings createFromParcel(Parcel in) {
|
||||
return new DebugSettings(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DebugSettings[] newArray(int size) {
|
||||
return new DebugSettings[size];
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(debug);
|
||||
}
|
||||
}
|
||||
|
||||
// Session Settings
|
||||
public static class AdvancedSettings implements Parcelable
|
||||
{
|
||||
public static class AdvancedSettings implements Parcelable {
|
||||
private boolean enable3GSettings;
|
||||
private ScreenSettings screen3G;
|
||||
private PerformanceFlags performance3G;
|
||||
@ -308,17 +337,19 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
|
||||
public AdvancedSettings(Parcel parcel) {
|
||||
enable3GSettings = (parcel.readInt() == 1) ? true : false;
|
||||
screen3G = parcel.readParcelable(ScreenSettings.class.getClassLoader());
|
||||
performance3G = parcel.readParcelable(PerformanceFlags.class.getClassLoader());
|
||||
screen3G = parcel.readParcelable(ScreenSettings.class
|
||||
.getClassLoader());
|
||||
performance3G = parcel.readParcelable(PerformanceFlags.class
|
||||
.getClassLoader());
|
||||
redirectSDCard = (parcel.readInt() == 1) ? true : false;
|
||||
redirectSound = parcel.readInt();
|
||||
redirectMicrophone = (parcel.readInt() == 1) ? true : false;
|
||||
security = parcel.readInt();
|
||||
consoleMode = (parcel.readInt() == 1) ? true : false;
|
||||
remoteProgram = parcel.readString();
|
||||
workDir = parcel.readString();
|
||||
workDir = parcel.readString();
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
enable3GSettings = false;
|
||||
screen3G = new ScreenSettings();
|
||||
@ -331,11 +362,11 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
remoteProgram = "";
|
||||
workDir = "";
|
||||
}
|
||||
|
||||
|
||||
public void setEnable3GSettings(boolean enable3GSettings) {
|
||||
this.enable3GSettings = enable3GSettings;
|
||||
}
|
||||
|
||||
|
||||
public boolean getEnable3GSettings() {
|
||||
return enable3GSettings;
|
||||
}
|
||||
@ -343,81 +374,76 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public ScreenSettings getScreen3G() {
|
||||
return screen3G;
|
||||
}
|
||||
|
||||
|
||||
public void setScreen3G(ScreenSettings screen3G) {
|
||||
this.screen3G = screen3G;
|
||||
this.screen3G = screen3G;
|
||||
}
|
||||
|
||||
public PerformanceFlags getPerformance3G() {
|
||||
return performance3G;
|
||||
}
|
||||
|
||||
|
||||
public void setPerformance3G(PerformanceFlags performance3G) {
|
||||
this.performance3G = performance3G;
|
||||
this.performance3G = performance3G;
|
||||
}
|
||||
|
||||
public void setRedirectSDCard(boolean redirectSDCard) {
|
||||
this.redirectSDCard = redirectSDCard;
|
||||
}
|
||||
|
||||
|
||||
public boolean getRedirectSDCard() {
|
||||
return redirectSDCard;
|
||||
}
|
||||
|
||||
|
||||
public void setRedirectSound(int redirect) {
|
||||
this.redirectSound = redirect;
|
||||
}
|
||||
|
||||
|
||||
public int getRedirectSound() {
|
||||
return redirectSound;
|
||||
}
|
||||
|
||||
|
||||
public void setRedirectMicrophone(boolean redirect) {
|
||||
this.redirectMicrophone = redirect;
|
||||
}
|
||||
|
||||
|
||||
public boolean getRedirectMicrophone() {
|
||||
return redirectMicrophone;
|
||||
}
|
||||
|
||||
|
||||
public void setSecurity(int security) {
|
||||
this.security = security;
|
||||
}
|
||||
|
||||
|
||||
public int getSecurity() {
|
||||
return security;
|
||||
}
|
||||
|
||||
|
||||
public void setConsoleMode(boolean consoleMode) {
|
||||
this.consoleMode = consoleMode;
|
||||
}
|
||||
|
||||
|
||||
public boolean getConsoleMode() {
|
||||
return consoleMode;
|
||||
}
|
||||
|
||||
public void setRemoteProgram(String remoteProgram)
|
||||
{
|
||||
|
||||
public void setRemoteProgram(String remoteProgram) {
|
||||
this.remoteProgram = remoteProgram;
|
||||
}
|
||||
|
||||
public String getRemoteProgram()
|
||||
{
|
||||
|
||||
public String getRemoteProgram() {
|
||||
return remoteProgram;
|
||||
}
|
||||
|
||||
public void setWorkDir(String workDir)
|
||||
{
|
||||
|
||||
public void setWorkDir(String workDir) {
|
||||
this.workDir = workDir;
|
||||
}
|
||||
|
||||
public String getWorkDir()
|
||||
{
|
||||
|
||||
public String getWorkDir() {
|
||||
return workDir;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<AdvancedSettings> CREATOR = new Parcelable.Creator<AdvancedSettings>()
|
||||
{
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<AdvancedSettings> CREATOR = new Parcelable.Creator<AdvancedSettings>() {
|
||||
public AdvancedSettings createFromParcel(Parcel in) {
|
||||
return new AdvancedSettings(in);
|
||||
}
|
||||
@ -434,23 +460,22 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags)
|
||||
{
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(enable3GSettings ? 1 : 0);
|
||||
out.writeParcelable(screen3G, flags);
|
||||
out.writeParcelable(performance3G, flags);
|
||||
out.writeInt(redirectSDCard ? 1 : 0);
|
||||
out.writeInt(redirectSound);
|
||||
out.writeInt(redirectMicrophone ? 1 : 0);
|
||||
out.writeInt(security);
|
||||
out.writeInt(consoleMode ? 1 : 0);
|
||||
out.writeInt(security);
|
||||
out.writeInt(consoleMode ? 1 : 0);
|
||||
out.writeString(remoteProgram);
|
||||
out.writeString(workDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected int type;
|
||||
private long id;
|
||||
|
||||
protected int type;
|
||||
private long id;
|
||||
private String label;
|
||||
private String username;
|
||||
private String password;
|
||||
@ -459,23 +484,23 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
private ScreenSettings screenSettings;
|
||||
private PerformanceFlags performanceFlags;
|
||||
private AdvancedSettings advancedSettings;
|
||||
|
||||
private void init()
|
||||
{
|
||||
private DebugSettings debugSettings;
|
||||
|
||||
private void init() {
|
||||
type = TYPE_INVALID;
|
||||
id = -1;
|
||||
label = "";
|
||||
username = "";
|
||||
password = "";
|
||||
domain = "";
|
||||
|
||||
domain = "";
|
||||
|
||||
screenSettings = new ScreenSettings();
|
||||
performanceFlags = new PerformanceFlags();
|
||||
advancedSettings = new AdvancedSettings();
|
||||
debugSettings = new DebugSettings();
|
||||
}
|
||||
|
||||
public BookmarkBase(Parcel parcel)
|
||||
{
|
||||
|
||||
public BookmarkBase(Parcel parcel) {
|
||||
type = parcel.readInt();
|
||||
id = parcel.readLong();
|
||||
label = parcel.readString();
|
||||
@ -483,62 +508,69 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
password = parcel.readString();
|
||||
domain = parcel.readString();
|
||||
|
||||
screenSettings = parcel.readParcelable(ScreenSettings.class.getClassLoader());
|
||||
performanceFlags = parcel.readParcelable(PerformanceFlags.class.getClassLoader());
|
||||
advancedSettings = parcel.readParcelable(AdvancedSettings.class.getClassLoader());
|
||||
screenSettings = parcel.readParcelable(ScreenSettings.class
|
||||
.getClassLoader());
|
||||
performanceFlags = parcel.readParcelable(PerformanceFlags.class
|
||||
.getClassLoader());
|
||||
advancedSettings = parcel.readParcelable(AdvancedSettings.class
|
||||
.getClassLoader());
|
||||
debugSettings = parcel.readParcelable(DebugSettings.class
|
||||
.getClassLoader());
|
||||
}
|
||||
|
||||
|
||||
public BookmarkBase() {
|
||||
init();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends BookmarkBase> T get() { return (T)this; }
|
||||
public <T extends BookmarkBase> T get() {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
|
||||
|
||||
public void setScreenSettings(ScreenSettings screenSettings) {
|
||||
this.screenSettings = screenSettings;
|
||||
}
|
||||
@ -550,11 +582,11 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public void setPerformanceFlags(PerformanceFlags performanceFlags) {
|
||||
this.performanceFlags = performanceFlags;
|
||||
}
|
||||
|
||||
|
||||
public PerformanceFlags getPerformanceFlags() {
|
||||
return performanceFlags;
|
||||
}
|
||||
|
||||
|
||||
public void setAdvancedSettings(AdvancedSettings advancedSettings) {
|
||||
this.advancedSettings = advancedSettings;
|
||||
}
|
||||
@ -562,19 +594,28 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
public AdvancedSettings getAdvancedSettings() {
|
||||
return advancedSettings;
|
||||
}
|
||||
|
||||
public ScreenSettings getActiveScreenSettings()
|
||||
{
|
||||
return (GlobalApp.ConnectedTo3G && advancedSettings.getEnable3GSettings()) ? advancedSettings.getScreen3G() : screenSettings;
|
||||
}
|
||||
|
||||
public PerformanceFlags getActivePerformanceFlags()
|
||||
{
|
||||
return (GlobalApp.ConnectedTo3G && advancedSettings.getEnable3GSettings()) ? advancedSettings.getPerformance3G() : performanceFlags;
|
||||
|
||||
public void setDebugSettings(DebugSettings debugSettings) {
|
||||
this.debugSettings = debugSettings;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<BookmarkBase> CREATOR = new Parcelable.Creator<BookmarkBase>()
|
||||
{
|
||||
public DebugSettings getDebugSettings() {
|
||||
return debugSettings;
|
||||
}
|
||||
|
||||
public ScreenSettings getActiveScreenSettings() {
|
||||
return (GlobalApp.ConnectedTo3G && advancedSettings
|
||||
.getEnable3GSettings()) ? advancedSettings.getScreen3G()
|
||||
: screenSettings;
|
||||
}
|
||||
|
||||
public PerformanceFlags getActivePerformanceFlags() {
|
||||
return (GlobalApp.ConnectedTo3G && advancedSettings
|
||||
.getEnable3GSettings()) ? advancedSettings.getPerformance3G()
|
||||
: performanceFlags;
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator<BookmarkBase> CREATOR = new Parcelable.Creator<BookmarkBase>() {
|
||||
public BookmarkBase createFromParcel(Parcel in) {
|
||||
return new BookmarkBase(in);
|
||||
}
|
||||
@ -584,15 +625,14 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
return new BookmarkBase[size];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags)
|
||||
{
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(type);
|
||||
out.writeLong(id);
|
||||
out.writeString(label);
|
||||
@ -603,11 +643,14 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
out.writeParcelable(screenSettings, flags);
|
||||
out.writeParcelable(performanceFlags, flags);
|
||||
out.writeParcelable(advancedSettings, flags);
|
||||
out.writeParcelable(debugSettings, flags);
|
||||
}
|
||||
|
||||
// write to shared preferences
|
||||
public void writeToSharedPreferences(SharedPreferences sharedPrefs)
|
||||
{
|
||||
public void writeToSharedPreferences(SharedPreferences sharedPrefs) {
|
||||
|
||||
Locale locale = Locale.ENGLISH;
|
||||
|
||||
SharedPreferences.Editor editor = sharedPrefs.edit();
|
||||
editor.clear();
|
||||
editor.putString("bookmark.label", label);
|
||||
@ -616,95 +659,151 @@ public class BookmarkBase implements Parcelable, Cloneable
|
||||
editor.putString("bookmark.domain", domain);
|
||||
|
||||
editor.putInt("bookmark.colors", screenSettings.getColors());
|
||||
editor.putString("bookmark.resolution", screenSettings.getResolutionString().toLowerCase());
|
||||
editor.putString("bookmark.resolution", screenSettings
|
||||
.getResolutionString().toLowerCase(locale));
|
||||
editor.putInt("bookmark.width", screenSettings.getWidth());
|
||||
editor.putInt("bookmark.height", screenSettings.getHeight());
|
||||
|
||||
editor.putBoolean("bookmark.perf_remotefx", performanceFlags.getRemoteFX());
|
||||
editor.putBoolean("bookmark.perf_wallpaper", performanceFlags.getWallpaper());
|
||||
editor.putBoolean("bookmark.perf_font_smoothing", performanceFlags.getFontSmoothing());
|
||||
editor.putBoolean("bookmark.perf_desktop_composition", performanceFlags.getDesktopComposition());
|
||||
editor.putBoolean("bookmark.perf_window_dragging", performanceFlags.getFullWindowDrag());
|
||||
editor.putBoolean("bookmark.perf_menu_animation", performanceFlags.getMenuAnimations());
|
||||
editor.putBoolean("bookmark.perf_remotefx",
|
||||
performanceFlags.getRemoteFX());
|
||||
editor.putBoolean("bookmark.perf_wallpaper",
|
||||
performanceFlags.getWallpaper());
|
||||
editor.putBoolean("bookmark.perf_font_smoothing",
|
||||
performanceFlags.getFontSmoothing());
|
||||
editor.putBoolean("bookmark.perf_desktop_composition",
|
||||
performanceFlags.getDesktopComposition());
|
||||
editor.putBoolean("bookmark.perf_window_dragging",
|
||||
performanceFlags.getFullWindowDrag());
|
||||
editor.putBoolean("bookmark.perf_menu_animation",
|
||||
performanceFlags.getMenuAnimations());
|
||||
editor.putBoolean("bookmark.perf_themes", performanceFlags.getTheming());
|
||||
|
||||
editor.putBoolean("bookmark.enable_3g_settings", advancedSettings.getEnable3GSettings());
|
||||
|
||||
editor.putInt("bookmark.colors_3g", advancedSettings.getScreen3G().getColors());
|
||||
editor.putString("bookmark.resolution_3g", advancedSettings.getScreen3G().getResolutionString().toLowerCase());
|
||||
editor.putInt("bookmark.width_3g", advancedSettings.getScreen3G().getWidth());
|
||||
editor.putInt("bookmark.height_3g", advancedSettings.getScreen3G().getHeight());
|
||||
editor.putBoolean("bookmark.enable_3g_settings",
|
||||
advancedSettings.getEnable3GSettings());
|
||||
|
||||
editor.putBoolean("bookmark.perf_remotefx_3g", advancedSettings.getPerformance3G().getRemoteFX());
|
||||
editor.putBoolean("bookmark.perf_wallpaper_3g", advancedSettings.getPerformance3G().getWallpaper());
|
||||
editor.putBoolean("bookmark.perf_font_smoothing_3g", advancedSettings.getPerformance3G().getFontSmoothing());
|
||||
editor.putBoolean("bookmark.perf_desktop_composition_3g", advancedSettings.getPerformance3G().getDesktopComposition());
|
||||
editor.putBoolean("bookmark.perf_window_dragging_3g", advancedSettings.getPerformance3G().getFullWindowDrag());
|
||||
editor.putBoolean("bookmark.perf_menu_animation_3g", advancedSettings.getPerformance3G().getMenuAnimations());
|
||||
editor.putBoolean("bookmark.perf_themes_3g", advancedSettings.getPerformance3G().getTheming());
|
||||
editor.putInt("bookmark.colors_3g", advancedSettings.getScreen3G()
|
||||
.getColors());
|
||||
editor.putString("bookmark.resolution_3g", advancedSettings
|
||||
.getScreen3G().getResolutionString().toLowerCase(locale));
|
||||
editor.putInt("bookmark.width_3g", advancedSettings.getScreen3G()
|
||||
.getWidth());
|
||||
editor.putInt("bookmark.height_3g", advancedSettings.getScreen3G()
|
||||
.getHeight());
|
||||
|
||||
editor.putBoolean("bookmark.redirect_sdcard", advancedSettings.getRedirectSDCard());
|
||||
editor.putInt("bookmark.redirect_sound", advancedSettings.getRedirectSound());
|
||||
editor.putBoolean("bookmark.redirect_microphone", advancedSettings.getRedirectMicrophone());
|
||||
editor.putBoolean("bookmark.perf_remotefx_3g", advancedSettings
|
||||
.getPerformance3G().getRemoteFX());
|
||||
editor.putBoolean("bookmark.perf_wallpaper_3g", advancedSettings
|
||||
.getPerformance3G().getWallpaper());
|
||||
editor.putBoolean("bookmark.perf_font_smoothing_3g", advancedSettings
|
||||
.getPerformance3G().getFontSmoothing());
|
||||
editor.putBoolean("bookmark.perf_desktop_composition_3g",
|
||||
advancedSettings.getPerformance3G().getDesktopComposition());
|
||||
editor.putBoolean("bookmark.perf_window_dragging_3g", advancedSettings
|
||||
.getPerformance3G().getFullWindowDrag());
|
||||
editor.putBoolean("bookmark.perf_menu_animation_3g", advancedSettings
|
||||
.getPerformance3G().getMenuAnimations());
|
||||
editor.putBoolean("bookmark.perf_themes_3g", advancedSettings
|
||||
.getPerformance3G().getTheming());
|
||||
|
||||
editor.putBoolean("bookmark.redirect_sdcard",
|
||||
advancedSettings.getRedirectSDCard());
|
||||
editor.putInt("bookmark.redirect_sound",
|
||||
advancedSettings.getRedirectSound());
|
||||
editor.putBoolean("bookmark.redirect_microphone",
|
||||
advancedSettings.getRedirectMicrophone());
|
||||
editor.putInt("bookmark.security", advancedSettings.getSecurity());
|
||||
editor.putString("bookmark.remote_program", advancedSettings.getRemoteProgram());
|
||||
editor.putString("bookmark.remote_program",
|
||||
advancedSettings.getRemoteProgram());
|
||||
editor.putString("bookmark.work_dir", advancedSettings.getWorkDir());
|
||||
editor.putBoolean("bookmark.console_mode", advancedSettings.getConsoleMode());
|
||||
editor.putBoolean("bookmark.console_mode",
|
||||
advancedSettings.getConsoleMode());
|
||||
|
||||
editor.putInt("bookmark.debug_level",
|
||||
debugSettings.getDebugLevel());
|
||||
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
// read from shared preferences
|
||||
public void readFromSharedPreferences(SharedPreferences sharedPrefs)
|
||||
{
|
||||
public void readFromSharedPreferences(SharedPreferences sharedPrefs) {
|
||||
label = sharedPrefs.getString("bookmark.label", "");
|
||||
username = sharedPrefs.getString("bookmark.username", "");
|
||||
password = sharedPrefs.getString("bookmark.password", "");
|
||||
domain = sharedPrefs.getString("bookmark.domain", "");
|
||||
|
||||
screenSettings.setColors(sharedPrefs.getInt("bookmark.colors", 16));
|
||||
screenSettings.setResolution(sharedPrefs.getString("bookmark.resolution", "automatic"), sharedPrefs.getInt("bookmark.width", 800), sharedPrefs.getInt("bookmark.height", 600));
|
||||
screenSettings.setResolution(
|
||||
sharedPrefs.getString("bookmark.resolution", "automatic"),
|
||||
sharedPrefs.getInt("bookmark.width", 800),
|
||||
sharedPrefs.getInt("bookmark.height", 600));
|
||||
|
||||
performanceFlags.setRemoteFX(sharedPrefs.getBoolean("bookmark.perf_remotefx", false));
|
||||
performanceFlags.setWallpaper(sharedPrefs.getBoolean("bookmark.perf_wallpaper", false));
|
||||
performanceFlags.setFontSmoothing(sharedPrefs.getBoolean("bookmark.perf_font_smoothing", false));
|
||||
performanceFlags.setDesktopComposition(sharedPrefs.getBoolean("bookmark.perf_desktop_composition", false));
|
||||
performanceFlags.setFullWindowDrag(sharedPrefs.getBoolean("bookmark.perf_window_dragging", false));
|
||||
performanceFlags.setMenuAnimations(sharedPrefs.getBoolean("bookmark.perf_menu_animation", false));
|
||||
performanceFlags.setTheming(sharedPrefs.getBoolean("bookmark.perf_themes", false));
|
||||
performanceFlags.setRemoteFX(sharedPrefs.getBoolean(
|
||||
"bookmark.perf_remotefx", false));
|
||||
performanceFlags.setWallpaper(sharedPrefs.getBoolean(
|
||||
"bookmark.perf_wallpaper", false));
|
||||
performanceFlags.setFontSmoothing(sharedPrefs.getBoolean(
|
||||
"bookmark.perf_font_smoothing", false));
|
||||
performanceFlags.setDesktopComposition(sharedPrefs.getBoolean(
|
||||
"bookmark.perf_desktop_composition", false));
|
||||
performanceFlags.setFullWindowDrag(sharedPrefs.getBoolean(
|
||||
"bookmark.perf_window_dragging", false));
|
||||
performanceFlags.setMenuAnimations(sharedPrefs.getBoolean(
|
||||
"bookmark.perf_menu_animation", false));
|
||||
performanceFlags.setTheming(sharedPrefs.getBoolean(
|
||||
"bookmark.perf_themes", false));
|
||||
|
||||
advancedSettings.setEnable3GSettings(sharedPrefs.getBoolean(
|
||||
"bookmark.enable_3g_settings", false));
|
||||
|
||||
advancedSettings.getScreen3G().setColors(
|
||||
sharedPrefs.getInt("bookmark.colors_3g", 16));
|
||||
advancedSettings.getScreen3G().setResolution(
|
||||
sharedPrefs.getString("bookmark.resolution_3g", "automatic"),
|
||||
sharedPrefs.getInt("bookmark.width_3g", 800),
|
||||
sharedPrefs.getInt("bookmark.height_3g", 600));
|
||||
|
||||
advancedSettings.getPerformance3G().setRemoteFX(
|
||||
sharedPrefs.getBoolean("bookmark.perf_remotefx_3g", false));
|
||||
advancedSettings.getPerformance3G().setWallpaper(
|
||||
sharedPrefs.getBoolean("bookmark.perf_wallpaper_3g", false));
|
||||
advancedSettings.getPerformance3G().setFontSmoothing(
|
||||
sharedPrefs
|
||||
.getBoolean("bookmark.perf_font_smoothing_3g", false));
|
||||
advancedSettings.getPerformance3G().setDesktopComposition(
|
||||
sharedPrefs.getBoolean("bookmark.perf_desktop_composition_3g",
|
||||
false));
|
||||
advancedSettings.getPerformance3G().setFullWindowDrag(
|
||||
sharedPrefs.getBoolean("bookmark.perf_window_dragging_3g",
|
||||
false));
|
||||
advancedSettings.getPerformance3G().setMenuAnimations(
|
||||
sharedPrefs
|
||||
.getBoolean("bookmark.perf_menu_animation_3g", false));
|
||||
advancedSettings.getPerformance3G().setTheming(
|
||||
sharedPrefs.getBoolean("bookmark.perf_themes_3g", false));
|
||||
|
||||
advancedSettings.setRedirectSDCard(sharedPrefs.getBoolean(
|
||||
"bookmark.redirect_sdcard", false));
|
||||
advancedSettings.setRedirectSound(sharedPrefs.getInt(
|
||||
"bookmark.redirect_sound", 0));
|
||||
advancedSettings.setRedirectMicrophone(sharedPrefs.getBoolean(
|
||||
"bookmark.redirect_microphone", false));
|
||||
advancedSettings
|
||||
.setSecurity(sharedPrefs.getInt("bookmark.security", 0));
|
||||
advancedSettings.setRemoteProgram(sharedPrefs.getString(
|
||||
"bookmark.remote_program", ""));
|
||||
advancedSettings.setWorkDir(sharedPrefs.getString("bookmark.work_dir",
|
||||
""));
|
||||
advancedSettings.setConsoleMode(sharedPrefs.getBoolean(
|
||||
"bookmark.console_mode", false));
|
||||
|
||||
advancedSettings.setEnable3GSettings(sharedPrefs.getBoolean("bookmark.enable_3g_settings", false));
|
||||
|
||||
advancedSettings.getScreen3G().setColors(sharedPrefs.getInt("bookmark.colors_3g", 16));
|
||||
advancedSettings.getScreen3G().setResolution(sharedPrefs.getString("bookmark.resolution_3g", "automatic"),
|
||||
sharedPrefs.getInt("bookmark.width_3g", 800), sharedPrefs.getInt("bookmark.height_3g", 600));
|
||||
|
||||
advancedSettings.getPerformance3G().setRemoteFX(sharedPrefs.getBoolean("bookmark.perf_remotefx_3g", false));
|
||||
advancedSettings.getPerformance3G().setWallpaper(sharedPrefs.getBoolean("bookmark.perf_wallpaper_3g", false));
|
||||
advancedSettings.getPerformance3G().setFontSmoothing(sharedPrefs.getBoolean("bookmark.perf_font_smoothing_3g", false));
|
||||
advancedSettings.getPerformance3G().setDesktopComposition(sharedPrefs.getBoolean("bookmark.perf_desktop_composition_3g", false));
|
||||
advancedSettings.getPerformance3G().setFullWindowDrag(sharedPrefs.getBoolean("bookmark.perf_window_dragging_3g", false));
|
||||
advancedSettings.getPerformance3G().setMenuAnimations(sharedPrefs.getBoolean("bookmark.perf_menu_animation_3g", false));
|
||||
advancedSettings.getPerformance3G().setTheming(sharedPrefs.getBoolean("bookmark.perf_themes_3g", false));
|
||||
|
||||
advancedSettings.setRedirectSDCard(sharedPrefs.getBoolean("bookmark.redirect_sdcard", false));
|
||||
advancedSettings.setRedirectSound(sharedPrefs.getInt("bookmark.redirect_sound", 0));
|
||||
advancedSettings.setRedirectMicrophone(sharedPrefs.getBoolean("bookmark.redirect_microphone", false));
|
||||
advancedSettings.setSecurity(sharedPrefs.getInt("bookmark.security", 0));
|
||||
advancedSettings.setRemoteProgram(sharedPrefs.getString("bookmark.remote_program", ""));
|
||||
advancedSettings.setWorkDir(sharedPrefs.getString("bookmark.work_dir", ""));
|
||||
advancedSettings.setConsoleMode(sharedPrefs.getBoolean("bookmark.console_mode", false));
|
||||
debugSettings.setDebugLevel(sharedPrefs.getInt("bookmark.debug_level", 0));
|
||||
}
|
||||
|
||||
// Cloneable
|
||||
public Object clone()
|
||||
{
|
||||
try
|
||||
{
|
||||
return super.clone();
|
||||
}
|
||||
catch(CloneNotSupportedException e)
|
||||
{
|
||||
public Object clone() {
|
||||
try {
|
||||
return super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -70,6 +70,8 @@ public abstract class BookmarkBaseGateway
|
||||
values.put("console_mode", bookmark.getAdvancedSettings().getConsoleMode());
|
||||
values.put("remote_program", bookmark.getAdvancedSettings().getRemoteProgram());
|
||||
values.put("work_dir", bookmark.getAdvancedSettings().getWorkDir());
|
||||
|
||||
values.put("debug_level", bookmark.getDebugSettings().getDebugLevel());
|
||||
|
||||
// add any special columns
|
||||
addBookmarkSpecificColumns(bookmark, values);
|
||||
@ -109,6 +111,8 @@ public abstract class BookmarkBaseGateway
|
||||
values.put("remote_program", bookmark.getAdvancedSettings().getRemoteProgram());
|
||||
values.put("work_dir", bookmark.getAdvancedSettings().getWorkDir());
|
||||
|
||||
values.put("debug_level", bookmark.getDebugSettings().getDebugLevel());
|
||||
|
||||
addBookmarkSpecificColumns(bookmark, values);
|
||||
|
||||
// update bookmark
|
||||
@ -229,6 +233,9 @@ public abstract class BookmarkBaseGateway
|
||||
columns.add("console_mode");
|
||||
columns.add("remote_program");
|
||||
columns.add("work_dir");
|
||||
|
||||
// debug settings
|
||||
columns.add("debug_level");
|
||||
|
||||
addBookmarkSpecificColumns(columns);
|
||||
}
|
||||
@ -290,6 +297,8 @@ public abstract class BookmarkBaseGateway
|
||||
bookmark.getAdvancedSettings().setRemoteProgram(cursor.getString(cursor.getColumnIndex("remote_program")));
|
||||
bookmark.getAdvancedSettings().setWorkDir(cursor.getString(cursor.getColumnIndex("work_dir")));
|
||||
|
||||
bookmark.getDebugSettings().setDebugLevel(cursor.getInt(cursor.getColumnIndex("debug_level")));
|
||||
|
||||
readBookmarkSpecificColumns(bookmark, cursor);
|
||||
|
||||
return bookmark;
|
||||
|
@ -22,7 +22,7 @@ import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
public class BookmarkDB extends SQLiteOpenHelper
|
||||
{
|
||||
private static final int DB_VERSION = 4;
|
||||
private static final int DB_VERSION = 6;
|
||||
private static final String DB_NAME = "bookmarks.db";
|
||||
|
||||
public static final String ID = BaseColumns._ID;
|
||||
@ -106,7 +106,8 @@ public class BookmarkDB extends SQLiteOpenHelper
|
||||
+ "security, "
|
||||
+ "remote_program, "
|
||||
+ "work_dir, "
|
||||
+ "console_mode) "
|
||||
+ "console_mode, "
|
||||
+ "debug_level ) "
|
||||
+ "VALUES ( "
|
||||
+ "'Test Server', "
|
||||
+ "'testservice.afreerdp.com', "
|
||||
@ -114,7 +115,7 @@ public class BookmarkDB extends SQLiteOpenHelper
|
||||
+ "'', "
|
||||
+ "'', "
|
||||
+ "3389, "
|
||||
+ "1, 1, 2, 2, 0, 0, 0, 0, '', '', 0);";
|
||||
+ "1, 1, 2, 2, 0, 0, 0, 0, '', '', 0, 0);";
|
||||
db.execSQL(sqlInsertDefaultSessionEntry);
|
||||
}
|
||||
|
||||
@ -149,6 +150,7 @@ public class BookmarkDB extends SQLiteOpenHelper
|
||||
+ "remote_program TEXT, "
|
||||
+ "work_dir TEXT, "
|
||||
+ "console_mode INTEGER, "
|
||||
+ "debug_level INTEGER DEFAULT 0, "
|
||||
|
||||
+ "FOREIGN KEY(screen_settings) REFERENCES tbl_screen_settings(" + ID + "), "
|
||||
+ "FOREIGN KEY(performance_flags) REFERENCES tbl_performance_flags(" + ID + "), "
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.freerdp.freerdpcore.utils;
|
||||
|
||||
public class BuildConfiguration {
|
||||
public static final String WITH_ANDROID_DEBUG_MENU = "@WITH_ANDROID_DEBUG_MENU@";
|
||||
|
||||
public static final int FREERDP_VERSION_MAJOR = @FREERDP_VERSION_MAJOR@;
|
||||
public static final int FREERDP_VERSION_MINOR = @FREERDP_VERSION_MINOR@;
|
||||
public static final int FREERDP_VERSION_REVISION = @FREERDP_VERSION_REVISION@;
|
||||
|
||||
public static final String FREERDP_VERSION_SUFFIX = "@FREERDP_VERSION_SUFFIX@";
|
||||
public static final String FREERDP_API_VERSION = "@FREERDP_API_VERSION@";
|
||||
public static final String FREERDP_VERSION = "@FREERDP_VERSION@";
|
||||
public static final String FREERDP_VERSION_FULL = "@FREERDP_VERSION_FULL@";
|
||||
public static final String GIT_REVISION = "@GIT_REVISION@";
|
||||
}
|
@ -21,6 +21,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/cmdline.h>
|
||||
|
||||
@ -418,7 +420,7 @@ int freerdp_client_add_dynamic_channel(rdpSettings* settings, int count, char**
|
||||
return 0;
|
||||
}
|
||||
|
||||
char** freerdp_command_line_parse_comma_separated_values(char* list, int* count)
|
||||
static char** freerdp_command_line_parse_comma_separated_values(char* list, int* count)
|
||||
{
|
||||
char** p;
|
||||
char* str;
|
||||
@ -428,6 +430,9 @@ char** freerdp_command_line_parse_comma_separated_values(char* list, int* count)
|
||||
|
||||
nArgs = nCommas = 0;
|
||||
|
||||
assert(NULL != count);
|
||||
|
||||
*count = 0;
|
||||
if (!list)
|
||||
return NULL;
|
||||
|
||||
@ -456,7 +461,7 @@ char** freerdp_command_line_parse_comma_separated_values(char* list, int* count)
|
||||
return p;
|
||||
}
|
||||
|
||||
char** freerdp_command_line_parse_comma_separated_values_offset(char* list, int* count)
|
||||
static char** freerdp_command_line_parse_comma_separated_values_offset(char* list, int* count)
|
||||
{
|
||||
char** p;
|
||||
|
||||
|
@ -93,7 +93,7 @@ set(${MODULE_NAME}_RESOURCES ${${MODULE_NAME}_RESOURCES} ${IOS_CLIENT_DIR}/Defau
|
||||
add_executable(${MODULE_NAME}
|
||||
${APP_TYPE}
|
||||
${${MODULE_PREFIX}_SRCS}
|
||||
${IOS_CLIENT_ADDITIONS_SRCS} ${IOS_CLIENT_ADDITIONS_HDRS}
|
||||
${IOS_CLIENT_ADDITIONS_SRCS} ${IOS_CLIENT_ADDITIONS_HDRS}
|
||||
${IOS_CLIENT_CONTROLLERS_SRCS} ${IOS_CLIENT_CONTROLLERS_HDRS}
|
||||
${IOS_CLIENT_FREERDP_SRCS} ${IOS_CLIENT_FREERDP_HDRS}
|
||||
${IOS_CLIENT_MISC_SRCS} ${IOS_CLIENT_MISC_HDRS}
|
||||
@ -117,6 +117,9 @@ set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_COMBINE_HIDPI_IM
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_SKIP_INSTALL NO)
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_INSTALL_PATH "/Applications")
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS YES)
|
||||
if (CODE_SIGN_IDENTITY)
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODE_SIGN_IDENTITY}")
|
||||
endif()
|
||||
|
||||
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${EXTRA_LIBS})
|
||||
|
||||
|
@ -344,7 +344,7 @@ set( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armea
|
||||
set( ANDROID_SUPPORTED_ABIS_x86 "x86" )
|
||||
set( ANDROID_SUPPORTED_ABIS_mipsel "mips" )
|
||||
|
||||
set( ANDROID_DEFAULT_NDK_API_LEVEL 8 )
|
||||
set( ANDROID_DEFAULT_NDK_API_LEVEL 9 )
|
||||
set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )
|
||||
set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 )
|
||||
|
||||
|
@ -21,6 +21,7 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
endif()
|
||||
|
||||
option(WITH_DEBUG_ANDROID_JNI "Enable debug output for android jni bindings" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_ANDROID_DEBUG_MENU "Enable debug output for android jni bindings" ${DEFAULT_DEBUG_OPTION})
|
||||
option(WITH_OPENSLES "Enable sound and microphone redirection using OpenSLES" ON)
|
||||
option(ANDROID_BUILD_JAVA "Automatically android java code - build type depends on CMAKE_BUILD_TYPE" ON)
|
||||
option(ANDROID_BUILD_JAVA_DEBUG "Create a android debug package" ${JAVA_DEBUG_DEFAULT})
|
||||
|
@ -28,7 +28,9 @@ find_package_handle_standard_args(OPENSLES DEFAULT_MSG
|
||||
if(OPENSLES_FOUND)
|
||||
set(OPENSLES_LIBRARIES ${OPENSLES_LIBRARY})
|
||||
else(OPENSLES_FOUND)
|
||||
set(OPENSLES_LIBRARIES)
|
||||
if (OpenSLES_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could NOT find OPENSLES")
|
||||
endif()
|
||||
endif(OPENSLES_FOUND)
|
||||
|
||||
mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY)
|
||||
|
@ -36,6 +36,9 @@ set (UNIX True)
|
||||
set (APPLE True)
|
||||
set (IOS True)
|
||||
|
||||
# Required as of cmake 2.8.10
|
||||
set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE)
|
||||
|
||||
# Determine the cmake host system version so we know where to find the iOS SDKs
|
||||
find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
|
||||
if (CMAKE_UNAME)
|
||||
@ -131,7 +134,7 @@ if (NOT DEFINED CMAKE_IOS_SDK_ROOT)
|
||||
list (REVERSE _CMAKE_IOS_SDKS)
|
||||
list (GET _CMAKE_IOS_SDKS 0 CMAKE_IOS_SDK_ROOT)
|
||||
else (_CMAKE_IOS_SDKS)
|
||||
message (FATAL_ERROR "No iOS SDK's found in default seach path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
|
||||
message (FATAL_ERROR "No iOS SDK's found in default search path ${CMAKE_IOS_DEVELOPER_ROOT}. Manually set CMAKE_IOS_SDK_ROOT or install the iOS SDK.")
|
||||
endif (_CMAKE_IOS_SDKS)
|
||||
message (STATUS "Toolchain using default iOS SDK: ${CMAKE_IOS_SDK_ROOT}")
|
||||
endif (NOT DEFINED CMAKE_IOS_SDK_ROOT)
|
||||
|
@ -18,7 +18,7 @@ Build requirements
|
||||
For the Android port some additional dependencies need to be fulfilled:
|
||||
|
||||
* for JNI
|
||||
- Android NDK (>= r8d)
|
||||
- Android NDK (>= r9)
|
||||
- prebuild static openssl libraries (see below)
|
||||
|
||||
* for the Java GUI (if build with ant)
|
||||
|
@ -4,7 +4,6 @@ Overview
|
||||
The FreeRDP iOS port allows users to enjoy FreeRDP features on Apple iOS devices.
|
||||
The application was written to be compatible with devices running iOS 4.3 or higher.
|
||||
|
||||
|
||||
Build requirements
|
||||
==================
|
||||
|
||||
@ -13,6 +12,7 @@ The following prerequisites are required in order to build the iOS port:
|
||||
- cmake version >= 2.8.9
|
||||
- latest Xcode installed (>= 4.6)
|
||||
- installed Provisioning Profile and iOS Developer Certificate for code signing
|
||||
(not required for simulator builds)
|
||||
- pre-build static OpenSSL libraries (see below)
|
||||
|
||||
FreeRDP requires OpenSSL libraries for building but they are not part of the iOS SDK and therefore they need to be pre-build manually.
|
||||
@ -23,12 +23,28 @@ If you don't care about modifying the OpenSSL build you can run the following co
|
||||
|
||||
./scripts/OpenSSL-DownloadAndBuild.command
|
||||
|
||||
The script is using the latest iOS SDK 6.1 to build the OpenSSL libraries.
|
||||
If you want to use a different SDK version simply edit the OpenSSL-iFreeRDP.diff file and modify the -isysroot parameters to point to the SDK version you want to build with.
|
||||
The output of the script will be found in external/openssl/. In case you want a
|
||||
different install/build directory you specify it as first parameter:
|
||||
|
||||
When the script finishes the external/openssl/lib subfolder will contain libcrypto.a and libssl.a, both universal binary libraries containing arm and i386 targets in order to compile FreeRDP for iOS devices and the simulator.
|
||||
./scripts/OpenSSL-DownloadAndBuild.command /tmp/
|
||||
|
||||
If you build OpenSSL youself you need to set FREERDP_IOS_EXTERNAL_SSL_PATH when running cmake.
|
||||
In the example above the output can then be found in /tmp/openssl.
|
||||
|
||||
The script uses oldest iOS/iPhoneSimulator SDK found on the build machine per default. If you need to build against a different SDK you can set USER_OS_SDK
|
||||
and/or USER_SIM_SDK in the top of the build script to the SDK version you need. E.g.:
|
||||
|
||||
USER_SIM_SDK="iPhoneSimulator6.0.sdk"
|
||||
|
||||
When the script is finished you will find libcrypto.a and libssl.at, both universal libraries containing all openssl/lib
|
||||
subfolder in the specified
|
||||
install directory (external per default)
|
||||
|
||||
When the script finishes you will find libcrypto.a and libssl.a, both universal
|
||||
binary libraries containing arm and i386 targets in order to compile FreeRDP for
|
||||
iOS devices and the simulator, in the lib subfolder of your installation
|
||||
directory.
|
||||
|
||||
If you build OpenSSL youself or with an install directory specified you need to set FREERDP_IOS_EXTERNAL_SSL_PATH when running cmake.
|
||||
|
||||
|
||||
Building
|
||||
@ -45,12 +61,15 @@ Alternatively you can also build the project from the command line using xcodebu
|
||||
|
||||
xcodebuild -project FreeRDP.xcodeproj -configuration Debug -sdk iphoneos6.1
|
||||
|
||||
or with cmake --build . in your build directory.
|
||||
|
||||
Notes:
|
||||
|
||||
* XCode, by default will build the application into its derived data location (usually in ~/Library/Developer/...).
|
||||
If you want to specify an output directory add CONFIGURATION_BUILD_DIR=<output-path-here> to the end of above command line.
|
||||
|
||||
* If using XCode choose "Open Other" from the welcome screen, browse to the FreeRDP root directory and select FreeRDP.xcodeproj.
|
||||
* If using XCode choose "Open Other" from the welcome screen, browse to the FreeRDP root directory and select FreeRDP.xcodeproj. Alternatively you can
|
||||
also start it with "open FreeRDP.xcodeproj".
|
||||
|
||||
* If you switch between platforms (OS and SIMULATOR) please remove CMakeCache.txt and CMakeFiles/ before calling cmake again.
|
||||
Otherwise build errors might occur (this seems to be a bug with cmake or the cmake scripts). To switch between platforms do:
|
||||
@ -79,3 +98,5 @@ CMAKE_IOS_SDK_ROOT (used by toolchain file)
|
||||
FREERDP_IOS_EXTERNAL_SSL_PATH (used by FindOpenSSL)
|
||||
* absolut root path to the pre-built static OpenSSL libraries
|
||||
|
||||
CODE_SIGN_IDENTITY
|
||||
* specify the identity to sign the code with
|
||||
|
@ -1,24 +1,88 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright 2013 Thinstuff Technologies GmbH
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
||||
# If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# This script will download and build openssl for iOS (armv7, armv7s) and i386
|
||||
#
|
||||
# This script will download and build openssl for iOS (armv7, armv7s) and simulator (i386)
|
||||
|
||||
# Settings and definitions
|
||||
USER_OS_SDK=""
|
||||
USER_SIM_SDK=""
|
||||
|
||||
OPENSSLVERSION="1.0.0e"
|
||||
MD5SUM="7040b89c4c58c7a1016c0dfa6e821c86"
|
||||
OPENSSLPATCH="../../scripts/OpenSSL-iFreeRDP.diff"
|
||||
CORES=`sysctl hw.ncpu | awk '{print $2}'`
|
||||
OPENSSLPATCH="OpenSSL-iFreeRDP.diff"
|
||||
INSTALLDIR="external"
|
||||
|
||||
MAKEOPTS="-j $CORES"
|
||||
# disable parallell builds since openssl build
|
||||
# fails sometimes
|
||||
MAKEOPTS=""
|
||||
CORES=`sysctl hw.ncpu | awk '{print $2}'`
|
||||
SCRIPTDIR=$(dirname `cd ${0%/*} && echo $PWD/${0##*/}`)
|
||||
OS_SDK=""
|
||||
SIM_SDK=""
|
||||
OS_SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs"
|
||||
SIM_SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs"
|
||||
|
||||
cd external
|
||||
# Functions
|
||||
function buildArch(){
|
||||
ARCH=$1
|
||||
LOGFILE="BuildLog.darwin-${ARCH}.txt"
|
||||
echo "Building architecture ${ARCH}. Please wait ..."
|
||||
./Configure darwin-${ARCH}-cc > ${LOGFILE}
|
||||
make ${MAKEOPTS} >> ${LOGFILE} 2>&1
|
||||
echo "Done. Build log saved in ${LOGFILE}"
|
||||
cp libcrypto.a ../../lib/libcrypto_${ARCH}.a
|
||||
cp libssl.a ../../lib/libssl_${ARCH}.a
|
||||
make clean >/dev/null 2>&1
|
||||
echo
|
||||
}
|
||||
|
||||
# main
|
||||
if [ $# -gt 0 ];then
|
||||
INSTALLDIR=$1
|
||||
if [ ! -d $INSTALLDIR ];then
|
||||
echo "Install directory \"$INSTALLDIR\" does not exist"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Detecting SDKs..."
|
||||
if [ "x${USER_OS_SDK}" == "x" ];then
|
||||
OS_SDK=`ls -1 ${OS_SDK_PATH} | sort -n | head -1`
|
||||
if [ "x${OS_SDK}" == "x" ];then
|
||||
echo "No iPhoneOS SDK found"
|
||||
exit 1;
|
||||
fi
|
||||
else
|
||||
OS_SDK=${USER_OS_SDK}
|
||||
if [ ! -d "${OS_SDK_PATH}/${OS_SDK}" ];then
|
||||
echo "User specified iPhoneOS SDK not found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "Using iPhoneOS SDK: ${OS_SDK}"
|
||||
|
||||
if [ "x${USER_SIM_SDK}" == "x" ];then
|
||||
SIM_SDK=`ls -1 ${SIM_SDK_PATH} | sort -n | head -1`
|
||||
if [ "x${SIM_SDK}" == "x" ];then
|
||||
echo "No iPhoneSimulator SDK found"
|
||||
exit 1;
|
||||
fi
|
||||
else
|
||||
SIM_SDK=${USER_SIM_SDK}
|
||||
if [ ! -d "${SIM_SDK_PATH}/${SIM_SDK}" ];then
|
||||
echo "User specified iPhoneSimulator SDK not found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "Using iPhoneSimulator SDK: ${SIM_SDK}"
|
||||
echo
|
||||
|
||||
cd $INSTALLDIR
|
||||
if [ ! -d openssl ];then
|
||||
mkdir openssl
|
||||
fi
|
||||
@ -36,6 +100,7 @@ if [ ! "$CS" = "$MD5SUM" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# remove old build dir
|
||||
rm -rf openssltmp
|
||||
mkdir openssltmp
|
||||
cd openssltmp
|
||||
@ -49,9 +114,12 @@ fi
|
||||
echo
|
||||
|
||||
echo "Applying iFreeRDP patch ..."
|
||||
|
||||
cd "openssl-$OPENSSLVERSION"
|
||||
patch -p1 < "../../$OPENSSLPATCH"
|
||||
cp ${SCRIPTDIR}/${OPENSSLPATCH} .
|
||||
sed -ie "s#__ISIMSDK__#${SIM_SDK}#" ${OPENSSLPATCH}
|
||||
sed -ie "s#__IOSSDK__#${OS_SDK}#" ${OPENSSLPATCH}
|
||||
|
||||
patch -p1 < $OPENSSLPATCH
|
||||
|
||||
if [ ! $? = 0 ]; then
|
||||
echo "Patch failed."
|
||||
@ -59,6 +127,7 @@ if [ ! $? = 0 ]; then
|
||||
fi
|
||||
echo
|
||||
|
||||
# Cleanup old build artifacts
|
||||
mkdir -p ../../include/openssl
|
||||
rm -f ../../include/openssl/*.h
|
||||
|
||||
@ -69,36 +138,12 @@ echo "Copying header hiles ..."
|
||||
cp include/openssl/*.h ../../include/openssl/
|
||||
echo
|
||||
|
||||
echo "Building sim version (for simulator). Please wait ..."
|
||||
./Configure darwin-sim-cc >BuildLog.darwin-sim.txt
|
||||
make ${MAKEOPTS} >>BuildLog.darwin-sim.txt 2>&1
|
||||
echo "Done. Build log saved in BuildLog.darwin-sim.txt"
|
||||
cp libcrypto.a ../../lib/libcrypto_sim.a
|
||||
cp libssl.a ../../lib/libssl_sim.a
|
||||
make clean >/dev/null 2>&1
|
||||
echo
|
||||
|
||||
echo "Building armv7 version (for iPhone). Please wait ..."
|
||||
./Configure darwin-armv7-cc >BuildLog.darwin-armv7.txt
|
||||
make ${MAKEOPTS} >>BuildLog.darwin-armv7.txt 2>&1
|
||||
echo "Done. Build log saved in BuildLog.darwin-armv7.txt"
|
||||
cp libcrypto.a ../../lib/libcrypto_armv7.a
|
||||
cp libssl.a ../../lib/libssl_armv7.a
|
||||
make clean >/dev/null 2>&1
|
||||
echo
|
||||
|
||||
echo "Building armv7s version (for iPhone). Please wait ..."
|
||||
./Configure darwin-armv7s-cc >BuildLog.darwin-armv7s.txt
|
||||
make ${MAKEOPTS} >>BuildLog.darwin-armv7s.txt 2>&1
|
||||
echo "Done. Build log saved in BuildLog.darwin-armv7s.txt"
|
||||
cp libcrypto.a ../../lib/libcrypto_armv7s.a
|
||||
cp libssl.a ../../lib/libssl_armv7s.a
|
||||
make clean >/dev/null 2>&1
|
||||
echo
|
||||
buildArch i386
|
||||
buildArch armv7
|
||||
buildArch armv7s
|
||||
|
||||
echo "Combining to unversal binary"
|
||||
lipo -create ../../lib/libcrypto_sim.a ../../lib/libcrypto_armv7.a ../../lib/libcrypto_armv7s.a -o ../../lib/libcrypto.a
|
||||
lipo -create ../../lib/libssl_sim.a ../../lib/libssl_armv7.a ../../lib/libssl_armv7s.a -o ../../lib/libssl.a
|
||||
|
||||
echo "Finished. Please verify the contens of the openssl folder in your main project folder"
|
||||
lipo -create ../../lib/libcrypto_*.a -o ../../lib/libcrypto.a
|
||||
lipo -create ../../lib/libssl_*.a -o ../../lib/libssl.a
|
||||
|
||||
echo "Finished. Please verify the contens of the openssl folder in \"$INSTALLDIR\""
|
||||
|
@ -5,9 +5,9 @@ diff -rupN openssl-1.0.0e-ori/Configure openssl-1.0.0e/Configure
|
||||
"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
"debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
+"darwin-armv7s-cc","/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc:-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
+"darwin-armv7-cc","/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc:-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
+"darwin-sim-cc","/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc: -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common: -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
+"darwin-armv7s-cc","/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang:-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/__IOSSDK__ -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
+"darwin-armv7-cc","/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang:-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/__IOSSDK__ -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch armv4 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
+"darwin-i386-cc","/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang: -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/__ISIMSDK__ -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common: -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
|
||||
|
||||
##### A/UX
|
||||
"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::",
|
||||
|
@ -1,45 +1,56 @@
|
||||
/**
|
||||
* CTest for winpr's SetLastError/GetLastError
|
||||
*
|
||||
* Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* Copyright 2013 Thinstuff Technologies GmbH
|
||||
* Copyright 2013 Norbert Federa <nfedera@thinstuff.at>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/synch.h>
|
||||
#include <winpr/thread.h>
|
||||
#include <winpr/interlocked.h>
|
||||
|
||||
#include <winpr/error.h>
|
||||
|
||||
static int status = 0;
|
||||
|
||||
static DWORD errors[4] =
|
||||
{
|
||||
ERROR_INVALID_DATA,
|
||||
ERROR_BROKEN_PIPE,
|
||||
ERROR_INVALID_NAME,
|
||||
ERROR_BAD_ARGUMENTS
|
||||
};
|
||||
LONG *pLoopCount = NULL;
|
||||
BOOL bStopTest = FALSE;
|
||||
|
||||
static void* test_error_thread(void* arg)
|
||||
{
|
||||
int id;
|
||||
DWORD error;
|
||||
DWORD dwErrorSet;
|
||||
DWORD dwErrorGet;
|
||||
|
||||
id = (int) (size_t) arg;
|
||||
|
||||
error = errors[id];
|
||||
|
||||
SetLastError(error);
|
||||
|
||||
Sleep(10);
|
||||
|
||||
error = GetLastError();
|
||||
|
||||
if (error != errors[id])
|
||||
{
|
||||
printf("GetLastError() failure (thread %d): Expected: 0x%04X, Actual: 0x%04X\n",
|
||||
id, errors[id], error);
|
||||
|
||||
if (!status)
|
||||
status = -1;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
do {
|
||||
dwErrorSet = (DWORD)rand();
|
||||
SetLastError(dwErrorSet);
|
||||
if ((dwErrorGet = GetLastError()) != dwErrorSet)
|
||||
{
|
||||
printf("GetLastError() failure (thread %d): Expected: 0x%04X, Actual: 0x%04X\n",
|
||||
id, dwErrorSet, dwErrorGet);
|
||||
if (!status)
|
||||
status = -1;
|
||||
break;
|
||||
}
|
||||
InterlockedIncrement(pLoopCount);
|
||||
} while (!status && !bStopTest);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -60,11 +71,18 @@ int TestErrorSetLastError(int argc, char* argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
pLoopCount = _aligned_malloc(sizeof(LONG), sizeof(LONG));
|
||||
*pLoopCount = 0;
|
||||
|
||||
threads[0] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_error_thread, (void*) (size_t) 0, 0, NULL);
|
||||
threads[1] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_error_thread, (void*) (size_t) 1, 0, NULL);
|
||||
threads[2] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_error_thread, (void*) (size_t) 2, 0, NULL);
|
||||
threads[3] = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) test_error_thread, (void*) (size_t) 3, 0, NULL);
|
||||
|
||||
// let the threads run for at least 2 seconds
|
||||
Sleep(2000);
|
||||
bStopTest = TRUE;
|
||||
|
||||
WaitForSingleObject(threads[0], INFINITE);
|
||||
WaitForSingleObject(threads[1], INFINITE);
|
||||
WaitForSingleObject(threads[2], INFINITE);
|
||||
@ -84,6 +102,14 @@ int TestErrorSetLastError(int argc, char* argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (*pLoopCount < 4)
|
||||
{
|
||||
printf("Error: unexpected loop count\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("Completed %lu iterations.\n", *pLoopCount);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
* Windows Native System Services
|
||||
*
|
||||
* Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
* Copyright 2013 Thinstuff Technologies GmbH
|
||||
* Copyright 2013 Norbert Federa <nfedera@thinstuff.at>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -34,170 +36,35 @@
|
||||
|
||||
#include <winpr/crt.h>
|
||||
|
||||
/**
|
||||
* The current implementation of NtCurrentTeb() is not the most efficient
|
||||
* but it's a starting point. Beware of potential performance bottlenecks
|
||||
* caused by multithreaded usage of SetLastError/GetLastError.
|
||||
*/
|
||||
static pthread_once_t _TebOnceControl = PTHREAD_ONCE_INIT;
|
||||
static pthread_key_t _TebKey;
|
||||
|
||||
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
static PPEB g_ProcessEnvironmentBlock = NULL;
|
||||
|
||||
static void NtThreadEnvironmentBlockFree(PTEB teb);
|
||||
static void NtProcessEnvironmentBlockFree(PPEB peb);
|
||||
|
||||
static PTEB NtThreadEnvironmentBlockNew()
|
||||
static void _TebDestruct(void *teb)
|
||||
{
|
||||
PTEB teb = NULL;
|
||||
pthread_key_t key;
|
||||
|
||||
teb = (PTEB) malloc(sizeof(TEB));
|
||||
|
||||
if (teb)
|
||||
{
|
||||
ZeroMemory(teb, sizeof(TEB));
|
||||
|
||||
/**
|
||||
* We are not really using the key, but it provides an automatic way
|
||||
* of calling NtThreadEnvironmentBlockFree on thread termination for
|
||||
* the current Thread Environment Block.
|
||||
*/
|
||||
|
||||
pthread_key_create(&key, (void (*)(void*)) NtThreadEnvironmentBlockFree);
|
||||
pthread_setspecific(key, (void*) teb);
|
||||
}
|
||||
|
||||
return teb;
|
||||
}
|
||||
|
||||
static void NtThreadEnvironmentBlockFree(PTEB teb)
|
||||
{
|
||||
DWORD index;
|
||||
PPEB peb = NULL;
|
||||
|
||||
peb = teb->ProcessEnvironmentBlock;
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
|
||||
for (index = 0; index < peb->ThreadArraySize; index++)
|
||||
{
|
||||
if (peb->Threads[index].ThreadEnvironmentBlock == teb)
|
||||
{
|
||||
peb->Threads[index].ThreadId = 0;
|
||||
peb->Threads[index].ThreadEnvironmentBlock = NULL;
|
||||
peb->ThreadCount--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!peb->ThreadCount)
|
||||
{
|
||||
NtProcessEnvironmentBlockFree(peb);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&mutex);
|
||||
|
||||
free(teb);
|
||||
}
|
||||
|
||||
static PPEB NtProcessEnvironmentBlockNew()
|
||||
static void _TebInitOnce(void)
|
||||
{
|
||||
PPEB peb = NULL;
|
||||
|
||||
peb = (PPEB) malloc(sizeof(PEB));
|
||||
|
||||
if (peb)
|
||||
{
|
||||
ZeroMemory(peb, sizeof(PEB));
|
||||
|
||||
peb->ThreadCount = 0;
|
||||
peb->ThreadArraySize = 64;
|
||||
peb->Threads = (THREAD_BLOCK_ID*) malloc(sizeof(THREAD_BLOCK_ID) * peb->ThreadArraySize);
|
||||
|
||||
if (peb->Threads)
|
||||
{
|
||||
ZeroMemory(peb->Threads, sizeof(THREAD_BLOCK_ID) * peb->ThreadArraySize);
|
||||
}
|
||||
}
|
||||
|
||||
return peb;
|
||||
}
|
||||
|
||||
static void NtProcessEnvironmentBlockFree(PPEB peb)
|
||||
{
|
||||
if (peb)
|
||||
{
|
||||
free(peb->Threads);
|
||||
free(peb);
|
||||
}
|
||||
|
||||
g_ProcessEnvironmentBlock = NULL;
|
||||
}
|
||||
|
||||
PPEB NtCurrentPeb(void)
|
||||
{
|
||||
PPEB peb = NULL;
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
|
||||
if (!g_ProcessEnvironmentBlock)
|
||||
g_ProcessEnvironmentBlock = NtProcessEnvironmentBlockNew();
|
||||
|
||||
peb = g_ProcessEnvironmentBlock;
|
||||
|
||||
pthread_mutex_unlock(&mutex);
|
||||
|
||||
return peb;
|
||||
pthread_key_create(&_TebKey, _TebDestruct);
|
||||
}
|
||||
|
||||
PTEB NtCurrentTeb(void)
|
||||
{
|
||||
DWORD index;
|
||||
int freeIndex;
|
||||
DWORD ThreadId;
|
||||
PPEB peb = NULL;
|
||||
PTEB teb = NULL;
|
||||
|
||||
peb = NtCurrentPeb();
|
||||
|
||||
ThreadId = (DWORD) pthread_self();
|
||||
|
||||
freeIndex = -1;
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
|
||||
for (index = 0; index < peb->ThreadArraySize; index++)
|
||||
if (pthread_once(&_TebOnceControl, _TebInitOnce) == 0)
|
||||
{
|
||||
if (!peb->Threads[index].ThreadId)
|
||||
if ((teb = pthread_getspecific(_TebKey)) == NULL)
|
||||
{
|
||||
if (freeIndex < 0)
|
||||
freeIndex = (int) index;
|
||||
}
|
||||
|
||||
if (peb->Threads[index].ThreadId == ThreadId)
|
||||
{
|
||||
teb = peb->Threads[index].ThreadEnvironmentBlock;
|
||||
break;
|
||||
teb = malloc(sizeof(TEB));
|
||||
if (teb)
|
||||
{
|
||||
ZeroMemory(teb, sizeof(TEB));
|
||||
pthread_setspecific(_TebKey, teb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!teb)
|
||||
{
|
||||
if (freeIndex >= 0)
|
||||
{
|
||||
teb = NtThreadEnvironmentBlockNew();
|
||||
peb->Threads[freeIndex].ThreadEnvironmentBlock = teb;
|
||||
peb->Threads[freeIndex].ThreadId = ThreadId;
|
||||
peb->ThreadCount++;
|
||||
|
||||
teb->ProcessEnvironmentBlock = peb;
|
||||
teb->LastErrorValue = 0;
|
||||
}
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&mutex);
|
||||
|
||||
return teb;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ endif()
|
||||
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
||||
MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL
|
||||
MODULE winpr
|
||||
MODULES winpr-handle winpr-interlocked winpr-thread)
|
||||
MODULES winpr-handle winpr-interlocked winpr-thread winpr-sysinfo)
|
||||
|
||||
if(MONOLITHIC_BUILD)
|
||||
set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
|
||||
|
Loading…
Reference in New Issue
Block a user