Skip to content

Commit

Permalink
Merge pull request #153 from nikitasius/noshit_9.3.3
Browse files Browse the repository at this point in the history
Telegraher 9.33.29
  • Loading branch information
nikitasius authored Jan 29, 2023
2 parents f5eb6c4 + 2469c62 commit 53f5d1c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/Dockerfile_bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
asset_name: ${{ env.ANAME }}${{ env.AARCH }}.apk
asset_content_type: application/gzip
env:
RNAME: Telegraher 9.33.28
TNAME: graher_9.33.28_
ANAME: Telegraher.9.33.28.
RNAME: Telegraher 9.33.29
TNAME: graher_9.33.29_
ANAME: Telegraher.9.33.29.
AARCH: bundle
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ different)
* Realeases are
here: [https://github.com/nikitasius/Telegraher/releases](https://github.com/nikitasius/Telegraher/releases)
* if it contain `beta` it mean it's BETA
* Last release `9.33.28`: [bundle](https://github.com/nikitasius/Telegraher/releases/tag/graher_9.33.28_bundle)
* Last release `9.33.29`: [bundle](https://github.com/nikitasius/Telegraher/releases/tag/graher_9.33.29_bundle)
* Last beta: write `!beta` in chat

### Issues/Wishlist
Expand Down
3 changes: 3 additions & 0 deletions README_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changes

* 9.33.29
* fixed bug when you copied a channel link graher copied dummy text
* more try-with-resources
* 9.33.28
* removing memory leaks
* "optimise the code"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ private static byte[] executePost(
/* length= */ C.LENGTH_UNSET,
/* key= */ null,
DataSpec.FLAG_ALLOW_GZIP);
DataSourceInputStream inputStream = new DataSourceInputStream(dataSource, dataSpec);
try {
try(DataSourceInputStream inputStream = new DataSourceInputStream(dataSource, dataSpec)){
return Util.toByteArray(inputStream);
} catch (InvalidResponseCodeException e) {
// For POST requests, the underlying network stack will not normally follow 307 or 308
Expand All @@ -175,8 +174,6 @@ private static byte[] executePost(
throw e;
}
url = redirectUrl;
} finally {
Util.closeQuietly(inputStream);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ public void cleanResources() {
}

private void storeData(ByteBuffer data) {
try {
try (FileOutputStream fos = new FileOutputStream(file)) {
final byte[] input = data.array();
FileOutputStream fos = new FileOutputStream(file);

final Deflater deflater = new Deflater(Deflater.BEST_SPEED, true);
deflater.setInput(input, data.arrayOffset(), data.remaining());
Expand All @@ -56,8 +55,6 @@ private void storeData(ByteBuffer data) {
fos.write(buf, 0, byteCount);
}
deflater.end();

fos.close();
} catch (Exception e) {
FileLog.e(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,13 +648,8 @@ public static String readRes(File path, int rawRes) {
readBuffer = new byte[64 * 1024];
readBufferLocal.set(readBuffer);
}
InputStream inputStream = null;
try {
if (path != null) {
inputStream = new FileInputStream(path);
} else {
inputStream = ApplicationLoader.applicationContext.getResources().openRawResource(rawRes);
}

try (InputStream inputStream = (path != null ? new FileInputStream(path) : ApplicationLoader.applicationContext.getResources().openRawResource(rawRes))) {
int readLen;
byte[] buffer = bufferLocal.get();
if (buffer == null) {
Expand All @@ -675,14 +670,6 @@ public static String readRes(File path, int rawRes) {
}
} catch (Throwable e) {
return null;
} finally {
try {
if (inputStream != null) {
inputStream.close();
}
} catch (Throwable ignore) {

}
}

return new String(readBuffer, 0, totalRead);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4787,8 +4787,8 @@ private boolean processOnClickOrPress(final int position, final View view, final
}
} else {
TLRPC.Chat chat = getMessagesController().getChat(chatId);
String link = "https://" + getLink(ChatObject.getPublicUsername(chat), topicId);
showDialog(new ShareAlert(getParentActivity(), null, link, false, link, false) {
text = "https://" + getLink(ChatObject.getPublicUsername(chat), topicId);
showDialog(new ShareAlert(getParentActivity(), null, text, false, text, false) {
@Override
protected void onSend(LongSparseArray<TLRPC.Dialog> dids, int count, TLRPC.TL_forumTopic topic) {
AndroidUtilities.runOnUIThread(() -> {
Expand Down
12 changes: 1 addition & 11 deletions TMessagesProj/src/main/java/org/telegram/ui/ThemeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1772,20 +1772,10 @@ private void showOptionsForTheme(Theme.ThemeInfo themeInfo) {
result.append(entry.getKey()).append("=").append(entry.getValue()).append("\n");
}
currentFile = new File(ApplicationLoader.getFilesDirFixed(), "default_theme.attheme");
FileOutputStream stream = null;
try {
stream = new FileOutputStream(currentFile);
try (FileOutputStream stream = new FileOutputStream(currentFile)){
stream.write(AndroidUtilities.getStringBytes(result.toString()));
} catch (Exception e) {
FileLog.e(e);
} finally {
try {
if (stream != null) {
stream.close();
}
} catch (Exception e) {
FileLog.e(e);
}
}
} else if (themeInfo.assetName != null) {
currentFile = Theme.getAssetFile(themeInfo.assetName);
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Sat Mar 12 05:53:50 MSK 2016
APP_VERSION_NAME=9.33.28
APP_VERSION_CODE=3026028
APP_VERSION_NAME=9.33.29
APP_VERSION_CODE=3026029
APP_PACKAGE=com.evildayz.code.telegraher2
RELEASE_KEY_PASSWORD=android
RELEASE_KEY_ALIAS=androidkey
Expand Down

0 comments on commit 53f5d1c

Please sign in to comment.