Skip to content

Commit

Permalink
Updates for 0.5.20
Browse files Browse the repository at this point in the history
  • Loading branch information
retsamknaps committed Aug 22, 2017
1 parent ce9623c commit bd77b90
Show file tree
Hide file tree
Showing 14 changed files with 1,227 additions and 1,000 deletions.
1,943 changes: 988 additions & 955 deletions aktie_node/defseed.dat

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions aktie_node/developerid.dat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{"sig":"dSJt5LiauB6HoU2znYceCwd33LIhumWI8FFzmh1qg9txT2eg4Ou2fKTLMSb3g/MdbcJlJrDamVpWCT8B6b70lZutwCl/UDNQRswzx/ZjS168eankvN387lww3tBGoAXXwtZTwSWIYwavW/4QkZRO36NLaSSmeMp5BqFEJOq913n5m6E12NNrtxStuMWWelvkK7YdCT211NOgLsP81VkJgx2Dx+L92sd3/jPWitLmsLx6cPW3ZG7jVnIoeVW3p6/GoTCqqercZ4qknlookVsJkiqrpPCsNKEpL6Q/MRz9kgoW6knpaUnnIHUiAvOSGMz9ZG+hYdlxz7RheFBm6/iJfQ==","dig":"SKBH55+i0CTri8Rxu0kP2ZjYwlt8rZWIp1Fpjou8KcA=","strings":{"name":"developer","dest":"WoJJS6Hg5LY0k-CLnfNpQExPQUdCFyuy4HYDJbvyP2gqSyrugsnBKaXQuxKEejcxAyGGMxZmSu6wm7RryMUAIEgZHN~asAw4xVfV35ZhNzD5uSThgjKheagPyO70mbyZeulGUfT~PPu-zuwhawCkaTUpDyJMLJDskr~J-fkoGNCax5HnDoAYNIrHavK~ouD5lyDmL36Ea9xcfMGvnx759DqQDJ7hJvFuSbFAlUNDyUorI2jzOLEhAToe7W~c7TK0b8Im1ElMuD6nHoLHmbrmNaq1IXWAzLP0Z-h2bHnxefrn0s18TLcntnZDKcrPJqeCVQGNhf2xw1OVd~q6FN~8B19YoBxi-WoYP7QnLCkBi7E7uheOqNfS~gRbXNfwH9UEpT2h0TilNFg74jrNccp51szaAZU1Qs0xGdE5n64BFaQ6lJif6IOuRYX6kUq6dqq28Hppg0S4vI61MEh7EX10LAtUZ4rqXU9uOTUAsZWJjyTHrI8lqyBiECqQT0icOVKhAAAA","key":"AIr4eodyk3b0MFgbys7q9IsXnodptk2MnYBx6ItEM1ahjvpIcYJg1QtKU8bUtcSFy6Quq5HG5Lx/25oAka4ZCm8xsq64o3raTWb9sdvPv+hBjKCTdKdp466c56RVIWYNIj1sHfOKWF/2S/bJ9LhVVBmOfDylnZZwsJZn3MwGyypuaXl280ybYJNxe3S1OTcfP/25C5Rl6AcGUrRuGWFpbrGo21FJQ5BsjJos5bcol1WPpM77ih1njr7wZ/1plj8MeDoWs8qvblrodmQ8DX42A9AyWZuvWU0y6s7ZXE43R3Qu9UGqPONJcYGaxmlzVgCB04jHWLS9IoAtUAlip6/EL8U=,AQAB","desc":"Aktie developer identity."},"id":"LBFsG6LfzZlkzO1UjeqoOTSXCRPz9JVc9kknGvmfAq8=","type":"identity"}
{"id":"wM4zsjFiGyESShvKSTX4HEV5TM0NlsPZU0gvPsL1554=","strings":{"desc":"The second official developer id for Aktie.","dest":"meUja4xOlqHtCQ4agxLFC~~erRlCXX7jfSzgXkNhUAv9nZvpGjJoQitIz6-VXAM1GLvaNbE4MwMiVVsHXUTBYPBUedjX8-aHZRdL3Hgr20X1dkVC9Esw0w0ne7QsDgqXeWipzmohPsWTe-M8qi4phhP1of1~kTAHv6p-QNvOgtQP-gRrdbrmIyhgw8ss43AC4rxAZYzHWjhHFrS7R~DiBJ~yaXCoErC6APjl-l9i04IrybYVHHri8W2N3RjVACKgXZ0PgMKi5tSG7vYWhYzVTlbwNhDXAmNQEZsnsPgzAwCj-fLYTyyyRwlwSy-cMieZsuZEpA2RB6M0npe8-LdzD5XZ0dcU2ctRSAq6O90UDTC7T5Rmvu5YZXYqD1JZaX9gLCIKBb~2tvDizHQ7z8leEduONPZ66cHcpyKN5YPKpSnknRp8ZTnt10iHbMn9EYdQqWdUwEzp0~Ntp0eI5fanffv9L~BTwlgndCyblNA85X5YC3styF~G00K8fhnhTNSkAAAA","name":"developer2","key":"AIq1nQdjOk4QHZilkxTKCHmui/u2HIH2b1Fg9FFC0I1XgUdv5WUAS8hLonqIkSI+DwczmRUZ9o1I3hOkQoDDjD80w+lJxRGpO9RzFMA13AXayeMsuCGYqT/hs+mxaxA4cn1ax0ameN1RVQLDXUgbzC+MruhY3e3EjS15reZk3XKMb03a+sohMc4g7MaCxaVbH6fv79k4F/ZNUy44CGe8URUoUUswuCEhMJpaaaYCrSnvaQx1K9QyL7ImBEhns9zoLpunCXkBgY1CSr1rWAI96CY/hoC5cAW4Dtne2958Sbz4XO7kFerhU4BJ4nUbktgoh/QseyYolD2tGqwoqt2DN4c=,AQAB"},"dig":"z0FZEd51akN/AgI69k54aPTErOlNCxtFr/aPix1Zzg8=","type":"identity","sig":"FrbLoSoleBRqYqspYsdDT8AOF0wFEuxjcIcbvrtaq1+Y6ir6Nh8X0rIynLitQYYPk5s2jirZnbVs+2mFZDK/nP0oBx1S2yHPt7jR3q78ylQ75cqOyHMOlvW5CEVYgS+iydKQ639MRBmDWGcqw+aD7bSDrdAzfAxiovIpK48uJ1KLi1c8dU22DwMZHeYE2xzhhW4WkKIeG5mPWhLZ3TbCKv0npHjPy8YQ/TkUVSuLCbMdks9Kw67AQybfNKY7igFld1mbvWiGzQIPNQhz/1xb5kgk9ifPQsYpRu35an19WX9lG2LBV1dqyClcdANOL49m+WpJXPW7uP0okpQvLqAgSw=="}
4 changes: 3 additions & 1 deletion src/aktie/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class Node implements NodeInterface
private Index index;
private HH2Session session;
private ProcessQueue userQueue;
private ProcessQueue dlQueue;
private IdentityManager identManager;
private UpdateDispatcher usrCallback;
private UpdateDispatcher netCallback;
Expand Down Expand Up @@ -106,7 +107,7 @@ public Node ( String nodedir, Net net, UpdateCallback uc,
shareManager = new ShareManager ( session, requestHandler, index,
hasFileCreator, nfp, userQueue );

ProcessQueue dlQueue = new ProcessQueue ( "downloadQueue" );
dlQueue = new ProcessQueue ( "downloadQueue" );
dlQueue.addProcessor ( new DownloadFileProcessor ( hasFileCreator ) );

NewPushProcessor pusher = new NewPushProcessor ( index, conMan );
Expand Down Expand Up @@ -212,6 +213,7 @@ public void run()

public void close()
{
dlQueue.stop();
shareManager.stop();
conMan.stop();
userQueue.stop();
Expand Down
11 changes: 11 additions & 0 deletions src/aktie/StandardI2PNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,17 @@ private void preStartUpdate()
upgrade0519 ( lastversion );
}

preStartManualReruns();

}

