Readd my Play Store version
Some checks failed
apk / build (push) Failing after 33s

This commit is contained in:
Michel Roux 2023-07-30 21:04:42 +02:00
parent ee167fed93
commit e01d8c1813
50 changed files with 277 additions and 1212 deletions

29
.gitea/workflows/apk.yml Normal file
View File

@ -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 }}

10
.gitignore vendored
View File

@ -1,5 +1,5 @@
ShareWithTitle/build/apk/ .gradle/
ShareWithTitle/build/classes/ .DS_Store
ShareWithTitle/build build/
.gradle/1.6/taskArtifacts local.properties
.gradle/1.6/taskArtifacts/ .idea

View File

@ -1 +0,0 @@
ShareWithTitle

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@ -1,5 +0,0 @@
<component name="CopyrightManager">
<settings default="">
<module2copyright />
</settings>
</component>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="useAutoImport" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>

View File

@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="android-support-v4">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ShareWithTitle/libs/android-support-v4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="commons-lang3-3.1">
<CLASSES>
<root url="jar://$PROJECT_DIR$/ShareWithTitle/libs/commons-lang3-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="Android 4.2.2" project-jdk-type="Android SDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.6</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/ShareWithTitle/ShareWithTitle.iml" filepath="$PROJECT_DIR$/ShareWithTitle/ShareWithTitle.iml" />
<module fileurl="file://$PROJECT_DIR$/ShareWithTitleProject.iml" filepath="$PROJECT_DIR$/ShareWithTitleProject.iml" />
</modules>
</component>
</project>

View File

@ -1,5 +0,0 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
</component>
</project>

View File

