Skip to content

Commit 74bc0be

Browse files
author
jianxiang
committed
update:
1.修改服务协议内容 2.移除firebase等错误代码,打包OS渠道
1 parent c0374a6 commit 74bc0be

File tree

23 files changed

+55
-1306
lines changed

23 files changed

+55
-1306
lines changed

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ allprojects {
4444

4545
mavenCentral()
4646
maven { url "https://jitpack.io" }
47-
maven { url 'https://dl.bintray.com/azeesoft/maven' }
47+
// maven { url 'https://dl.bintray.com/azeesoft/maven' }
4848
//maven { url "http://mvn.leancloud.cn/nexus/content/repositories/public" }
4949
}
5050
}
@@ -91,9 +91,9 @@ ext {
9191
libOkHttp3Log = "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
9292

9393
minSdkVersion = 14
94-
targetSdkVersion = 29
95-
compileSdkVersion = 29
96-
buildToolsVersion = '29.0.2'
94+
targetSdkVersion = 28
95+
compileSdkVersion = 28
96+
buildToolsVersion = '28.0.2'
9797

9898
// firebase related https://firebase.google.com/docs/android/setup
9999
firebaseCore = "com.google.firebase:firebase-core:16.0.7"

qpysdk/build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ android {
2020
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2121
}
2222
}
23+
sourceSets {
24+
main {
25+
jniLibs.srcDirs = ['src/main/libs']
26+
27+
}
28+
}
29+
2330
// externalNativeBuild {
2431
// ndkBuild {
2532
// path 'src/main/jni/Android.mk'

