diff --git a/.gitea/workflows/apk.yml b/.gitea/workflows/apk.yml new file mode 100644 index 0000000..23cc437 --- /dev/null +++ b/.gitea/workflows/apk.yml @@ -0,0 +1,29 @@ +name: apk +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + container: mingc/android-build-box + steps: + - uses: actions/setup-go@v3 + with: + go-version: '>=1.20.1' + - uses: actions/checkout@v3 + - run: curl -sSL -u "$USERNAME:$PASSWORD" -o app/$STORE_FILE https://cloud.crystalyx.net/remote.php/dav/files/$USERNAME/Bordel/$STORE_FILE + - run: sh gradlew build bundleRelease assembleRelease --no-daemon + - uses: https://gitea.com/actions/release-action@main + if: startsWith(gitea.ref, 'refs/tags') + with: + files: | + ShareWithTitle/build/outputs/apk/debug/app-debug.apk + ShareWithTitle/build/outputs/apk/release/app-release.apk + ShareWithTitle/build/outputs/bundle/release/app-release.aab + api_key: ${{ secrets.RELEASE_TOKEN }} + env: + USERNAME: ${{ secrets.USERNAME }} + PASSWORD: ${{ secrets.PASSWORD }} + STORE_FILE: ${{ secrets.STORE_FILE }} + STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} diff --git a/.gitignore b/.gitignore index 303263b..eefd851 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -ShareWithTitle/build/apk/ -ShareWithTitle/build/classes/ -ShareWithTitle/build -.gradle/1.6/taskArtifacts -.gradle/1.6/taskArtifacts/ +.gradle/ +.DS_Store +build/ +local.properties +.idea diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 674f243..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -ShareWithTitle \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 217af47..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index 3572571..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 6260347..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/.idea/libraries/android_support_v4.xml b/.idea/libraries/android_support_v4.xml deleted file mode 100644 index a811a3e..0000000 --- a/.idea/libraries/android_support_v4.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/libraries/commons_lang3_3_1.xml b/.idea/libraries/commons_lang3_3_1.xml deleted file mode 100644 index 344d060..0000000 --- a/.idea/libraries/commons_lang3_3_1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 877b2d2..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - 1.6 - - - - - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 83e9495..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index def6a6a..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index ebf305c..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,566 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - - 1374344744086 - 1374344744086 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShareWithTitle/ShareWithTitle.iml b/ShareWithTitle/ShareWithTitle.iml deleted file mode 100644 index b826227..0000000 --- a/ShareWithTitle/ShareWithTitle.iml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ShareWithTitle/build.gradle b/ShareWithTitle/build.gradle index 48b66f4..0e5f346 100644 --- a/ShareWithTitle/build.gradle +++ b/ShareWithTitle/build.gradle @@ -1,24 +1,36 @@ -buildscript { - repositories { - maven { url 'http://repo1.maven.org/maven2' } - } - dependencies { - classpath 'com.android.tools.build:gradle:0.4' - } -} -apply plugin: 'android' - -dependencies { - compile files('libs/android-support-v4.jar') - compile files('libs/commons-lang3-3.1.jar') -} +apply plugin: 'com.android.application' android { - compileSdkVersion 17 - buildToolsVersion "17.0.0" - + namespace 'net.crystalyx.sharewithtitle' + compileSdk 33 defaultConfig { - minSdkVersion 14 - targetSdkVersion 16 + applicationId "net.crystalyx.sharewithtitle" + minSdkVersion 11 + targetSdkVersion 33 + versionCode 4 + versionName "1.3" + } + signingConfigs { + release { + if (System.env.STORE_FILE) { + storeFile file(System.env.STORE_FILE) + storePassword System.env.STORE_PASSWORD + keyAlias System.env.KEY_ALIAS + keyPassword System.env.KEY_PASSWORD + } + } + } + buildTypes { + release { + minifyEnabled true + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + if (System.env.STORE_FILE) { + signingConfig signingConfigs.release + } + } } } + +dependencies { + implementation 'org.jsoup:jsoup:1.16.1' +} diff --git a/ShareWithTitle/libs/android-support-v4.jar b/ShareWithTitle/libs/android-support-v4.jar deleted file mode 100644 index 428bdbc..0000000 Binary files a/ShareWithTitle/libs/android-support-v4.jar and /dev/null differ diff --git a/ShareWithTitle/libs/commons-lang3-3.1.jar b/ShareWithTitle/libs/commons-lang3-3.1.jar deleted file mode 100644 index a85e539..0000000 Binary files a/ShareWithTitle/libs/commons-lang3-3.1.jar and /dev/null differ diff --git a/ShareWithTitle/proguard-rules.pro b/ShareWithTitle/proguard-rules.pro new file mode 100644 index 0000000..11b0257 --- /dev/null +++ b/ShareWithTitle/proguard-rules.pro @@ -0,0 +1,10 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: diff --git a/ShareWithTitle/src/main/AndroidManifest.xml b/ShareWithTitle/src/main/AndroidManifest.xml index e722987..99d1cfb 100644 --- a/ShareWithTitle/src/main/AndroidManifest.xml +++ b/ShareWithTitle/src/main/AndroidManifest.xml @@ -1,24 +1,15 @@ - + package="net.crystalyx.sharewithtitle"> - - - + + android:icon="@mipmap/ic_launcher" + android:label="Share with title" + android:theme="@android:style/Theme.NoDisplay"> + android:name=".MainActivity" + android:exported="true"> diff --git a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java b/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java deleted file mode 100644 index 5272165..0000000 --- a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java +++ /dev/null @@ -1,42 +0,0 @@ -package in.sdqali.sharewithtitle; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.Menu; -import android.view.Window; -import android.view.WindowManager; -import android.widget.ProgressBar; - -public class MainActivity extends Activity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - this.requestWindowFeature(Window.FEATURE_NO_TITLE); - this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); - - setContentView(R.layout.activity_main); - - Intent intent = getIntent(); - String action = intent.getAction(); - - final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar); - - - if(action.equals(Intent.ACTION_SEND)) { - String sharedText = intent.getStringExtra(Intent.EXTRA_TEXT); - Log.d("Share With Title", "Received shared text: " + sharedText); - new TitleRetriever(sharedText).retrieve(new ReshareCallback(this, progressBar)); - } - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. - getMenuInflater().inflate(R.menu.main, menu); - return true; - } - -} diff --git a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/PageDownloader.java b/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/PageDownloader.java deleted file mode 100644 index 6d4b0e6..0000000 --- a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/PageDownloader.java +++ /dev/null @@ -1,58 +0,0 @@ -package in.sdqali.sharewithtitle; - -import android.util.Log; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; - -public class PageDownloader { - public PageDownloader() { - } - - String downloadUrl(String urlText) { - try { - URL url = null; - url = new URL(urlText); - HttpURLConnection con = null; - con = (HttpURLConnection) url - .openConnection(); - String content = readStream(con.getInputStream()); - Log.d("Share With Title", "content: " + content); - return content; - - } catch (Exception e) { - return urlText; - } - } - - - private String readStream(InputStream in) { - String output = ""; - BufferedReader reader = null; - try { - reader = new BufferedReader(new InputStreamReader(in)); - String line = ""; - while ((line = reader.readLine()) != null) { - output += line; - if(TitleParser.retrieveTitle(output) != null) { - return output; - } - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return output; - } -} \ No newline at end of file diff --git a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/ReshareCallback.java b/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/ReshareCallback.java deleted file mode 100644 index 8dd7b01..0000000 --- a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/ReshareCallback.java +++ /dev/null @@ -1,61 +0,0 @@ -package in.sdqali.sharewithtitle; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.view.View; -import android.widget.ProgressBar; -import android.widget.Toast; - -/** - * Created by sdqali on 7/20/13. - */ -public class ReshareCallback implements TitleGrabCallback{ - private Activity activity; - private Context applicationContext; - private ProgressBar progressBar; - - public ReshareCallback(Activity mainActivity, ProgressBar progressBar) { - this.activity = mainActivity; - this.progressBar = progressBar; - } - - @Override - public void onSuccess(String titleAndLink) { - progressBar.setVisibility(View.VISIBLE); - showToast("Successfully grabbed title!"); - reShare(titleAndLink); - cleanUp(); - } - - private void reShare(String titleAndLink) { - Intent sharingIntent = new Intent(Intent.ACTION_SEND); - - sharingIntent.setType("text/plain"); - sharingIntent.putExtra(Intent.EXTRA_TEXT, titleAndLink); - activity.startActivity(Intent.createChooser(sharingIntent, "Share via")); - } - - @Override - public void onProgress() { - progressBar.animate(); - } - - @Override - public void cleanUp() { - progressBar.setVisibility(View.GONE); - } - - @Override - public void showError(String errorMessage, String urlText) { - showToast(errorMessage); - reShare(urlText); - cleanUp(); - } - - private void showToast(String errorMessage) { - int duration = Toast.LENGTH_SHORT; - Toast toast = Toast.makeText(activity.getApplicationContext(), errorMessage, duration); - toast.show(); - } -} diff --git a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleGrabCallback.java b/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleGrabCallback.java deleted file mode 100644 index 995b308..0000000 --- a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleGrabCallback.java +++ /dev/null @@ -1,11 +0,0 @@ -package in.sdqali.sharewithtitle; - -/** - * Created by sdqali on 7/20/13. - */ -public interface TitleGrabCallback { - public void onSuccess(String title); - public void onProgress(); - public void cleanUp(); - public void showError(String errorMessage, String urlText); -} diff --git a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleParser.java b/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleParser.java deleted file mode 100644 index dca8af7..0000000 --- a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleParser.java +++ /dev/null @@ -1,17 +0,0 @@ -package in.sdqali.sharewithtitle; - -import org.apache.commons.lang3.StringEscapeUtils; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class TitleParser { - public static String retrieveTitle(String html) { - Pattern p = Pattern.compile(".*?(.*?)", Pattern.DOTALL); - Matcher m = p.matcher(html); - String title = null; - while (m.find()) { - title = m.group(1); - } - return StringEscapeUtils.unescapeHtml4(title); - } -} \ No newline at end of file diff --git a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleRetriever.java b/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleRetriever.java deleted file mode 100644 index d01697d..0000000 --- a/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/TitleRetriever.java +++ /dev/null @@ -1,52 +0,0 @@ -package in.sdqali.sharewithtitle; - -import android.os.AsyncTask; -import android.webkit.URLUtil; - -/** - * Created by sdqali on 7/20/13. - */ -public class TitleRetriever { - private String urlText; - - public TitleRetriever(String url) { - this.urlText = url; - } - - public void retrieve(TitleGrabCallback callback) { - if(isValidUrl(urlText)) { - new DownloadTaskNew(callback).execute(urlText); - } else { - callback.showError("Not a valid url. Could not load title!", urlText); - } - } - - private boolean isValidUrl(String urlText) { - return (URLUtil.isHttpsUrl(urlText) || URLUtil.isHttpUrl(urlText)); - } - - private class DownloadTaskNew extends AsyncTask { - private TitleGrabCallback callback; - private final PageDownloader pageDownloader = new PageDownloader(); - - public DownloadTaskNew(TitleGrabCallback callback) { - this.callback = callback; - } - - @Override - protected String doInBackground(String... urls) { - callback.onProgress(); - return pageDownloader.downloadUrl(urls[0]); - } - - @Override - protected void onPostExecute(String rawHtml) { - String title = TitleParser.retrieveTitle(rawHtml); - String output = urlText; - if (title != null) { - output = title + " " + urlText; - } - callback.onSuccess(output); - } - } -} diff --git a/ShareWithTitle/src/main/java/net/crystalyx/sharewithtitle/HttpThreadHandler.java b/ShareWithTitle/src/main/java/net/crystalyx/sharewithtitle/HttpThreadHandler.java new file mode 100644 index 0000000..c110b2e --- /dev/null +++ b/ShareWithTitle/src/main/java/net/crystalyx/sharewithtitle/HttpThreadHandler.java @@ -0,0 +1,33 @@ +package net.crystalyx.sharewithtitle; + +import org.jsoup.Jsoup; + +import java.io.IOException; +import java.net.URL; + +public class HttpThreadHandler implements Runnable { + private final URL url; + private String title; + private String errorMessage; + + public HttpThreadHandler(URL url) { + this.url = url; + } + + @Override + public void run() { + try { + title = Jsoup.connect(url.toString()).get().title(); + } catch (IOException e) { + errorMessage = e.getMessage(); + } + } + + public String getTitle() { + return title; + } + + public String getErrorMessage() { + return errorMessage; + } +} diff --git a/ShareWithTitle/src/main/java/net/crystalyx/sharewithtitle/MainActivity.java b/ShareWithTitle/src/main/java/net/crystalyx/sharewithtitle/MainActivity.java new file mode 100644 index 0000000..71ea03d --- /dev/null +++ b/ShareWithTitle/src/main/java/net/crystalyx/sharewithtitle/MainActivity.java @@ -0,0 +1,60 @@ +package net.crystalyx.sharewithtitle; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.widget.Toast; + +import java.net.MalformedURLException; +import java.net.URL; + +public class MainActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + Intent intent = getIntent(); + String type = intent.getType(); + + if (Intent.ACTION_SEND.equals(intent.getAction()) && "text/plain".equals(type)) { + handleUrl(intent.getStringExtra(Intent.EXTRA_TEXT)); + } + + finish(); + } + + private void handleUrl(String textUrl) { + URL url; + + try { + url = new URL(textUrl); + } catch (MalformedURLException e) { + Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); + return; + } + + HttpThreadHandler handler = new HttpThreadHandler(url); + Thread job = new Thread(handler); + + job.start(); + try { + job.join(); + } catch (InterruptedException e) { + Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show(); + } + + String title = handler.getTitle(); + String errorMessage = handler.getErrorMessage(); + + if (title != null) { + Intent sharingIntent = new Intent(Intent.ACTION_SEND); + sharingIntent.setType("text/plain"); + sharingIntent.putExtra(Intent.EXTRA_TEXT, title + "\n\n" + url); + startActivity(Intent.createChooser(sharingIntent, "Share via")); + } else if (errorMessage != null) { + Toast.makeText(this, errorMessage, Toast.LENGTH_SHORT).show(); + } + } + +} diff --git a/ShareWithTitle/src/main/res/layout/activity_main.xml b/ShareWithTitle/src/main/res/layout/activity_main.xml deleted file mode 100644 index 9f2bddf..0000000 --- a/ShareWithTitle/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/ShareWithTitle/src/main/res/menu/main.xml b/ShareWithTitle/src/main/res/menu/main.xml deleted file mode 100644 index f3b10b6..0000000 --- a/ShareWithTitle/src/main/res/menu/main.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/ShareWithTitle/src/main/res/mipmap-hdpi/ic_launcher.png b/ShareWithTitle/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..6a05eb6 Binary files /dev/null and b/ShareWithTitle/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/ShareWithTitle/src/main/res/mipmap-mdpi/ic_launcher.png b/ShareWithTitle/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..83a2367 Binary files /dev/null and b/ShareWithTitle/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/ShareWithTitle/src/main/res/mipmap-xhdpi/ic_launcher.png b/ShareWithTitle/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..f0b6442 Binary files /dev/null and b/ShareWithTitle/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/ShareWithTitle/src/main/res/mipmap-xxhdpi/ic_launcher.png b/ShareWithTitle/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..3644ed1 Binary files /dev/null and b/ShareWithTitle/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/ShareWithTitle/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/ShareWithTitle/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..ce686d8 Binary files /dev/null and b/ShareWithTitle/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/ShareWithTitle/src/main/res/values-sw600dp/dimens.xml b/ShareWithTitle/src/main/res/values-sw600dp/dimens.xml deleted file mode 100644 index 886b05f..0000000 --- a/ShareWithTitle/src/main/res/values-sw600dp/dimens.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/ShareWithTitle/src/main/res/values-sw720dp-land/dimens.xml b/ShareWithTitle/src/main/res/values-sw720dp-land/dimens.xml deleted file mode 100644 index 00059fc..0000000 --- a/ShareWithTitle/src/main/res/values-sw720dp-land/dimens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 128dp - diff --git a/ShareWithTitle/src/main/res/values-v11/styles.xml b/ShareWithTitle/src/main/res/values-v11/styles.xml deleted file mode 100644 index 3c02242..0000000 --- a/ShareWithTitle/src/main/res/values-v11/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/ShareWithTitle/src/main/res/values-v14/styles.xml b/ShareWithTitle/src/main/res/values-v14/styles.xml deleted file mode 100644 index a91fd03..0000000 --- a/ShareWithTitle/src/main/res/values-v14/styles.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/ShareWithTitle/src/main/res/values/dimens.xml b/ShareWithTitle/src/main/res/values/dimens.xml deleted file mode 100644 index 47c8224..0000000 --- a/ShareWithTitle/src/main/res/values/dimens.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - 16dp - 16dp - diff --git a/ShareWithTitle/src/main/res/values/strings.xml b/ShareWithTitle/src/main/res/values/strings.xml deleted file mode 100644 index 1dd2edf..0000000 --- a/ShareWithTitle/src/main/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - Share With Title - Settings - Hello world! - - diff --git a/ShareWithTitle/src/main/res/values/styles.xml b/ShareWithTitle/src/main/res/values/styles.xml deleted file mode 100644 index a959c28..0000000 --- a/ShareWithTitle/src/main/res/values/styles.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - diff --git a/ShareWithTitleProject.iml b/ShareWithTitleProject.iml index 13da953..f6835cb 100644 --- a/ShareWithTitleProject.iml +++ b/ShareWithTitleProject.iml @@ -1,5 +1,5 @@ - + @@ -7,14 +7,4 @@ - - - - - - - - - - - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 495c503..8b7b8dc 100644 --- a/build.gradle +++ b/build.gradle @@ -1 +1,25 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:8.1.0") + } +} + +allprojects { + repositories { + mavenLocal() + google() + mavenCentral() + } +} + +tasks.register('clean', Delete) { + delete rootProject.buildDir +} + +tasks.withType(JavaCompile).configureEach { + options.deprecation = true +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 8c0fb64..955e786 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5c22dec..7ca163e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Apr 10 15:27:10 PDT 2013 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 91a7e26..17a9170 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -6,47 +6,6 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" @@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- +cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" -cd "$SAVED" >&- +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -90,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -114,6 +113,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` @@ -154,11 +154,23 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Collect all arguments for the java command, following the shell quoting and substitution rules +if $JAVACMD --add-opens java.base/java.lang=ALL-UNNAMED -version ; then + DEFAULT_JVM_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED $DEFAULT_JVM_OPTS" +fi + +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index aec9973..e95643d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -8,14 +8,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +46,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/local.properties b/local.properties index 90aafac..71b8a66 100644 --- a/local.properties +++ b/local.properties @@ -1,10 +1,8 @@ -# This file is automatically generated by Android Studio. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must *NOT* be checked into Version Control Systems, +## This file must *NOT* be checked into Version Control Systems, # as it contains information specific to your local configuration. - +# # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. -sdk.dir=/Applications/Android Studio.app/sdk \ No newline at end of file +#Sun Jul 30 19:06:21 CEST 2023 +sdk.dir=/mnt/Eternia/AndroidSdk diff --git a/settings.gradle b/settings.gradle index 35c6f48..52d3beb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ +// Boilerplate from https://transang.me/create-a-minimal-android-boilerplate-from-scratch/ +rootProject.name = 'ShareWithTitle' include ':ShareWithTitle'