Skip to content

Commit

Permalink
button size
Browse files Browse the repository at this point in the history
  • Loading branch information
jml authored and jml committed Jun 28, 2024
1 parent 984286b commit efba703
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 48 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:logo="@drawable/logo"
android:supportsRtl="true"
android:theme="@style/Theme.SignYourApk"
tools:targetApi="34"
Expand Down
7 changes: 2 additions & 5 deletions app/src/main/java/com/cod5/signyourapk/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.AssetManager;
import android.icu.util.Output;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
Expand All @@ -29,7 +28,6 @@
import com.cod5.signyourapk.databinding.ActivityMainBinding;
import net.fornwall.apksigner.Main;

import java.io.Console;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
Expand Down Expand Up @@ -79,7 +77,6 @@ private void listDownloadsFiles() {
}
}
}

}

/* print result of permission request */
Expand Down Expand Up @@ -177,11 +174,11 @@ public void onClickMe(View v) {
} else {
File cert = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/certificate.jks");
Log.d("Sign(v1):", cert.getPath() + " " + binding.passwd.getText().toString() + " " + rdb.getText().toString());
Main.main(new String[]{"-p", binding.passwd.getText().toString(),
Main.main("-p", binding.passwd.getText().toString(),
cert.getPath(),
rdb.getText().toString(),
rdb.getText().toString() + "-signed.apk"
});
);
binding.sampleText.setText(R.string.apk_signed);
}

Expand Down
37 changes: 37 additions & 0 deletions app/src/main/res/drawable/logo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="28.575"
android:viewportHeight="28.575">
<path
android:pathData="M4.908,14.175a9.687,9.719 0,1 0,19.374 0a9.687,9.719 0,1 0,-19.374 0z"
android:strokeWidth="0"
android:fillColor="#05f715"
android:strokeColor="#4af89c"/>
<path
android:pathData="m15.111,16.597c-0.017,0 -0.003,-0.037 0,-0.041 0.05,-0.07 0.155,-0.01 0.191,0.041 0.121,0.172 -0.029,0.392 -0.191,0.468 -0.368,0.173 -0.762,-0.124 -0.883,-0.468 -0.226,-0.641 0.279,-1.276 0.883,-1.446 0.997,-0.281 1.942,0.501 2.163,1.446 0.337,1.438 -0.791,2.766 -2.163,3.042 -1.969,0.396 -3.753,-1.152 -4.086,-3.042 -0.456,-2.591 1.589,-4.91 4.086,-5.3 3.308,-0.517 6.24,2.102 6.69,5.3 0.58,4.121 -2.693,7.747 -6.69,8.259 -5.032,0.644 -9.436,-3.366 -10.01,-8.259"
android:strokeWidth="2.265"
android:fillColor="#00000000"
android:strokeColor="#4a6af8"
android:fillType="evenOdd"/>
<path
android:pathData="M4.385,3.288h11.055v1.045h-11.055z"
android:strokeWidth="1.60729"
android:fillColor="#ffffff"
android:strokeColor="#4a6af8"/>
<path
android:pathData="M4.843,5.231h0.452v2.648h-0.452z"
android:strokeWidth="2.265"
android:fillColor="#ffffff"
android:strokeColor="#4a6af8"/>
<path
android:pathData="M9.106,5.295h0.452v2.648h-0.452z"
android:strokeWidth="2.265"
android:fillColor="#ffffff"
android:strokeColor="#4a6af8"/>
<path
android:pathData="M18.663,6.458a2.841,2.712 0,1 0,5.683 0a2.841,2.712 0,1 0,-5.683 0z"
android:strokeWidth="2.265"
android:fillColor="#ffffff"
android:strokeColor="#4a6af8"/>
</vector>
87 changes: 44 additions & 43 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,57 @@
android:layout_height="match_parent"
tools:context=".MainActivity">

<LinearLayout
android:id="@+id/linearLayout"
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="16dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="24dp">

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="274dp"
android:layout_marginRight="274dp"
android:text="sign APK"
app:layout_constraintBottom_toTopOf="@+id/sample_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<EditText
android:id="@+id/passwd"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:text="12345678" />
android:orientation="vertical">

<TextView
android:id="@+id/sample_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
<Button
android:id="@+id/button"
android:layout_width="130dp"
android:layout_height="68dp"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:text="sign APK"
app:layout_constraintBottom_toTopOf="@+id/sample_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<RadioGroup
android:id="@+id/radio"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<EditText
android:id="@+id/passwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="text"
android:text="@string/the_password" />

<TextView
android:id="@+id/sample_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:text="@string/hello_world" />

</LinearLayout>
<RadioGroup
android:id="@+id/radio"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:isScrollContainer="true"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical"
android:verticalScrollbarPosition="defaultPosition" />
</LinearLayout>
</ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
<string name="apk_signed_v2">APK signed (v2) !</string>
<string name="please_select_an_apk">please select an APK</string>
<string name="failed">failed!</string>
<string name="the_password">12345678</string>
<string name="hello_world">Hello World!</string>
</resources>

0 comments on commit efba703

Please sign in to comment.