cleanup
This commit is contained in:
		
							parent
							
								
									67f1270606
								
							
						
					
					
						commit
						a76de7534d
					
				
					 4 changed files with 14 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -218,7 +218,8 @@ public class GenerateFragment extends Fragment implements FragmentSupport {
 | 
			
		|||
					builder.setTitle("ssss-1");
 | 
			
		||||
					builder.setView(view);
 | 
			
		||||
					if (PrintHelper.systemSupportsPrint()) {
 | 
			
		||||
						builder.setPositiveButton(R.string.print, new DialogInterface.OnClickListener() {
 | 
			
		||||
						builder.setPositiveButton(R.string.print,
 | 
			
		||||
								new DialogInterface.OnClickListener() {
 | 
			
		||||
							@Override
 | 
			
		||||
							public void onClick(DialogInterface dialog, int which) {
 | 
			
		||||
								Renderer.printCode(activity, "sss-1", data);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -104,7 +104,9 @@ public class Renderer {
 | 
			
		|||
				Paint codePaint = new Paint();
 | 
			
		||||
				codePaint.setAntiAlias(false);
 | 
			
		||||
				codePaint.setDither(false);
 | 
			
		||||
				canvas.drawBitmap(codeBitmap, centerXForAddress - codeBitmap.getWidth() / 2, y, codePaint);
 | 
			
		||||
				canvas.drawBitmap(codeBitmap,
 | 
			
		||||
						centerXForAddress - codeBitmap.getWidth() / 2, y,
 | 
			
		||||
						codePaint);
 | 
			
		||||
				y += codePadding - textPaint.ascent();
 | 
			
		||||
				canvas.drawText(label, centerXForAddress, y + codeBitmap.getHeight(), textPaint);
 | 
			
		||||
				return bmp;
 | 
			
		||||
| 
						 | 
				
			
			@ -259,7 +261,8 @@ public class Renderer {
 | 
			
		|||
 | 
			
		||||
	public static SecretShare.PublicInfo decodePublicInfo(final String buf) {
 | 
			
		||||
		int index64 = buf.indexOf("=") + 1;
 | 
			
		||||
		final ByteBuffer byteBuffer = ByteBuffer.wrap(Base64.decode(buf.substring(index64), Base64.DEFAULT));
 | 
			
		||||
		final ByteBuffer byteBuffer;
 | 
			
		||||
		byteBuffer = ByteBuffer.wrap(Base64.decode(buf.substring(index64), Base64.DEFAULT));
 | 
			
		||||
		int x = byteBuffer.getInt();
 | 
			
		||||
		int k = byteBuffer.getInt();
 | 
			
		||||
		int n = byteBuffer.getInt();
 | 
			
		||||
| 
						 | 
				
			
			@ -274,9 +277,12 @@ public class Renderer {
 | 
			
		|||
		return new SecretShare.PublicInfo(n, k, inPrimeModulus, tryUnicodeExpand(byteDescription));
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static SecretShare.ShareInfo decodeShareInfo(final String buf, final SecretShare.PublicInfo publicInfo) throws InvalidParameterException {
 | 
			
		||||
	public static SecretShare.ShareInfo decodeShareInfo(final String buf,
 | 
			
		||||
														final SecretShare.PublicInfo publicInfo)
 | 
			
		||||
			throws InvalidParameterException {
 | 
			
		||||
		int index64 = buf.indexOf("=") + 1;
 | 
			
		||||
		final ByteBuffer byteBuffer = ByteBuffer.wrap(Base64.decode(buf.substring(index64), Base64.DEFAULT));
 | 
			
		||||
		final ByteBuffer byteBuffer;
 | 
			
		||||
		byteBuffer = ByteBuffer.wrap(Base64.decode(buf.substring(index64), Base64.DEFAULT));
 | 
			
		||||
		int x = byteBuffer.getInt();
 | 
			
		||||
		int k = byteBuffer.getInt();
 | 
			
		||||
		int n = byteBuffer.getInt();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,7 +23,6 @@
 | 
			
		|||
                android:id="@+id/generate_status"
 | 
			
		||||
                android:layout_width="fill_parent"
 | 
			
		||||
                android:layout_height="fill_parent"
 | 
			
		||||
                android:text="@string/hello_blank_fragment"
 | 
			
		||||
                />
 | 
			
		||||
        </ScrollView>
 | 
			
		||||
    </LinearLayout>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,12 +2,10 @@
 | 
			
		|||
<resources>
 | 
			
		||||
 | 
			
		||||
    <string name="app_name">SecretShare</string>
 | 
			
		||||
    <string name="hello_world">Hello world!</string>
 | 
			
		||||
    <string name="action_settings">Settings</string>
 | 
			
		||||
    <string name="string_clear_text_secret">Clear text secret</string>
 | 
			
		||||
    <string name="string_generate_secrets">Generate Secrets</string>
 | 
			
		||||
    <string name="string_clear_text_secret">The secret you want to split.</string>
 | 
			
		||||
    <string name="string_generate_secrets">Generate split secret</string>
 | 
			
		||||
    <string name="string_encrypted_secrets">Encrypted secrets</string>
 | 
			
		||||
    <string name="hello_blank_fragment">Hello blank fragment</string>
 | 
			
		||||
    <string name="print">Print</string>
 | 
			
		||||
 | 
			
		||||
</resources>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue