2010-10-19 23:24:04 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
|
|
xmlns:tools="http://schemas.android.com/tools"
|
2013-11-19 23:47:05 -05:00
|
|
|
android:layout_width="wrap_content"
|
|
|
|
android:layout_height="wrap_content"
|
2015-07-23 09:47:27 +03:00
|
|
|
android:paddingLeft="24dp"
|
|
|
|
android:paddingStart="24dp"
|
|
|
|
android:paddingRight="24dp"
|
|
|
|
android:paddingEnd="24dp"
|
|
|
|
android:paddingTop="20dp">
|
2013-11-19 23:47:05 -05:00
|
|
|
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/add_repo_form"
|
2013-11-19 23:47:05 -05:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
android:orientation="vertical">
|
2013-11-19 23:47:05 -05:00
|
|
|
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
<TextView
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:text="@string/repo_add_url" />
|
2013-11-19 23:47:05 -05:00
|
|
|
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
<EditText
|
|
|
|
android:id="@+id/edit_uri"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:inputType="textUri"
|
|
|
|
android:maxLines="2"
|
|
|
|
android:text="@string/https" />
|
2013-11-19 23:47:05 -05:00
|
|
|
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
<TextView
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:text="@string/repo_add_fingerprint" />
|
|
|
|
|
|
|
|
<EditText
|
|
|
|
android:id="@+id/edit_fingerprint"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:digits="0123456789ABCDEFabcedf: "
|
|
|
|
android:inputType="textNoSuggestions"
|
|
|
|
android:maxLines="3"
|
|
|
|
android:typeface="monospace" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
android:id="@+id/overwrite_message"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
2015-05-09 09:42:48 +10:00
|
|
|
android:padding="10dp"
|
|
|
|
tools:text="This repo is already setup, this will add new key information."/>
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
|
|
|
|
</LinearLayout>
|
2013-11-19 23:47:05 -05:00
|
|
|
|
2013-12-02 20:12:52 -05:00
|
|
|
<TextView
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
android:padding="10dp"
|
|
|
|
android:textSize="16sp"
|
|
|
|
android:id="@+id/text_searching_for_repo"
|
|
|
|
android:gravity="center"
|
2013-11-19 23:47:05 -05:00
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
tools:text="Searching for repository at\nhttps://www.example.com/fdroid/repo/" />
|
2013-11-19 23:47:05 -05:00
|
|
|
|
Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).
This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.
The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.
Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-12 21:54:32 +11:00
|
|
|
</RelativeLayout><!--
|
2010-10-19 23:24:04 +01:00
|
|
|
* Copyright (C) 2009 Roberto Jacinto
|
|
|
|
* roberto.jacinto@caixamagica.pt
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2014-12-30 23:48:36 +01:00
|
|
|
*
|
2010-10-19 23:24:04 +01:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2011-06-07 08:55:39 +01:00
|
|
|
-->
|