private void preStartManualReruns()
{
if ( Wrapper.getForceUpdate0519() )
{
Upgrade0519.upgrade ( nodeDir );
}

}

private void updateAfterNodeStart()
Expand Down
31 changes: 29 additions & 2 deletions src/aktie/Wrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public class Wrapper
public static String VERSION_0506 = "version 0.5.6";
public static String VERSION_0518 = "version 0.5.18";
public static String VERSION_0519 = "version 0.5.19";
public static String VERSION_0520 = "version 0.5.20";

public static String VERSION = VERSION_0519;
public static String VERSION = VERSION_0520;

public static String VERSION_FILE = "version.txt";

Expand All @@ -47,7 +48,7 @@ public class Wrapper
//the upgrade file added to the network by the developer account.
//This keeps new installs from downloading the same version as
//an upgrade
public static long RELEASETIME = ( 1502668084L * 1000L ) + 3600000L;
public static long RELEASETIME = ( 1503405255L * 1000L ) + 3600000L;

//Hash cash payment values
//Process for updating payment: Only increase payment value.
Expand Down Expand Up @@ -937,6 +938,13 @@ public static void saveUpdateLength ( String file, String hash )
savePropsFile ( p );
}

/**
Don't read into this too much. It is simply a convenience to turn
on some GUI menu options for us. Even if you set this property in your
properties file and try to use the menu options they won't be accepted
by other nodes because they won't be signed by a developer id.
@return
*/
public static boolean getIsDeveloper ( )
{
Properties p = loadExistingProps();
Expand All @@ -952,6 +960,25 @@ public static boolean getIsDeveloper ( )
return e;
}