@ -1,566 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidLayoutPreviewToolWindow">
<option name="state">
<GlobalState />
</option>
</component>
<component name="AndroidLayouts">
<shared>
<config />
</shared>
</component>
<component name="ChangeListManager">
<list default="true" id="82d7e327-c1ef-4710-9e38-9b3416765ce1" name="Default" comment="" />
<ignored path="ShareWithTitle.iws" />
<ignored path=".idea/workspace.xml" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DebuggerManager">
<ui_properties default_suspend_policy="SuspendAll" default_condition_enabled="true" />
<breakpoint_any default_suspend_policy="SuspendAll" default_condition_enabled="true">
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="REMOVE_AFTER_HIT" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="true" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
<breakpoint>
<option name="NOTIFY_CAUGHT" value="true" />
<option name="NOTIFY_UNCAUGHT" value="true" />
<option name="ENABLED" value="false" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
<option name="REMOVE_AFTER_HIT" value="false" />
<option name="SUSPEND_POLICY" value="SuspendAll" />
<option name="SUSPEND" value="true" />
<option name="COUNT_FILTER_ENABLED" value="false" />
<option name="COUNT_FILTER" value="0" />
<option name="CONDITION_ENABLED" value="true" />
<option name="CLASS_FILTERS_ENABLED" value="false" />
<option name="INSTANCE_FILTERS_ENABLED" value="false" />
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
</breakpoint_any>
<breakpoint_rules />
<ui_properties />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="ShareWithTitle" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="AndroidManifest.xml" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="6" column="64" selection-start="272" selection-end="272" vertical-scroll-proportion="0.0" vertical-offset="75" max-vertical-offset="510">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="MainActivity.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="29" column="22" selection-start="883" selection-end="883" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="870">
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ShareableOutput.java" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/ShareWithTitle/build/source/r/debug/in/sdqali/sharewithtitle/ShareableOutput.java">
<provider selected="true" editor-type-id="text-editor">
<state line="21" column="25" selection-start="491" selection-end="491" vertical-scroll-proportion="0.33168316" vertical-offset="181" max-vertical-offset="645">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TitleRetriever.java" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ShareWithTitle/build/source/r/debug/in/sdqali/sharewithtitle/TitleRetriever.java">
<provider selected="true" editor-type-id="text-editor">
<state line="70" column="0" selection-start="1886" selection-end="1886" vertical-scroll-proportion="-14.96" vertical-offset="676" max-vertical-offset="1140">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="activity_main.xml" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/res/layout/activity_main.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="25" selection-start="520" selection-end="520" vertical-scroll-proportion="0.0" vertical-offset="150" max-vertical-offset="345">
<folding />
</state>
</provider>
<provider editor-type-id="android-designer">
<state />
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
<setting name="OPEN_NEW_TAB" value="false" />
</FindUsagesManager>
</component>
<component name="GradleLocalSettings">
<option name="tasksExpandState">
<map>
<entry key="" value="true" />
</map>
</option>
<option name="availableProjects">
<map>
<entry>
<key>
<ExternalProjectPojo>
<option name="name" value="ShareWithTitleProject" />
<option name="path" value="$PROJECT_DIR$/build.gradle" />
</ExternalProjectPojo>
</key>
<value>
<list>
<ExternalProjectPojo>
<option name="name" value="ShareWithTitleProject" />
<option name="path" value="$PROJECT_DIR$/build.gradle" />
</ExternalProjectPojo>
<ExternalProjectPojo>
<option name="name" value="ShareWithTitle" />
<option name="path" value="$PROJECT_DIR$/ShareWithTitle/build.gradle" />
</ExternalProjectPojo>
</list>
</value>
</entry>
</map>
</option>
</component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
<option value="$PROJECT_DIR$/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/LinkShareReceiver.java" />
<option value="$PROJECT_DIR$/ShareWithTitle/src/main/res/layout/activity_main.xml" />
<option value="$PROJECT_DIR$/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java" />
<option value="$PROJECT_DIR$/ShareWithTitle/src/main/AndroidManifest.xml" />
<option value="$PROJECT_DIR$/ShareWithTitle/build/source/r/debug/in/sdqali/sharewithtitle/ShareableOutput.java" />
<option value="$PROJECT_DIR$/ShareWithTitle/build/source/r/debug/in/sdqali/sharewithtitle/TitleRetriever.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="10" />
<option name="y" value="22" />
<option name="width" value="1420" />
<option name="height" value="801" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="ShareWithTitle" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="OverrideImplement.combined" value="true" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="recentsLimit" value="5" />
<property name="MemberChooser.sorted" value="false" />
<property name="OverrideImplement.overriding.sorted" value="false" />
<property name="FullScreen" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
<property name="ANDROID_EXTENDED_DEVICE_CHOOSER_SERIALS" value="emulator-5554" />
<property name="MemberChooser.copyJavadoc" value="false" />
</component>
<component name="RecentsManager">
<key name="CreateClassDialog.RecentsKey">
<recent name="in.sdqali.sharewithtitle" />
</key>
</component>
<component name="RunManager" selected="Android Application.ShareWithTitle">
<configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
<module name="" />
<option name="TESTING_TYPE" value="0" />
<option name="INSTRUMENTATION_RUNNER_CLASS" value="" />
<option name="METHOD_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="PACKAGE_NAME" value="" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="" />
<option name="ACTIVITY_CLASS" value="" />
<option name="MODE" value="default_activity" />
<option name="DEPLOY" value="true" />
<option name="TARGET_SELECTION_MODE" value="EMULATOR" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<method />
</configuration>
<configuration default="false" name="ShareWithTitle" type="AndroidRunConfigurationType" factoryName="Android Application">
<module name="ShareWithTitle" />
<option name="ACTIVITY_CLASS" value="" />
<option name="MODE" value="do_nothing" />
<option name="DEPLOY" value="true" />
<option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
<option name="PREFERRED_AVD" value="" />
<option name="USE_COMMAND_LINE" value="true" />
<option name="COMMAND_LINE" value="" />
<option name="WIPE_USER_DATA" value="false" />
<option name="DISABLE_BOOT_ANIMATION" value="false" />
<option name="NETWORK_SPEED" value="full" />
<option name="NETWORK_LATENCY" value="none" />
<option name="CLEAR_LOGCAT" value="false" />
<RunnerSettings RunnerId="AndroidDebugRunner" />
<ConfigurationWrapper RunnerId="AndroidDebugRunner" />
<method />
</configuration>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="Android Application.ShareWithTitle" />
</list>
<configuration name="&lt;template&gt;" type="TestNG" default="true" selected="false">
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
</configuration>
<configuration name="&lt;template&gt;" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" default="true" selected="false">
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
</configuration>
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false" />
<component name="SliceManager">
<option name="analysisUIOptions">
<AnalysisUIOptions />
</option>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="82d7e327-c1ef-4710-9e38-9b3416765ce1" name="Default" comment="" />
<created>1374344744086</created>
<updated>1374344744086</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="10" y="22" width="1420" height="801" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette&#9;" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32892805" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Android" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.2496361" sideWeight="0.67107195" order="0" side_tool="false" content_ui="combo" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32892805" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32896653" sideWeight="0.67203516" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="CHECK_NEW_TODO" value="true" />
<option name="myTodoPanelSettings">
<value>
<are-packages-shown value="false" />
<are-modules-shown value="false" />
<flatten-packages value="false" />
<is-autoscroll-to-source value="false" />
</value>
</option>
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="SHORT_DIFF_HORIZONTALLY" value="true" />
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
<option name="SHOW_DIRTY_RECURSIVELY" value="false" />
<option name="LIMIT_HISTORY" value="true" />
<option name="MAXIMUM_HISTORY_ROWS" value="1000" />
<option name="UPDATE_FILTER_SCOPE_NAME" />
<option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
<option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
<option name="LAST_COMMIT_MESSAGE" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
<option name="ACTIVE_VCS_NAME" />
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
<option name="UPDATE_FILTER_BY_SCOPE" value="false" />
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="6" column="64" selection-start="272" selection-end="272" vertical-scroll-proportion="0.0" vertical-offset="75" max-vertical-offset="510">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="36" column="33" selection-start="1240" selection-end="1240" vertical-scroll-proportion="0.0" vertical-offset="420" max-vertical-offset="870">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/res/layout/activity_main.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="25" selection-start="520" selection-end="520" vertical-scroll-proportion="0.0" vertical-offset="150" max-vertical-offset="345">
<folding />
</state>
</provider>
<provider editor-type-id="android-designer">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="26" column="50" selection-start="1036" selection-end="1036" vertical-scroll-proportion="0.0" vertical-offset="120" max-vertical-offset="570">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="35" column="47" selection-start="1198" selection-end="1198" vertical-scroll-proportion="0.0" vertical-offset="405" max-vertical-offset="870">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/res/layout/activity_main.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="25" selection-start="520" selection-end="520" vertical-scroll-proportion="0.0" vertical-offset="150" max-vertical-offset="345">
<folding />
</state>
</provider>
<provider editor-type-id="android-designer">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/res/layout/activity_main.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="11" column="25" selection-start="520" selection-end="520" vertical-scroll-proportion="0.0" vertical-offset="150" max-vertical-offset="345">
<folding />
</state>
</provider>
<provider editor-type-id="android-designer">
<state />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/AndroidManifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state line="6" column="64" selection-start="272" selection-end="272" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="510">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/src/main/java/in/sdqali/sharewithtitle/MainActivity.java">
<provider selected="true" editor-type-id="text-editor">
<state line="29" column="22" selection-start="883" selection-end="883" vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="870">
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/build/source/r/debug/in/sdqali/sharewithtitle/TitleRetriever.java">
<provider selected="true" editor-type-id="text-editor">
<state line="70" column="0" selection-start="1886" selection-end="1886" vertical-scroll-proportion="-14.96" vertical-offset="676" max-vertical-offset="1140">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ShareWithTitle/build/source/r/debug/in/sdqali/sharewithtitle/ShareableOutput.java">
<provider selected="true" editor-type-id="text-editor">
<state line="21" column="25" selection-start="491" selection-end="491" vertical-scroll-proportion="0.33168316" vertical-offset="181" max-vertical-offset="645">
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleTest" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":ShareWithTitle" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/build/source/r/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/res" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/resources" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/apk" />
<excludeFolder url="file://$MODULE_DIR$/build/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/exploded-bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android 4.2.2 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="android-support-v4" level="project" />
<orderEntry type="library" name="commons-lang3-3.1" level="project" />
</component>
</module>

