Skip to content

Commit

Permalink
Since so many bugs have been fixed, doing a release as 1.2.2, before …
Browse files Browse the repository at this point in the history
…the 1.3 work.
  • Loading branch information
jp-bennett committed Sep 10, 2016
1 parent cbd0ff9 commit fd3c1a4
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ model {
applicationId = "org.cipherdyne.fwknop2"
minSdkVersion.apiLevel = 16
targetSdkVersion.apiLevel = 24
versionCode = 25
versionName = "1.3.0"
versionCode = 27
versionName = "1.2.2"
}
//lintOptions {
// abortOnError = false
Expand Down
6 changes: 1 addition & 5 deletions app/src/main/java/biz/incomsystems/fwknop2/Config.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package biz.incomsystems.fwknop2;

import android.util.Log;

import org.apache.commons.validator.routines.DomainValidator;
import org.apache.commons.validator.routines.InetAddressValidator;

import java.util.UUID;

public class Config {
Expand Down Expand Up @@ -69,7 +65,7 @@ public int Is_Valid(){
return(R.string.port_format);
} else if (!(this.ACCESS_IP.equalsIgnoreCase("Allow IP") || this.ACCESS_IP.equalsIgnoreCase("Resolve IP") || this.ACCESS_IP.equalsIgnoreCase("Prompt IP") || (ipValidate.isValid(this.ACCESS_IP)))){ //Have to have a valid ip to allow, if using allow ip
return(R.string.valid_ip);
} else if (!ipValidate.isValid(this.SERVER_IP) && !DomainValidator.getInstance().isValid(this.SERVER_IP)) { // check server entry. Must be a valid url or ip.
} else if (!this.SERVER_IP.contains(".")) { // very loose checking, throws error when knocking.
return(R.string.valid_server);
} else if (this.juice_uuid == null) { //This one might have to go in the main function
return (R.string.juice_first);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
Expand Down Expand Up @@ -353,7 +354,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_config_detail, container, false);
active_Nick = getArguments().getString("item_id");
myJuice = new PluginContract();
try {
myJuice = new PluginContract();
} catch (Exception e) {
Log.e("fwknop2", "Juicessh exception");
}

//Handlers for the input fields
txt_NickName = (TextView) rootView.findViewById(R.id.NickName);
Expand Down Expand Up @@ -478,32 +483,39 @@ public void onItemSelected(AdapterView<?> parent, View view,
spn_juice.setVisibility(View.GONE);
} else if (pos == 3) {
if (getActivity().checkCallingOrSelfPermission("com.sonelli.juicessh.api.v1.permission.READ_CONNECTIONS") == PackageManager.PERMISSION_GRANTED) {

lay_sshcmd.setVisibility(View.GONE);
lay_ovpncmd.setVisibility(View.GONE);

if (connectionListLoader == null) {
connectionListLoader = new ConnectionListLoader(getActivity(), juice_adapt);
connectionListLoader.setOnLoadedListener(new ConnectionListLoader.OnLoadedListener() {
@Override
public void onLoaded() { // This is so ugly...
spn_juice.setVisibility(View.VISIBLE);
if (config.SSH_CMD.contains("juice:") && spn_juice.getCount() > 0) {
for (int n = 0; n < spn_juice.getCount(); n++) {
if (config.SSH_CMD.contains(juice_adapt.getConnectionName(n))) {
spn_juice.setSelection(n);
try {
lay_sshcmd.setVisibility(View.GONE);
lay_ovpncmd.setVisibility(View.GONE);

if (connectionListLoader == null) {

connectionListLoader = new ConnectionListLoader(getActivity(), juice_adapt);
connectionListLoader.setOnLoadedListener(new ConnectionListLoader.OnLoadedListener() {
@Override
public void onLoaded() { // This is so ugly...
spn_juice.setVisibility(View.VISIBLE);
if (config.SSH_CMD.contains("juice:") && spn_juice.getCount() > 0) {
for (int n = 0; n < spn_juice.getCount(); n++) {
if (config.SSH_CMD.contains(juice_adapt.getConnectionName(n))) {
spn_juice.setSelection(n);
}
}
}
}
}
});
getActivity().getSupportLoaderManager().initLoader(0, null, connectionListLoader);
} else {
getActivity().getSupportLoaderManager().restartLoader(0, null, connectionListLoader);
});
getActivity().getSupportLoaderManager().initLoader(0, null, connectionListLoader);
} else {
getActivity().getSupportLoaderManager().restartLoader(0, null, connectionListLoader);
}
} catch (Exception e) {
Log.e("fwknop2", "Juicessh error");
}
} else {
Context context = getActivity();
CharSequence text = getText(R.string.juice_permissions);
if(Build.VERSION.SDK_INT < 23) {
text = getText(R.string.juice_permissions_reinstall);
}
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, text, duration);
toast.setGravity(Gravity.CENTER, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/biz/incomsystems/fwknop2/SendSPA.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public int send(String nick, final Activity newAct) {
final AlertDialog.Builder IPPrompt = new AlertDialog.Builder(ourAct);
IPPrompt.setTitle("Source IP");
final EditText input = new EditText(ourAct);
input.setInputType(InputType.TYPE_CLASS_TEXT);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
IPPrompt.setView(input);
IPPrompt.setPositiveButton(ourAct.getResources().getText(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_config_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="62201"
android:inputType="text"
android:inputType="numberDecimal"
android:singleLine="true"
android:textSize="20sp"
/>
Expand Down Expand Up @@ -256,7 +256,7 @@
android:layout_height="wrap_content"
android:text=""
android:singleLine="true"
android:inputType="phone"
android:inputType="numberDecimal"
android:textSize="20sp"
/>
</LinearLayout>
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<string name="cancel">Cancel</string>
<string name="sending">Sending&#8230;</string>
<string name="new_config">New config</string>
<string name="juice_permissions">Fwknop2 does not have permission to access Juicessh connection list. Please reinstall Fwknop2.</string>
<string name="juice_permissions">Fwknop2 does not have permission to access Juicessh connection list.</string>
<string name="juice_permissions_reinstall">Fwknop2 does not have permission to access Juicessh connection list. Please reinstall Fwknop2.</string>
<string name="description_short">A new fwknop client to send SPA packets to an fwknopd server</string>
<string name="description_long">Fwknop2 allows you to send spa packets to an fwknopd service to remotely open ports on a Linux machine or a router running OpenWrt.
Fwknop2 has the ability to launch an ssh client to start the login process through the newly opened port.
Expand Down Expand Up @@ -86,7 +87,7 @@
<p>
The "Allow IP" option specifies what IP to send as the source address. The "prompt" option will ask
for the IP to allow when a knock is sent. This prompt has an option to scan a qr code containing an
IP address. This service is provided at <a href="https://incomsystems.biz/fwknop-gui/qr.php">https://incomsystems.biz/fwknop-gui/qr.php</a>.
IP address. This service is provided at <a href="https://qr.incom.co">https://qr.incom.co</a>.
</p>
<p>
Once the data is filled in, select "Save Config" from the menu. Then, to send a SPA knock, select the
Expand All @@ -103,7 +104,7 @@
Once sending knocks via NFC is enabled, scanning an NFC token sends the associated knock.
This process will work even if Fwknop2 is not currently opened.
</p>
<p>This app is open source software, Licensed GPLv2+. The source can be found <a href="https://github.com/oneru/Fwknop2">on github</a>. Please report any bugs here.</p>
<p>This app is open source software, Licensed GPLv2+. The source can be found <a href="https://github.com/jp-bennett/Fwknop2">on github</a>. Please report any bugs here.</p>
<p>Credits: Based on fwknop and libfko written by <a href="https://www.cipherdyne.org/fwknop/"> Michael Rash</a></p>
<p>This app was written by <a href="http://incomsystems.biz/">Jonathan Bennett</a></p>
<p>The fwknop2 icon is derived from a photo by <a href="https://www.flickr.com/photos/anemoneprojectors/5330583056/">Peter O\'Connor</a></p>
Expand Down

0 comments on commit fd3c1a4

Please sign in to comment.