public static boolean getForceUpdate0519 ( )
{
Properties p = loadExistingProps();

boolean e = false;
String ep = p.getProperty ( "aktie.update0519" );

if ( "true".equals ( ep ) )
{
e = true;

//Only return true once.
p.setProperty ( "aktie.update0519", "false" );
savePropsFile ( p );
}

return e;
}

public static boolean getEnabledShareManager ( )
{
Properties p = loadExistingProps();
Expand Down
7 changes: 4 additions & 3 deletions src/aktie/gui/NewDirectoryShareDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ public void widgetDefaultSelected ( SelectionEvent e )

text_2 = new Text ( container, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL );
text_2.setEditable ( false );
text_2.setText ( "All files in a share directory are shared with the community.\n" +
"Including all files in all subdirectories. All files are\n" +
"tagged with the share name." );
text_2.setText ( "All files are tagged with the share name.\n" +
"All files in a share directory " +
"are shared with the community.\n" +
"Including all files in all subdirectories." );
text_2.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false, 1, 1 ) );
new Label ( container, SWT.NONE );

Expand Down
55 changes: 55 additions & 0 deletions src/aktie/gui/SWTApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ private void generateSpamEx ( CObj devid, boolean save )
private PrivateMessageDialog prvMsgDialog;
private LauncherDialog launcherDialog;
private ConnectionDialog connectionDialog;
private SelectIdentityDialog devIdentDialog;

private PMTab pmTab;

Expand Down Expand Up @@ -1686,6 +1687,33 @@ protected void createDialogs()
launcherDialog.create();
connectionDialog = new ConnectionDialog ( shell, this );
connectionDialog.create();
devIdentDialog = new SelectIdentityDialog ( shell, this, new IdentitySelectedInterface()
{

@Override
public void selectedIdentity ( CObj i )
{
if ( i != null && selectedIdentity != null )
{
boolean asure = MessageDialog.openConfirm ( shell, "New Developer?",
"Make " + i.getDisplayName() + " a developer???" );

if ( asure )
{
CObj nd = new CObj();
nd.setType ( CObj.DEVELOPER );
nd.pushString ( CObj.IDENTITY, i.getId() );
nd.pushString ( CObj.CREATOR, selectedIdentity.getId() );
node.getNode().enqueue ( nd );
}

}

}

} );

