Skip to content

Commit

Permalink
Merge pull request #19 from daktak/development
Browse files Browse the repository at this point in the history
0.4.5 fix for mirrors download
  • Loading branch information
daktak authored Oct 18, 2017
2 parents c708df7 + 743c85c commit 9e3b5a4
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.afhdownloader"
minSdkVersion 16
targetSdkVersion 24
versionCode 9
versionName "0.4.4"
versionCode 10
versionName "0.4.5"
}
buildTypes {
release {
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/org/afhdownloader/Download.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public ArrayList<String> getDLUrl(String url){
HttpURLConnection httpcon = (HttpURLConnection) ((new URL(mUrl).openConnection()));
httpcon.setDoOutput(true);
httpcon.setRequestMethod("POST");
httpcon.setRequestProperty("User-Agent","Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0");
httpcon.setRequestProperty("X-MOD-SBB-CTYPE","xhr");
httpcon.connect();

//Write
Expand Down
44 changes: 42 additions & 2 deletions app/src/main/java/org/afhdownloader/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

/**
* daktak
Expand Down Expand Up @@ -56,7 +59,42 @@ protected void onCreate(Bundle savedInstanceState) {

PreferenceManager.setDefaultValues(this, R.xml.settings, false);

String[] names = new String[] {getString(R.string.loading)};
String[] names = new String[] {getString(R.string.loading)};/*
TabHost myTabHost = (TabHost)this.findViewById(R.id.th_set_menu_tabhost);
myTabHost.setup();
for(int i=0; i<5; i++ )
{
final TabSpec x=tabHost2.newTabSpec("x");
View row = inflater.inflate(R.layout.indicator1,null);
final TextView indicator1 =(TextView) row.findViewById(R.id.textView_indicator1);
indicator1.setText(indicator_list[i]);
// indicator1.setShadowLayer(1, 0, 1, 0xFF013201);
x.setIndicator(row);
x.setContent(new TabContentFactory() {
public View createTabContent(String arg) {
return gallery2;
}
});
tabHost2.addTab(x);
ls1 = new ListView(Main_screen.this);
TabSpec ts1 = myTabHost.newTabSpec("TAB_TAG_1");
ts1.setIndicator("Tab1");
ts1.setContent(new TabHost.TabContentFactory(){
public View createTabContent(String tag)
{
ArrayAdapter<String> adapter = new ArrayAdapter<String>(Main_screen.this,android.R.layout.simple_list_item_1,new String[]{"item1","item2","item3"});
ls1.setAdapter(adapter);
return ls1;
}
});
myTabHost.addTab(ts1);
}*/
ListView mainListView = (ListView) findViewById( R.id.listView );
ListAdapter listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, names);
// Set the ArrayAdapter as the ListView's adapter.
Expand Down Expand Up @@ -138,11 +176,13 @@ public void run(Context context) {
context.startService(service);
}

//get for a specific int
public String buildPath(Context context) {
SharedPreferences mySharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
String base = mySharedPreferences.getString("prefBase",getString(R.string.base_val)).trim();
String flid = mySharedPreferences.getString("prefFlid",getString(R.string.flid_val)).trim();
//String url_ext = mySharedPreferences.getString("prefUrlext",getString(R.string.urlext_val)).trim();
//if instring ,
//List<String> flida = Arrays.asList(flid.split(","));
String url_ext = "?w=files&flid=";

return base+"/"+url_ext+flid;
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:layout="@layout/fragment_main">

<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView" />

</fragment>
42 changes: 42 additions & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<resources>
<string name="app_name">AFH Downloader</string>
<string name="action_settings">設定</string>
<string name="action_reboot">再起動して回復</string>
<string name="flid">Flid</string>
<string name="flid_sum">androidfilehost flid 値</string>
<string name="settings">設定</string>
<string name="adv_set">詳細設定</string>
<string name="base_url">ベース Url</string>
<string name="base_sum"></string>
<string name="selector">セレクター</string>
<string name="selector_sum">JSoup 選択ステートメント</string>
<string name="directory">ディレクトリー</string>
<string name="directory_sum">ダウンロード先ディレクトリー</string>
<string name="external_browser">外部ブラウザー</string>
<string name="external_sum">ダウンロードに外部ブラウザーを使用します</string>
<string name="loading">ロード中&#8230;</string>
<string name="wifionly">WIFI のみ</string>
<string name="wifi_sum">WIFI 接続時のみダウンロードします</string>
<string name="extWritePerm">ファイルのダウンロードは外部ストレージの書き込みアクセス許可が必要です。</string>
<string name="extReadPerm">既存のダウンロードを判断するため外部ストレージの読み取りアクセス許可が必要です。</string>
<string name="dailydownload">日次ダウンロード</string>
<string name="dailydownload_sum"></string>
<string name="hour"></string>
<string name="hour_sum"></string>
<string name="minute">分</string>
<string name="minute_sum"></string>
<string name="pref_auto">起動後にスケジュールされた日次のダウンロードを行う</string>
<string name="auto">自動起動</string>
<string name="choose">選択</string>
<string name="urlext">URL 拡張</string>
<string name="urlext_sum"></string>
<string name="mirrorurl">ミラー URL</string>
<string name="mirrorurl_sum"></string>
<string name="mirrordata">HTTP ミラー POST データ</string>
<string name="mirrordata_sum"></string>
<string name="imgdesc">MD5 インジケーター</string>
<string name="yes">はい</string>
<string name="no">いいえ</string>
<string name="delete">削除</string>
</resources>

0 comments on commit 9e3b5a4

Please sign in to comment.