View File

@ -1,24 +1,36 @@
buildscript { apply plugin: 'com.android.application'
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')
}
android { android {
compileSdkVersion 17 namespace 'net.crystalyx.sharewithtitle'
buildToolsVersion "17.0.0" compileSdk 33
defaultConfig { defaultConfig {
minSdkVersion 14 applicationId "net.crystalyx.sharewithtitle"
targetSdkVersion 16 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'
}

10
ShareWithTitle/proguard-rules.pro vendored Normal file
View File

@ -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:

View File

@ -1,24 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.sdqali.sharewithtitle" package="net.crystalyx.sharewithtitle">
android:versionCode="3"
android:versionName="1.15" >
<uses-permission android:name="android.permission.INTERNET"></uses-permission> <uses-permission android:name="android.permission.INTERNET" />
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application <application
android:allowBackup="true" android:icon="@mipmap/ic_launcher"
android:icon="@drawable/ic_launcher" android:label="Share with title"
android:label="@string/app_name" android:theme="@android:style/Theme.NoDisplay">
android:theme="@style/AppTheme" >
<activity <activity
android:name="in.sdqali.sharewithtitle.MainActivity" android:name=".MainActivity"
android:label="@string/app_name" android:exported="true">
android:noHistory="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}

View File

@ -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);
}

View File

@ -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("<head>.*?<title>(.*?)</title>", Pattern.DOTALL);
Matcher m = p.matcher(html);
String title = null;
while (m.find()) {
title = m.group(1);
}
return StringEscapeUtils.unescapeHtml4(title);
}
}