devIdentDialog.create();
updateMembership();
}

Expand Down Expand Up @@ -2135,6 +2163,33 @@ public void widgetDefaultSelected ( SelectionEvent e )

if ( Wrapper.getIsDeveloper() )
{
MenuItem mntmNewdev = new MenuItem ( menu_1, SWT.NONE );
mntmNewdev.setText ( "NEW DEVELOPER" );
mntmNewdev.addSelectionListener ( new SelectionListener()
{
@Override
public void widgetSelected ( SelectionEvent e )
{
if ( selectedIdentity != null )
{
boolean asure = MessageDialog.openConfirm ( shell, "New Developer?", "Are you sure?" );

if ( asure )
{
devIdentDialog.open();
}

}

}

@Override
public void widgetDefaultSelected ( SelectionEvent e )
{
}

} );

MenuItem mntmSpamEx = new MenuItem ( menu_1, SWT.NONE );
mntmSpamEx.setText ( "GEN SPAM EX" );
mntmSpamEx.addSelectionListener ( new SelectionListener()
Expand Down
8 changes: 8 additions & 0 deletions src/aktie/gui/subtree/SubTreeEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.json.JSONObject;

@Entity
public class SubTreeEntity implements Comparable<Object>
{
Expand Down Expand Up @@ -156,6 +158,12 @@ public boolean equals ( Object o )
return id == s.getId();
}

public String toString()
{
JSONObject o = new JSONObject ( this );
return o.toString ( 4 );
}

public String getIdentity()
{
return identity;
Expand Down
44 changes: 44 additions & 0 deletions src/aktie/gui/subtree/SubTreeModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,52 @@ private synchronized void removeFromChildren ( SubTreeEntity se )

}

private boolean checkParentPath ( List<Long> l, long id )
{
if ( l.contains ( id ) )
{
return false;
}

Long pid = parents.get ( id );

if ( pid != null )
{
l.add ( id );
return checkParentPath ( l, pid );
}

return true;
}

private synchronized void addSubTreeElement ( SubTreeEntity se )
{
if ( se.getId() == 0 )
{
System.out.println ( "=============================================" );
System.out.println ( "Ident-sub tree broken. Entity with id == 0" );
System.out.println ( se );
System.out.println ( "=============================================" );
return;
}

List<Long> parentpath = new LinkedList<Long>();

if ( !checkParentPath ( parentpath, se.getId() ) )
{
System.out.println ( "=============================================" );
System.out.println ( "Ident-sub tree broken. Loop found" );
System.out.println ( se );

for ( Long l : parentpath )
{
System.out.println ( entities.get ( l ) );
}

System.out.println ( "=============================================" );
return;
}

if ( se.getType() == SubTreeEntity.IDENTITY_TYPE )
{
se.setParent ( 0 );
Expand Down
19 changes: 13 additions & 6 deletions src/aktie/user/NewDeveloperProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
public class NewDeveloperProcessor extends GenericProcessor
{

public static boolean TESTEVILDEV = false;

Logger log = Logger.getLogger ( "aktie" );

private Index index;
Expand Down Expand Up @@ -44,13 +46,18 @@ public boolean process ( CObj o )
return true;
}

DeveloperIdentity di = identManager.getDeveloperIdentity ( creator );

if ( di == null )
if ( !TESTEVILDEV )
{
o.pushString ( CObj.ERROR, "Developer Identity not specified." );
callback.update ( o );
return true;

DeveloperIdentity di = identManager.getDeveloperIdentity ( creator );

if ( di == null )
{
o.pushString ( CObj.ERROR, "Developer Identity not specified." );
callback.update ( o );
return true;
}

}

CObj devid = index.getMyIdentity ( creator );
Expand Down
Loading

0 comments on commit bd77b90

Please sign in to comment.