qpysdk/src/main/java/org/qpython/qpysdk/QPyConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface QPyConstants extends BASE_CONF {
3434
final String KEY_NOTEBOOK2_RES = "setting.notebook2resource.path";
3535

3636

37-
// String ABSOLUTE_PATH = Environment.getExternalStorageDirectory().getPath() + "/" + BASE_PATH;
37+
String ABSOLUTE_PATH = Environment.getExternalStorageDirectory().getPath() + "/" + BASE_PATH;
3838
// String ABSOLUTE_PATH = FileUtils.getPath().getPath() + "/" + BASE_PATH;
3939
// String PY_CACHE_PATH = ABSOLUTE_PATH+"/"+PY_CACHE;
4040
// String ABSOLUTE_LOG = ABSOLUTE_PATH + "/log/last.log";

qpython/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
defaultConfig {
1515
minSdkVersion rootProject.ext.minSdkVersion
1616
targetSdkVersion rootProject.ext.targetSdkVersion
17-
versionCode 304
18-
versionName "3.0.0"
17+
versionCode 305
18+
versionName "3.0.1"
1919
multiDexEnabled true
2020
vectorDrawables.useSupportLibrary = true
2121

qpython/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
android:icon="@drawable/ic_launcher"
7272
android:label="@string/app_name"
7373
android:largeHeap="true"
74-
android:requestLegacyExternalStorage="true"
7574
android:supportsRtl="true"
7675
android:theme="@style/AppTheme">
7776
<uses-library android:name="org.apache.http.legacy" android:required="false"/>

qpython/src/main/java/org/qpython/qpy/main/activity/SplashActivity.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ private void initData() {
4848
}
4949

5050
private void setAgreeContent() {
51-
String one = "您可以阅读完整版";
52-
String two = "《服务协议》";
53-
String three = "和";
54-
String four = "《隐私政策》";
51+
String one = getString(R.string.user_agreement_bottom_split1);
52+
String two = getString(R.string.user_agreement_bottom_split2);
53+
String three = getString(R.string.user_agreement_bottom_split3);
54+
String four = getString(R.string.user_agreement_bottom_split4);
5555

5656
String content = one + two + three + four;
5757
SpannableString str = new SpannableString(content);
@@ -67,13 +67,13 @@ private void setAgreeContent() {
6767
}
6868

6969
private void setContent() {
70-
StringBuffer buffer = new StringBuffer();
71-
buffer.append("1.为了给您提供发布服务,我们可能会向您申请摄像头权限、麦克风权限、收集存储权限;\n");
72-
buffer.append("2.为了向您推荐您附近的村庄,我们会向您申请位置权限;\n");
73-
buffer.append("3.为了账号安全,我们会向您申请系统设备权限收集设备信息、日志信息;\n");
74-
buffer.append("4.我们会努力采取各种安全技术保护您的个人信息。未经您同意,我们不会从第三方获取、共享或对外提供您的信息;\n");
75-
buffer.append("5.您还可以访问、更正、删除您的个人信息,我们为您提供了注销、投诉等多种不同方式。");
76-
binding.tvContent.setText(buffer.toString());
70+
// StringBuffer buffer = new StringBuffer();
71+
// buffer.append("1.为了给您提供发布服务,我们可能会向您申请摄像头权限、麦克风权限、收集存储权限;\n");
72+
// buffer.append("2.为了向您推荐您附近的村庄,我们会向您申请位置权限;\n");
73+
// buffer.append("3.为了账号安全,我们会向您申请系统设备权限收集设备信息、日志信息;\n");
74+
// buffer.append("4.我们会努力采取各种安全技术保护您的个人信息。未经您同意,我们不会从第三方获取、共享或对外提供您的信息;\n");
75+
// buffer.append("5.您还可以访问、更正、删除您的个人信息,我们为您提供了注销、投诉等多种不同方式。");
76+
binding.tvContent.setText(R.string.user_agreement_text);
7777
}
7878

7979
private void judgeAgreementStatus() {

qpython/src/main/res/values-zh-rCN/strings.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,4 +457,15 @@
457457
<string name="privacy_agreement">服务协议</string>
458458
<string name="service_agreement">隐私政策</string>
459459

460+
<string name="user_agreement_text">1.为了让您使用手机的硬件特性进行编程,QPython可能会使用您申请摄像头权限、麦克风权限、读写存储等权限;\n\n
461+
2.为了让您使用手机的地理位置用于编程,QPython可能会向您申请位置权限;\n\n
462+
3.为了让您使用手机的账号信息用于编程,QPython可能会向您申请系统设备权限收集设备信息、日志信息;\n\n
463+
4.我们会努力采取各种安全技术保护您的个人信息。未经您同意,我们不会从第三方获取、共享或对外提供您的信息;\n\n
464+
5.如果不是你主动在系统设置->Apps->QPython权限中管理上述权限,QPython不会自动使用它们。\n\n</string>
465+
466+
<string name="user_agreement_bottom_split1">您可以阅读完整版</string>
467+
<string name="user_agreement_bottom_split2">《服务协议》</string>
468+
<string name="user_agreement_bottom_split3">和</string>
469+
<string name="user_agreement_bottom_split4">《隐私政策》</string>
470+
460471
</resources>

qpython/src/main/res/values/strings.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@
5858
<string name="internal_space"><![CDATA[Permissions & Storage]]></string>
5959
<string name="ftp_server">FTP Server</string>
6060

61+
<string name="user_agreement_text">1. In order to allow you to use the hardware features of your mobile phone for programming, QPython may apply for camera permission, microphone permission, read-write storage and other permissions;\n\n
62+
2. In order to allow you to use the geographical location of your mobile phone for programming, QPython may apply to you for location permission;\n\n
63+
3. In order to allow you to use the account information of your mobile phone for programming, QPython may apply for system device permission to collect device information and log information;\n\n
64+
4. We will strive to adopt various security technologies to protect your personal information. Without your consent, we will not obtain, share or provide your information from a third party;\n\n
65+
5. If you do not actively manage the above permissions in system settings - > Apps - > qpython permissions, QPython will not automatically use them.\n\n
66+
</string>
67+
68+
<string name="user_agreement_bottom_split1">You can read the full </string>
69+
<string name="user_agreement_bottom_split2">&#60;&#60;service agreement&#62;&#62; </string>
70+
<string name="user_agreement_bottom_split3">and </string>
71+
<string name="user_agreement_bottom_split4">&#60;&#60;privacy policy&#62;&#62;</string>
72+
6173
<!---->
6274
<string name="application_terminal">Terminal</string>
6375
<string name="preferences">Preference</string>

qpython/src/od/AndroidManifest.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -379,20 +379,6 @@
379379
android:name=".main.activity.NotebookListActivity"
380380
android:configChanges="keyboardHidden|orientation|screenSize"/>
381381

382-
<service
383-
android:name=".main.service.MyFirebaseMessagingService"
384-
tools:ignore="ExportedService">
385-
<intent-filter>
386-
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
387-
</intent-filter>
388-
</service>
389-
<service
390-
android:name=".main.service.MyFirebaseInstanceIDService"
391-
tools:ignore="ExportedService">
392-
<intent-filter>
393-
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
394-
</intent-filter>
395-
</service>
396382
</application>
397383

398384
<meta-data

qpython/src/od/java/org/qpython/qpy/codeshare/ShareCodeUtil.java

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -528,99 +528,6 @@ public boolean uploadFile(String path, DatabaseReference.CompletionListener comp
528528
return true;
529529
}
530530

531-
public void getUploadedScripts(boolean forceRefresh, Activity context, Action1<List<CloudFile>> callback) {
532-
if (CLEAR) {
533-
return;
534-
}
535-
String content = FileHelper.getFileContents(FileUtils.getCloudMapCachePath(context.getApplicationContext()));
536-
List<CloudFile> cloudFiles = content == null ? null : App.getGson().fromJson(content, new TypeToken<List<CloudFile>>() {
537-
}.getType());
538-
if (cloudFiles != null && !forceRefresh) {
539-
Observable.just(cloudFiles)
540-
.subscribe(callback);
541-
} else {
542-
email = App.getUser()!=null?App.getUser().getEmail().replace(".","_"):"";
543-
if (email.equals("")) {
544-
Toast.makeText(context, "Waiting the firebase to initializ...",Toast.LENGTH_SHORT).show();
545-
546-
} else {
547-
reference.child(CLOUD).child(email).child(INDEX).addListenerForSingleValueEvent(new ValueEventListener() {
548-
@Override
549-
public void onDataChange(DataSnapshot dataSnapshot) {
550-
HashMap<String, Object> value = (HashMap<String, Object>) dataSnapshot.getValue();
551-
if (value == null) {
552-
resetUsage(0);
553-
Observable.just(new ArrayList<CloudFile>())
554-
.subscribe(callback);
555-
return;
556-
}
557-
List<CloudFile> cloudFiles = new ArrayList<>();
558-
for (String node : value.keySet()) {
559-
switch (node) {
560-
case SCRIPT:
561-
HashMap<String, Object> script;
562-
script = (HashMap<String, Object>) value.get(SCRIPT);
563-
for (String o : script.keySet()) {
564-
CloudFile cloudFile = new CloudFile();
565-
cloudFile.setName(o);
566-
cloudFile.setKey(SCRIPT + "/" + o);
567-
cloudFile.setPath(SCRIPTS_PATH);
568-
cloudFile.setUploadTime((String) script.get(o));
569-
cloudFiles.add(cloudFile);
570-
}
571-
break;
572-
case PROJECT:
573-
HashMap<String, Object> project = (HashMap<String, Object>) value.get(PROJECT);
574-
for (String s : project.keySet()) {
575-
CloudFile cloudFile = new CloudFile();
576-
cloudFile.setKey(PROJECT + "/" + s);
577-
String[] nodes = s.split(SLASH_REPLACE);
578-
cloudFile.setName(nodes[nodes.length - 1]);
579-
cloudFile.setProjectName(nodes[0]);
580-
cloudFile.setPath(s.replace(nodes[0], ""));
581-
cloudFile.setUploadTime((String) project.get(s));
582-
cloudFiles.add(cloudFile);
583-
}
584-
break;
585-
default:
586-
HashMap<String, Object> other = (HashMap<String, Object>) value.get(OTHER);
587-
for (String s : other.keySet()) {
588-
CloudFile cloudFile = new CloudFile();
589-
cloudFile.setPath(s);
590-
cloudFile.setKey(OTHER + "/" + s);
591-
String[] nodes = s.split(SLASH_REPLACE);
592-
boolean index = false;
593-
for (String node1 : nodes) {
594-
if (index) {
595-
cloudFile.setProjectName(node1);
596-
break;
597-
} else if (node1.equals("projects3")) {
598-
index = true;
599-
}
600-
}
601-
cloudFile.setName(nodes[nodes.length - 1]);
602-
cloudFile.setUploadTime((String) other.get(s));
603-
cloudFiles.add(cloudFile);
604-
}
605-
break;
606-
}
607-
}
608-
resetUsage(cloudFiles.size());
609-
Observable.just(cloudFiles)
610-
.subscribe(callback);
611-
ACache.get(context).put(CLOUD_FILE, App.getGson().toJson(cloudFiles));
612-
613-
}
614-
615-
@Override
616-
public void onCancelled(DatabaseError databaseError) {
617-
618-
}
619-
});
620-
}
621-
}
622-
}
623-
624531
public void getFileContent(String path, Action1<String> callback) {
625532
reference.child(CLOUD)
626533
.child(email)
@@ -645,19 +552,6 @@ public void onCancelled(DatabaseError databaseError) {
645552
});
646553
}
647554

648-
public void deleteUploadScript(CloudFile cloudFile, DatabaseReference.CompletionListener listener) {
649-
reference.child(CLOUD)
650-
.child(email)
651-
.child(cloudFile.getKey())
652-
.removeValue(listener);
653-
reference.child(CLOUD)
654-
.child(email)
655-
.child(INDEX)
656-
.child(cloudFile.getKey())
657-
.removeValue();
658-
changeUsage(-1);
659-
}
660-
661555
public void initUsage(Action1<Integer> callback) {
662556
if (CLEAR) {
663557
return;

0 commit comments

Comments
 (0)