View File

@ -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<String, Void, String> {
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);
}
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}
}

View File

@ -1,21 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<ProgressBar
style="?android:attr/progressBarStyleLarge"
android:layout_width="269dp"
android:layout_height="wrap_content"
android:indeterminate="true"
android:id="@+id/progressBar"
android:layout_below="@+id/progressBar"
android:layout_toRightOf="@+id/progressBar"
android:layout_gravity="center"/>
</FrameLayout>

View File

@ -1,6 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
android:showAsAction="never" />
</menu>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,4 +0,0 @@
<resources>
<!-- Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw600dp devices (e.g. 7" tablets) here. -->
</resources>

View File

@ -1,5 +0,0 @@
<resources>
<!-- Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. -->
<dimen name="activity_horizontal_margin">128dp</dimen>
</resources>

View File

@ -1,11 +0,0 @@
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>

View File

@ -1,12 +0,0 @@
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>

View File

@ -1,5 +0,0 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Share With Title</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
</resources>

View File

@ -1,25 +0,0 @@
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module external.system.id="GRADLE" type="JAVA_MODULE" version="4"> <module version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle"> <facet type="android-gradle" name="Android-Gradle">
<configuration> <configuration>
@ -7,14 +7,4 @@
</configuration> </configuration>
</facet> </facet>
</component> </component>
<component name="NewModuleRootManager" inherit-compiler-output="true"> </module>
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -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
}

Binary file not shown.

View File

@ -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 distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip zipStoreBase=GRADLE_USER_HOME

114
gradlew vendored
View File

@ -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 # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" PRG="$0"
@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do
fi fi
done done
SAVED="`pwd`" SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&- cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`" 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 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -90,7 +89,7 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # 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` MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@ -114,6 +113,7 @@ fi
if $cygwin ; then if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@ -154,11 +154,23 @@ if $cygwin ; then
esac esac
fi fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules # Escape application args
function splitJvmOpts() { save () {
JVM_OPTS=("$@") for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
} }
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS APP_ARGS=$(save "$@")
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
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" "$@"

14
gradlew.bat vendored
View File

@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell @rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal 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 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% 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 @rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome if defined JAVA_HOME goto findJavaFromJavaHome
@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail goto fail
:init :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 not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args :win9xME_args
@rem Slurp the command line arguments. @rem Slurp the command line arguments.
@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%* set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute :execute
@rem Setup the command line @rem Setup the command line

View File

@ -1,10 +1,8 @@
# This file is automatically generated by Android Studio. ## This file must *NOT* be checked into Version Control Systems,
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration. # as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle. # Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
sdk.dir=/Applications/Android Studio.app/sdk #Sun Jul 30 19:06:21 CEST 2023
sdk.dir=/mnt/Eternia/AndroidSdk

View File

@ -1 +1,3 @@
// Boilerplate from https://transang.me/create-a-minimal-android-boilerplate-from-scratch/
rootProject.name = 'ShareWithTitle'
include ':ShareWithTitle' include ':ShareWithTitle'